Hi Mathieu,
perf/Documentation/intel-pt.txt describes how to make autoFDO work with Intel-PT recorded traces:
# perf record -e intel_pt//u ./sort # perf inject -i perf.data -o inj --itrace=i100usl --strip # create_gcov --binary=./sort --profile=inj --gcov=sort.gcov -gcov_version=1 # gcc -O3 -fauto-profile=sort.gcov sort.c -o sort_autofdo
On the ARM side, I was able to get an ETM trace, and I started working with my colleague Brian Rzycki on the second step that translates the trace into branch events.
Attached is the current state of the patch that adds functionality from intel-pt.c to cs-etm.c. We are still trying to get more than one branch recorded in the branch stack before emitting an event, and it looks like what we need is to decode more than a packet at a time in cs-etm-decoder.c like in cs_etm_decoder__buffer_packet()
Comments on the early version of the patch are welcome.
Thanks, Sebastian