Adrian Hunter | d0170af | 2015-07-17 19:33:43 +0300 | [diff] [blame] | 1 | Intel Branch Trace Store |
| 2 | ======================== |
| 3 | |
| 4 | Overview |
| 5 | ======== |
| 6 | |
| 7 | Intel BTS could be regarded as a predecessor to Intel PT and has some |
| 8 | similarities because it can also identify every branch a program takes. A |
| 9 | notable difference is that Intel BTS has no timing information and as a |
| 10 | consequence the present implementation is limited to per-thread recording. |
| 11 | |
| 12 | While decoding Intel BTS does not require walking the object code, the object |
| 13 | code is still needed to pair up calls and returns correctly, consequently much |
| 14 | of the Intel PT documentation applies also to Intel BTS. Refer to the Intel PT |
| 15 | documentation and consider that the PMU 'intel_bts' can usually be used in |
| 16 | place of 'intel_pt' in the examples provided, with the proviso that per-thread |
| 17 | recording must also be stipulated i.e. the --per-thread option for |
| 18 | 'perf record'. |
| 19 | |
| 20 | |
| 21 | perf record |
| 22 | =========== |
| 23 | |
| 24 | new event |
| 25 | --------- |
| 26 | |
| 27 | The Intel BTS kernel driver creates a new PMU for Intel BTS. The perf record |
| 28 | option is: |
| 29 | |
| 30 | -e intel_bts// |
| 31 | |
| 32 | Currently Intel BTS is limited to per-thread tracing so the --per-thread option |
| 33 | is also needed. |
| 34 | |
| 35 | |
| 36 | snapshot option |
| 37 | --------------- |
| 38 | |
| 39 | The snapshot option is the same as Intel PT (refer Intel PT documentation). |
| 40 | |
| 41 | |
| 42 | auxtrace mmap size option |
| 43 | ----------------------- |
| 44 | |
| 45 | The mmap size option is the same as Intel PT (refer Intel PT documentation). |
| 46 | |
| 47 | |
| 48 | perf script |
| 49 | =========== |
| 50 | |
| 51 | By default, perf script will decode trace data found in the perf.data file. |
| 52 | This can be further controlled by option --itrace. The --itrace option is |
| 53 | the same as Intel PT (refer Intel PT documentation) except that neither |
| 54 | "instructions" events nor "transactions" events (and consequently call |
| 55 | chains) are supported. |
| 56 | |
| 57 | To disable trace decoding entirely, use the option --no-itrace. |
| 58 | |
| 59 | |
| 60 | dump option |
| 61 | ----------- |
| 62 | |
| 63 | perf script has an option (-D) to "dump" the events i.e. display the binary |
| 64 | data. |
| 65 | |
| 66 | When -D is used, Intel BTS packets are displayed. |
| 67 | |
| 68 | To disable the display of Intel BTS packets, combine the -D option with |
| 69 | --no-itrace. |
| 70 | |
| 71 | |
| 72 | perf report |
| 73 | =========== |
| 74 | |
| 75 | By default, perf report will decode trace data found in the perf.data file. |
| 76 | This can be further controlled by new option --itrace exactly the same as |
| 77 | perf script. |
| 78 | |
| 79 | |
| 80 | perf inject |
| 81 | =========== |
| 82 | |
| 83 | perf inject also accepts the --itrace option in which case tracing data is |
| 84 | removed and replaced with the synthesized events. e.g. |
| 85 | |
| 86 | perf inject --itrace -i perf.data -o perf.data.new |