autofdo

AutoFDO

  • 所有者: google/autofdo
  • 平台:
  • 许可证: Apache License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

The repository contains a tool to convert perf.data profile to AutoFDO
profile that can be used by GCC and LLVM.

Each compiler is supported by a different tool. For GCC, use
'create_gcov'. For LLVM, use 'create_llvm_prof'. LLVM version
5 or higher is required. The two tools have compatible command
line flags. However, the outputs are incompatible. You cannot
use the profile generated for GCC in LLVM and vice-versa.

Install dependencies:
sudo apt-get -y install autoconf automake git libelf-dev libssl-dev pkg-config

Clone the repository using the following command:
git clone --recursive https://github.com/google/autofdo.git

Note: `--recursive` fetches https://github.com/google/perf_data_converter.git,
which contains quipper, and https://github.com/google/protobuf.git.

Full build instructions are in the INSTALL file, most can just install the above
dependencies, and:

aclocal -I .; autoheader; autoconf; automake --add-missing -c
./configure # or --with-llvm=$(which llvm-config-5.0)
make

(Note: do not use the '-j' (parallel build) option of make. The configure scripts
for the sub-projects fail if run in parallel)

Usage:
./create_gcov --binary=BINARY --profile=PERF_PROFILE --gcov=OUTPUT
./create_llvm_prof --binary=BINARY --profile=PERF_PROFILE --out=OUTPUT

Inputs:

--profile: PERF_PROFILE collected using linux perf (with last branch record).
In order to collect this profile, you will need to have an Intel CPU that
have last branch record (LBR) support. You also need to have your linux
kernel configured with LBR support. To profile:

perf record -c PERIOD -e EVENT -b -o perf.data -- ./command

EVENT is refering to BR_INST_RETIRED:TAKEN if available. For some
architectures, BR_INST_EXEC:TAKEN also works.

--binary: BINARY with debug info. You need to make sure the binary name is
the same as the binary you run during profiling. Additionally, you will need
to have debug info (i.e. line table) availabe in the binary. This means that
you need to compile the binary with "-gmlt" or "-g1". For LLVM, you alse need
to have -fdebug-info-for-profiling.

Output:

For create_gcov:
An AutoFDO profile in gcov format. To use the profile with
AutoFDO, you need to use the google gcc branch
(gcc.gnu.org/svn/gcc/branches/google/gcc-4_8), and pass the
following flag to GCC: -fauto-profile=PROFILE_FILE

For create_llvm_prof:
An AutoFDO profile in LLVM format. To use the profile with
LLVM, you need to use the flag -fprofile-sample-use=PROFILE_FILE.
This feature is available in LLVM 3.5 and later.

主要指标

概览
名称与所有者google/autofdo
主编程语言C++
编程语言C++ (语言数: 4)
平台
许可证Apache License 2.0
所有者活动
创建于2014-04-01 22:37:47
推送于2025-07-24 06:28:03
最后一次提交2025-07-24 11:58:02
发布数15
最新版本名称v0.30.1 (发布于 )
第一版名称v0.1 (发布于 2014-05-23 11:57:10)
用户参与
星数562
关注者数31
派生数117
提交数281
已启用问题?
问题数118
打开的问题数75
拉请求数95
打开的拉请求数20
关闭的拉请求数17
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?