87 lines · plain
1Intel Branch Trace Store2========================3 4Overview5========6 7Intel BTS could be regarded as a predecessor to Intel PT and has some8similarities because it can also identify every branch a program takes. A9notable difference is that Intel BTS has no timing information and as a10consequence the present implementation is limited to per-thread recording.11 12While decoding Intel BTS does not require walking the object code, the object13code is still needed to pair up calls and returns correctly, consequently much14of the Intel PT documentation applies also to Intel BTS. Refer to the Intel PT15documentation and consider that the PMU 'intel_bts' can usually be used in16place of 'intel_pt' in the examples provided, with the proviso that per-thread17recording must also be stipulated i.e. the --per-thread option for18'perf record'.19 20 21perf record22===========23 24new event25---------26 27The Intel BTS kernel driver creates a new PMU for Intel BTS. The perf record28option is:29 30 -e intel_bts//31 32Currently Intel BTS is limited to per-thread tracing so the --per-thread option33is also needed.34 35 36snapshot option37---------------38 39The snapshot option is the same as Intel PT (refer Intel PT documentation).40 41 42auxtrace mmap size option43-----------------------44 45The mmap size option is the same as Intel PT (refer Intel PT documentation).46 47 48perf script49===========50 51By default, perf script will decode trace data found in the perf.data file.52This can be further controlled by option --itrace. The --itrace option is53the same as Intel PT (refer Intel PT documentation) except that neither54"instructions" events nor "transactions" events (and consequently call55chains) are supported.56 57To disable trace decoding entirely, use the option --no-itrace.58 59 60dump option61-----------62 63perf script has an option (-D) to "dump" the events i.e. display the binary64data.65 66When -D is used, Intel BTS packets are displayed.67 68To disable the display of Intel BTS packets, combine the -D option with69--no-itrace.70 71 72perf report73===========74 75By default, perf report will decode trace data found in the perf.data file.76This can be further controlled by new option --itrace exactly the same as77perf script.78 79 80perf inject81===========82 83perf inject also accepts the --itrace option in which case tracing data is84removed and replaced with the synthesized events. e.g.85 86 perf inject --itrace -i perf.data -o perf.data.new87