This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: AutoFDO profile toolchain is open-sourced
- From: Aditya K <hiraditya at msn dot com>
- To: Andi Kleen <andi at firstfloor dot org>, Ilya Palachev <i dot palachev at samsung dot com>
- Cc: Diego Novillo <dnovillo at google dot com>, GCC Development <gcc at gcc dot gnu dot org>, David Li <davidxl at google dot com>, Jan Hubicka <hubicka at ucw dot cz>, Sebastian Pop <sebpop at gmail dot com>, Dehao Chen <dehao at google dot com>, Vyacheslav Barinov <v dot barinov at samsung dot com>
- Date: Tue, 21 Apr 2015 20:33:15 +0000
- Subject: RE: AutoFDO profile toolchain is open-sourced
- Authentication-results: sourceware.org; auth=none
- References: <CAO2gOZWydpiBXb=1QDyCRt-ybDieqy8X4S_+uRZk2Y2v+cFdYQ at mail dot gmail dot com> <5523ED98 dot 8080007 at samsung dot com> <CAFk3UF8To5Qcz8NN5rUF3z6j8CCg_89A+62P=1U9YrtbZ5=mLg at mail dot gmail dot com> <20150410203927 dot GA18980 at atrey dot karlin dot mff dot cuni dot cz> <552E1613 dot 2040405 at samsung dot com> <5536278E dot 3090706 at samsung dot com> <CAD_=9DQEqCqzyBKT8nZ1_uEt5gU589hSpLiOHUqLXKctJTaVHA at mail dot gmail dot com> <553653CA dot 9070009 at samsung dot com>,<87wq15mud5 dot fsf at tassilo dot jf dot intel dot com>
After patching linux perf. This script collects creates a coverage file (e.g., for linpack) which can be used for fdo.
gcov=linpack-x86.gcov
MAKE='make'
# x86
x86() {
CC=/usr/bin/gcc
CXX=/usr/bin/g++
export CFLAGS="-Ofast -g3 -static"
export CPPFLAGS=$CFLAGS
$MAKE -C $SRC/SingleSource/Benchmarks/Linpack clean
$MAKE -C $SRC/SingleSource/Benchmarks/Linpack -k TEST=simple TARGET_LLVMGCC=$CC TARGET_CXX=$CXX LLI_OPTFLAGS= TARGET_CC=$CC TARGET_LLVMGXX=$CXX CC_UNDER_TEST_IS_GCC=1 TARGET_FLAGS= USE_REFERENCE_OUTPUT=1 CC_UNDER_TEST_TARGET_IS_AARCH64=1 OPTFLAGS= LLC_OPTFLAGS= ENABLE_OPTIMIZED=1 ARCH=x86_64 ENABLE_HASHED_PROGRAM_OUTPUT=1 DISABLE_JIT=1
perfdata=autofdo-linpack/perf-x86.data
perf record -b -e branch-instructions -o $perfdata $SRC/SingleSource/Benchmarks/Linpack/Output/linpack-pc.simple
autofdo/usr/bin/create_gcov --binary=$SRC/SingleSource/Benchmarks/Linpack/Output/linpack-pc.simple --profile=$perfdata --gcov=$gcov
}
hth,
-Aditya
----------------------------------------
> From: andi@firstfloor.org
> To: i.palachev@samsung.com
> CC: dnovillo@google.com; gcc@gcc.gnu.org; davidxl@google.com; hubicka@ucw.cz; sebpop@gmail.com; dehao@google.com; v.barinov@samsung.com
> Subject: Re: AutoFDO profile toolchain is open-sourced
> Date: Tue, 21 Apr 2015 07:25:10 -0700
>
> Ilya Palachev <i.palachev@samsung.com> writes:
>>
>> But why create_gcov does not inform about that (no branch events were
>> found)? It creates empty gcov file and says nothing :(
>>
>> Moreover, in the mentioned README it is said that perf should also be
>> executed with option -e BR_INST_RETIRED:TAKEN.
>
> Standard perf doesn't have a full event list
> This assumes a perf patched with the libpfm patch.
>
> Also I suspect it really wants to use PEBS events, so pp should be added.
>
> Alternatively you can use ocperf (from
> http://github.com/andikleen/pmu-tools) which is just a wrapper:
>
> ocperf.py record -e br_inst_retired.near_taken:pp -b ...
>
> or specify the event manually (depending on your CPU, like)
>
> perf record -e
> cpu/event=0xc4,umask=0x20,name=br_inst_retired_near_taken,period=400009/pp
> -b ...
>
> BTW the biggest problem with autofdo currently is that it is
> quite bitrotten and supports only several years old perf.
> So all of this above will only work with old distributions,
> unless you compile an old perf utility first.
>
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only