Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'perf-core-for-mingo-5.4-20190816' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core improvements and fixes from Arnaldo:

report/script/trace/top:

Arnaldo Carvalho de Melo:

- Allow specifying marker events demarcating when to consider the other events,
i.e. one now can state something like:

# perf probe kernel_function
# perf record -e cycles,probe:kernel_function

And then, in 'perf script' or 'perf report' say:

# perf report --switch-on=probe:kernel_function

And then the cycles event samples will be considered only after we
find the first probe:kernel_function event.

There is also --switch-off=event, to make it stop considering events
out of some window, say to avoid some winding down of a workload.

The same can be done with the "live mode" tools: 'perf top' and 'perf trace'.

There are examples in the cset comments showing how to use it with
SDT events in things like 'systemtap', that have those tracepoint-like
events for the start/end of passes, etc.

Another example involves selecting scheduler events + entry/exit of
a syscall, using the syscalls tracepoints, one can then see the
scheduler events that take place while that syscall is being processed.

In the future this should be possible in record/top/trace via eBPF
where the perf tools would hook into the marker events and enable events
put in place but not enabled when the on/off conditions are the desired
ones, reducing the amount of events sampled, but this userspace only
solution should be good enough for many scenarios.

perf vendor events intel:

Haiyan Song:

- Add Tremontx event file v1.02.

unwind:

John Keeping:

- Fix callchain unwinding when tid != pid, that was working only for the
thread group leader.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQR2GiIUctdOfX2qHhGyPKLppCJ+JwUCXVcMPgAKCRCyPKLppCJ+
J6ipAP9F5+TitM1zln/wUUP7/Ug4ZPDsdvA+Ggc8x0Ns7URJQwD/RHk43MgDC1fG
VXbpQ7byj339Wo7SpjadzLl9xPlh/Qw=
=IaYE
-----END PGP SIGNATURE-----

commit e2736219e6ca3117e10651e215b96d66775220da
Author: John Keeping <john@metanate.com>
Date: Thu Aug 15 11:01:46 2019 +0100

perf unwind: Remove unnecessary test

If dwarf_callchain_users is false, then unwind__prepare_access() will
not set unwind_libunwind_ops so the remaining test here is sufficient.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: john keeping <john@metanate.com>
Link: http://lkml.kernel.org/r/20190815100146.28842-3-john@metanate.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index b843f9d0a9ea..6499b22b158b 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -69,18 +69,12 @@ int unwind__prepare_access(struct map_groups *mg, struct map *map,

void unwind__flush_access(struct map_groups *mg)
{
- if (!dwarf_callchain_users)
- return;
-
if (mg->unwind_libunwind_ops)
mg->unwind_libunwind_ops->flush_access(mg);
}

void unwind__finish_access(struct map_groups *mg)
{
- if (!dwarf_callchain_users)
- return;
-
if (mg->unwind_libunwind_ops)
mg->unwind_libunwind_ops->finish_access(mg);
}

+1158 -55
+17
tools/perf/Documentation/perf-report.txt
··· 438 438 439 439 perf report --time 0%-10%,30%-40% 440 440 441 + --switch-on EVENT_NAME:: 442 + Only consider events after this event is found. 443 + 444 + This may be interesting to measure a workload only after some initialization 445 + phase is over, i.e. insert a perf probe at that point and then using this 446 + option with that probe. 447 + 448 + --switch-off EVENT_NAME:: 449 + Stop considering events after this event is found. 450 + 451 + --show-on-off-events:: 452 + Show the --switch-on/off events too. This has no effect in 'perf report' now 453 + but probably we'll make the default not to show the switch-on/off events 454 + on the --group mode and if there is only one event besides the off/on ones, 455 + go straight to the histogram browser, just like 'perf report' with no events 456 + explicitely specified does. 457 + 441 458 --itrace:: 442 459 Options for decoding instruction tracing data. The options are: 443 460
+9
tools/perf/Documentation/perf-script.txt
··· 417 417 For itrace only show specified functions and their callees for 418 418 itrace. Multiple functions can be separated by comma. 419 419 420 + --switch-on EVENT_NAME:: 421 + Only consider events after this event is found. 422 + 423 + --switch-off EVENT_NAME:: 424 + Stop considering events after this event is found. 425 + 426 + --show-on-off-events:: 427 + Show the --switch-on/off events too. 428 + 420 429 SEE ALSO 421 430 -------- 422 431 linkperf:perf-record[1], linkperf:perf-script-perl[1],
+38
tools/perf/Documentation/perf-top.txt
··· 266 266 Record events of type PERF_RECORD_NAMESPACES and display it with the 267 267 'cgroup_id' sort key. 268 268 269 + --switch-on EVENT_NAME:: 270 + Only consider events after this event is found. 271 + 272 + E.g.: 273 + 274 + Find out where broadcast packets are handled 275 + 276 + perf probe -L icmp_rcv 277 + 278 + Insert a probe there: 279 + 280 + perf probe icmp_rcv:59 281 + 282 + Start perf top and ask it to only consider the cycles events when a 283 + broadcast packet arrives This will show a menu with two entries and 284 + will start counting when a broadcast packet arrives: 285 + 286 + perf top -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv 287 + 288 + Alternatively one can ask for --group and then two overhead columns 289 + will appear, the first for cycles and the second for the switch-on event. 290 + 291 + perf top --group -e cycles,probe:icmp_rcv --switch-on=probe:icmp_rcv 292 + 293 + This may be interesting to measure a workload only after some initialization 294 + phase is over, i.e. insert a perf probe at that point and use the above 295 + examples replacing probe:icmp_rcv with the just-after-init probe. 296 + 297 + --switch-off EVENT_NAME:: 298 + Stop considering events after this event is found. 299 + 300 + --show-on-off-events:: 301 + Show the --switch-on/off events too. This has no effect in 'perf top' now 302 + but probably we'll make the default not to show the switch-on/off events 303 + on the --group mode and if there is only one event besides the off/on ones, 304 + go straight to the histogram browser, just like 'perf top' with no events 305 + explicitely specified does. 306 + 269 307 270 308 INTERACTIVE PROMPTING KEYS 271 309 --------------------------
+9
tools/perf/Documentation/perf-trace.txt
··· 176 176 only at exit time or when a syscall is interrupted, i.e. in those cases this 177 177 option is equivalent to the number of lines printed. 178 178 179 + --switch-on EVENT_NAME:: 180 + Only consider events after this event is found. 181 + 182 + --switch-off EVENT_NAME:: 183 + Stop considering events after this event is found. 184 + 185 + --show-on-off-events:: 186 + Show the --switch-on/off events too. 187 + 179 188 --max-stack:: 180 189 Set the stack depth limit when parsing the callchain, anything 181 190 beyond the specified depth will be ignored. Note that at this point
+10
tools/perf/builtin-report.c
··· 25 25 #include "util/debug.h" 26 26 #include "util/evlist.h" 27 27 #include "util/evsel.h" 28 + #include "util/evswitch.h" 28 29 #include "util/header.h" 29 30 #include "util/session.h" 30 31 #include "util/tool.h" ··· 61 60 struct report { 62 61 struct perf_tool tool; 63 62 struct perf_session *session; 63 + struct evswitch evswitch; 64 64 bool use_tui, use_gtk, use_stdio; 65 65 bool show_full_info; 66 66 bool show_threads; ··· 244 242 sample->time)) { 245 243 return 0; 246 244 } 245 + 246 + if (evswitch__discard(&rep->evswitch, evsel)) 247 + return 0; 247 248 248 249 if (machine__resolve(machine, &al, sample) < 0) { 249 250 pr_debug("problem processing %d event, skipping it.\n", ··· 1194 1189 OPT_CALLBACK(0, "time-quantum", &symbol_conf.time_quantum, "time (ms|us|ns|s)", 1195 1190 "Set time quantum for time sort key (default 100ms)", 1196 1191 parse_time_quantum), 1192 + OPTS_EVSWITCH(&report.evswitch), 1197 1193 OPT_END() 1198 1194 }; 1199 1195 struct perf_data data = { ··· 1262 1256 session = perf_session__new(&data, false, &report.tool); 1263 1257 if (session == NULL) 1264 1258 return -1; 1259 + 1260 + ret = evswitch__init(&report.evswitch, session->evlist, stderr); 1261 + if (ret) 1262 + return ret; 1265 1263 1266 1264 if (zstd_init(&(session->zstd_data), 0) < 0) 1267 1265 pr_warning("Decompression initialization failed. Reported data may be incomplete.\n");
+10
tools/perf/builtin-script.c
··· 16 16 #include "util/trace-event.h" 17 17 #include "util/evlist.h" 18 18 #include "util/evsel.h" 19 + #include "util/evswitch.h" 19 20 #include "util/sort.h" 20 21 #include "util/data.h" 21 22 #include "util/auxtrace.h" ··· 1629 1628 bool show_bpf_events; 1630 1629 bool allocated; 1631 1630 bool per_event_dump; 1631 + struct evswitch evswitch; 1632 1632 struct perf_cpu_map *cpus; 1633 1633 struct perf_thread_map *threads; 1634 1634 int name_width; ··· 1805 1803 return; 1806 1804 1807 1805 if (!show_event(sample, evsel, thread, al)) 1806 + return; 1807 + 1808 + if (evswitch__discard(&script->evswitch, evsel)) 1808 1809 return; 1809 1810 1810 1811 ++es->samples; ··· 3543 3538 "file", "file saving guest os /proc/kallsyms"), 3544 3539 OPT_STRING(0, "guestmodules", &symbol_conf.default_guest_modules, 3545 3540 "file", "file saving guest os /proc/modules"), 3541 + OPTS_EVSWITCH(&script.evswitch), 3546 3542 OPT_END() 3547 3543 }; 3548 3544 const char * const script_subcommands[] = { "record", "report", NULL }; ··· 3867 3861 script.ptime_range, 3868 3862 script.range_num); 3869 3863 } 3864 + 3865 + err = evswitch__init(&script.evswitch, session->evlist, stderr); 3866 + if (err) 3867 + goto out_delete; 3870 3868 3871 3869 err = __cmd_script(&script); 3872 3870
+9 -1
tools/perf/builtin-top.c
··· 1148 1148 evsel = perf_evlist__id2evsel(session->evlist, sample.id); 1149 1149 assert(evsel != NULL); 1150 1150 1151 - if (event->header.type == PERF_RECORD_SAMPLE) 1151 + if (event->header.type == PERF_RECORD_SAMPLE) { 1152 + if (evswitch__discard(&top->evswitch, evsel)) 1153 + return 0; 1152 1154 ++top->samples; 1155 + } 1153 1156 1154 1157 switch (sample.cpumode) { 1155 1158 case PERF_RECORD_MISC_USER: ··· 1537 1534 "number of thread to run event synthesize"), 1538 1535 OPT_BOOLEAN(0, "namespaces", &opts->record_namespaces, 1539 1536 "Record namespaces events"), 1537 + OPTS_EVSWITCH(&top.evswitch), 1540 1538 OPT_END() 1541 1539 }; 1542 1540 struct evlist *sb_evlist = NULL; ··· 1570 1566 pr_err("Not enough memory for event selector list\n"); 1571 1567 goto out_delete_evlist; 1572 1568 } 1569 + 1570 + status = evswitch__init(&top.evswitch, top.evlist, stderr); 1571 + if (status) 1572 + goto out_delete_evlist; 1573 1573 1574 1574 if (symbol_conf.report_hierarchy) { 1575 1575 /* disable incompatible options */
+10
tools/perf/builtin-trace.c
··· 27 27 #include "util/env.h" 28 28 #include "util/event.h" 29 29 #include "util/evlist.h" 30 + #include "util/evswitch.h" 30 31 #include <subcmd/exec-cmd.h> 31 32 #include "util/machine.h" 32 33 #include "util/map.h" ··· 107 106 unsigned long nr_events; 108 107 unsigned long nr_events_printed; 109 108 unsigned long max_events; 109 + struct evswitch evswitch; 110 110 struct strlist *ev_qualifier; 111 111 struct { 112 112 size_t nr; ··· 2682 2680 return; 2683 2681 } 2684 2682 2683 + if (evswitch__discard(&trace->evswitch, evsel)) 2684 + return; 2685 + 2685 2686 trace__set_base_time(trace, evsel, sample); 2686 2687 2687 2688 if (evsel->core.attr.type == PERF_TYPE_TRACEPOINT && ··· 4162 4157 OPT_UINTEGER('D', "delay", &trace.opts.initial_delay, 4163 4158 "ms to wait before starting measurement after program " 4164 4159 "start"), 4160 + OPTS_EVSWITCH(&trace.evswitch), 4165 4161 OPT_END() 4166 4162 }; 4167 4163 bool __maybe_unused max_stack_user_set = true; ··· 4385 4379 goto out; 4386 4380 } 4387 4381 } 4382 + 4383 + err = evswitch__init(&trace.evswitch, trace.evlist, stderr); 4384 + if (err) 4385 + goto out_close; 4388 4386 4389 4387 err = target__validate(&trace.opts.target); 4390 4388 if (err) {
+1
tools/perf/pmu-events/arch/x86/mapfile.csv
··· 35 35 GenuineIntel-6-55-[56789ABCDEF],v1,cascadelakex,core 36 36 GenuineIntel-6-7D,v1,icelake,core 37 37 GenuineIntel-6-7E,v1,icelake,core 38 + GenuineIntel-6-86,v1,tremontx,core 38 39 AuthenticAMD-23-[[:xdigit:]]+,v1,amdfam17h,core
+111
tools/perf/pmu-events/arch/x86/tremontx/cache.json
··· 1 + [ 2 + { 3 + "CollectPEBSRecord": "2", 4 + "PublicDescription": "Counts cacheable memory requests that miss in the the Last Level Cache. Requests include Demand Loads, Reads for Ownership(RFO), Instruction fetches and L1 HW prefetches. If the platform has an L3 cache, last level cache is the L3, otherwise it is the L2.", 5 + "EventCode": "0x2e", 6 + "Counter": "0,1,2,3", 7 + "UMask": "0x41", 8 + "PEBScounters": "0,1,2,3", 9 + "EventName": "LONGEST_LAT_CACHE.MISS", 10 + "PDIR_COUNTER": "na", 11 + "SampleAfterValue": "200003", 12 + "BriefDescription": "Counts memory requests originating from the core that miss in the last level cache. If the platform has an L3 cache, last level cache is the L3, otherwise it is the L2." 13 + }, 14 + { 15 + "CollectPEBSRecord": "2", 16 + "PublicDescription": "Counts cacheable memory requests that access the Last Level Cache. Requests include Demand Loads, Reads for Ownership(RFO), Instruction fetches and L1 HW prefetches. If the platform has an L3 cache, last level cache is the L3, otherwise it is the L2.", 17 + "EventCode": "0x2e", 18 + "Counter": "0,1,2,3", 19 + "UMask": "0x4f", 20 + "PEBScounters": "0,1,2,3", 21 + "EventName": "LONGEST_LAT_CACHE.REFERENCE", 22 + "PDIR_COUNTER": "na", 23 + "SampleAfterValue": "200003", 24 + "BriefDescription": "Counts memory requests originating from the core that reference a cache line in the last level cache. If the platform has an L3 cache, last level cache is the L3, otherwise it is the L2." 25 + }, 26 + { 27 + "PEBS": "1", 28 + "CollectPEBSRecord": "2", 29 + "PublicDescription": "Counts the number of load uops retired. This event is Precise Event capable", 30 + "EventCode": "0xd0", 31 + "Counter": "0,1,2,3", 32 + "UMask": "0x81", 33 + "PEBScounters": "0,1,2,3", 34 + "EventName": "MEM_UOPS_RETIRED.ALL_LOADS", 35 + "SampleAfterValue": "200003", 36 + "BriefDescription": "Counts the number of load uops retired.", 37 + "Data_LA": "1" 38 + }, 39 + { 40 + "PEBS": "1", 41 + "CollectPEBSRecord": "2", 42 + "PublicDescription": "Counts the number of store uops retired. This event is Precise Event capable", 43 + "EventCode": "0xd0", 44 + "Counter": "0,1,2,3", 45 + "UMask": "0x82", 46 + "PEBScounters": "0,1,2,3", 47 + "EventName": "MEM_UOPS_RETIRED.ALL_STORES", 48 + "SampleAfterValue": "200003", 49 + "BriefDescription": "Counts the number of store uops retired.", 50 + "Data_LA": "1" 51 + }, 52 + { 53 + "PEBS": "1", 54 + "CollectPEBSRecord": "2", 55 + "EventCode": "0xd1", 56 + "Counter": "0,1,2,3", 57 + "UMask": "0x1", 58 + "PEBScounters": "0,1,2,3", 59 + "EventName": "MEM_LOAD_UOPS_RETIRED.L1_HIT", 60 + "SampleAfterValue": "200003", 61 + "BriefDescription": "Counts the number of load uops retired that hit the level 1 data cache", 62 + "Data_LA": "1" 63 + }, 64 + { 65 + "PEBS": "1", 66 + "CollectPEBSRecord": "2", 67 + "EventCode": "0xd1", 68 + "Counter": "0,1,2,3", 69 + "UMask": "0x2", 70 + "PEBScounters": "0,1,2,3", 71 + "EventName": "MEM_LOAD_UOPS_RETIRED.L2_HIT", 72 + "SampleAfterValue": "200003", 73 + "BriefDescription": "Counts the number of load uops retired that hit in the level 2 cache", 74 + "Data_LA": "1" 75 + }, 76 + { 77 + "PEBS": "1", 78 + "CollectPEBSRecord": "2", 79 + "EventCode": "0xd1", 80 + "Counter": "0,1,2,3", 81 + "UMask": "0x4", 82 + "PEBScounters": "0,1,2,3", 83 + "EventName": "MEM_LOAD_UOPS_RETIRED.L3_HIT", 84 + "SampleAfterValue": "200003", 85 + "BriefDescription": "Counts the number of load uops retired that miss in the level 3 cache" 86 + }, 87 + { 88 + "PEBS": "1", 89 + "CollectPEBSRecord": "2", 90 + "EventCode": "0xd1", 91 + "Counter": "0,1,2,3", 92 + "UMask": "0x8", 93 + "PEBScounters": "0,1,2,3", 94 + "EventName": "MEM_LOAD_UOPS_RETIRED.L1_MISS", 95 + "SampleAfterValue": "200003", 96 + "BriefDescription": "Counts the number of load uops retired that miss in the level 1 data cache", 97 + "Data_LA": "1" 98 + }, 99 + { 100 + "PEBS": "1", 101 + "CollectPEBSRecord": "2", 102 + "EventCode": "0xd1", 103 + "Counter": "0,1,2,3", 104 + "UMask": "0x10", 105 + "PEBScounters": "0,1,2,3", 106 + "EventName": "MEM_LOAD_UOPS_RETIRED.L2_MISS", 107 + "SampleAfterValue": "200003", 108 + "BriefDescription": "Counts the number of load uops retired that miss in the level 2 cache", 109 + "Data_LA": "1" 110 + } 111 + ]
+26
tools/perf/pmu-events/arch/x86/tremontx/frontend.json
··· 1 + [ 2 + { 3 + "CollectPEBSRecord": "2", 4 + "PublicDescription": "Counts requests to the Instruction Cache (ICache) for one or more bytes in an ICache Line and that cache line is not in the ICache (miss). The event strives to count on a cache line basis, so that multiple accesses which miss in a single cache line count as one ICACHE.MISS. Specifically, the event counts when straight line code crosses the cache line boundary, or when a branch target is to a new line, and that cache line is not in the ICache.", 5 + "EventCode": "0x80", 6 + "Counter": "0,1,2,3", 7 + "UMask": "0x2", 8 + "PEBScounters": "0,1,2,3", 9 + "EventName": "ICACHE.MISSES", 10 + "PDIR_COUNTER": "na", 11 + "SampleAfterValue": "200003", 12 + "BriefDescription": "Counts requests to the Instruction Cache (ICache) for one or more bytes in a cache line and they do not hit in the ICache (miss)." 13 + }, 14 + { 15 + "CollectPEBSRecord": "2", 16 + "PublicDescription": "Counts requests to the Instruction Cache (ICache) for one or more bytes in an ICache Line. The event strives to count on a cache line basis, so that multiple fetches to a single cache line count as one ICACHE.ACCESS. Specifically, the event counts when accesses from straight line code crosses the cache line boundary, or when a branch target is to a new line.", 17 + "EventCode": "0x80", 18 + "Counter": "0,1,2,3", 19 + "UMask": "0x3", 20 + "PEBScounters": "0,1,2,3", 21 + "EventName": "ICACHE.ACCESSES", 22 + "PDIR_COUNTER": "na", 23 + "SampleAfterValue": "200003", 24 + "BriefDescription": "Counts requests to the Instruction Cache (ICache) for one or more bytes cache Line." 25 + } 26 + ]
+26
tools/perf/pmu-events/arch/x86/tremontx/memory.json
··· 1 + [ 2 + { 3 + "PublicDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 4 + "EventCode": "0XB7", 5 + "MSRValue": "0x000000003F04000001", 6 + "Counter": "0,1,2,3", 7 + "UMask": "0x1", 8 + "EventName": "OCR.DEMAND_DATA_RD.L3_MISS", 9 + "MSRIndex": "0x1a6,0x1a7", 10 + "SampleAfterValue": "100003", 11 + "BriefDescription": "Counts demand data reads that was not supplied by the L3 cache.", 12 + "Offcore": "1" 13 + }, 14 + { 15 + "PublicDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 16 + "EventCode": "0XB7", 17 + "MSRValue": "0x000000003F04000002", 18 + "Counter": "0,1,2,3", 19 + "UMask": "0x1", 20 + "EventName": "OCR.DEMAND_RFO.L3_MISS", 21 + "MSRIndex": "0x1a6,0x1a7", 22 + "SampleAfterValue": "100003", 23 + "BriefDescription": "Counts all demand reads for ownership (RFO) requests and software based prefetches for exclusive ownership (PREFETCHW) that was not supplied by the L3 cache.", 24 + "Offcore": "1" 25 + } 26 + ]
+26
tools/perf/pmu-events/arch/x86/tremontx/other.json
··· 1 + [ 2 + { 3 + "PublicDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 4 + "EventCode": "0XB7", 5 + "MSRValue": "0x000000000000010001", 6 + "Counter": "0,1,2,3", 7 + "UMask": "0x1", 8 + "EventName": "OCR.DEMAND_DATA_RD.ANY_RESPONSE", 9 + "MSRIndex": "0x1a6,0x1a7", 10 + "SampleAfterValue": "100003", 11 + "BriefDescription": "Counts demand data reads that have any response type.", 12 + "Offcore": "1" 13 + }, 14 + { 15 + "PublicDescription": "Offcore response can be programmed only with a specific pair of event select and counter MSR, and with specific event codes and predefine mask bit value in a dedicated MSR to specify attributes of the offcore transaction.", 16 + "EventCode": "0XB7", 17 + "MSRValue": "0x000000000000010002", 18 + "Counter": "0,1,2,3", 19 + "UMask": "0x1", 20 + "EventName": "OCR.DEMAND_RFO.ANY_RESPONSE", 21 + "MSRIndex": "0x1a6,0x1a7", 22 + "SampleAfterValue": "100003", 23 + "BriefDescription": "Counts all demand reads for ownership (RFO) requests and software based prefetches for exclusive ownership (PREFETCHW) that have any response type.", 24 + "Offcore": "1" 25 + } 26 + ]
+111
tools/perf/pmu-events/arch/x86/tremontx/pipeline.json
··· 1 + [ 2 + { 3 + "PEBS": "1", 4 + "CollectPEBSRecord": "2", 5 + "PublicDescription": "Counts the number of instructions that retire. For instructions that consist of multiple uops, this event counts the retirement of the last uop of the instruction. The counter continues counting during hardware interrupts, traps, and inside interrupt handlers. This event uses fixed counter 0.", 6 + "Counter": "32", 7 + "UMask": "0x1", 8 + "PEBScounters": "32", 9 + "EventName": "INST_RETIRED.ANY", 10 + "SampleAfterValue": "2000003", 11 + "BriefDescription": "Counts the number of instructions retired. (Fixed event)" 12 + }, 13 + { 14 + "CollectPEBSRecord": "2", 15 + "PublicDescription": "Counts the number of core cycles while the core is not in a halt state. The core enters the halt state when it is running the HLT instruction. The core frequency may change from time to time. For this reason this event may have a changing ratio with regards to time. This event uses fixed counter 1.", 16 + "Counter": "33", 17 + "UMask": "0x2", 18 + "PEBScounters": "33", 19 + "EventName": "CPU_CLK_UNHALTED.CORE", 20 + "PDIR_COUNTER": "na", 21 + "SampleAfterValue": "2000003", 22 + "BriefDescription": "Counts the number of unhalted core clock cycles. (Fixed event)" 23 + }, 24 + { 25 + "CollectPEBSRecord": "2", 26 + "PublicDescription": "Counts the number of reference cycles that the core is not in a halt state. The core enters the halt state when it is running the HLT instruction. The core frequency may change from time. This event is not affected by core frequency changes and at a fixed frequency. This event uses fixed counter 2.", 27 + "Counter": "34", 28 + "UMask": "0x3", 29 + "PEBScounters": "34", 30 + "EventName": "CPU_CLK_UNHALTED.REF_TSC", 31 + "PDIR_COUNTER": "na", 32 + "SampleAfterValue": "2000003", 33 + "BriefDescription": "Counts the number of unhalted reference clock cycles at TSC frequency. (Fixed event)" 34 + }, 35 + { 36 + "CollectPEBSRecord": "2", 37 + "PublicDescription": "Counts the number of core cycles while the core is not in a halt state. The core enters the halt state when it is running the HLT instruction. The core frequency may change from time to time. For this reason this event may have a changing ratio with regards to time. This event uses a programmable general purpose performance counter.", 38 + "EventCode": "0x3c", 39 + "Counter": "0,1,2,3", 40 + "PEBScounters": "0,1,2,3", 41 + "EventName": "CPU_CLK_UNHALTED.CORE_P", 42 + "PDIR_COUNTER": "na", 43 + "SampleAfterValue": "2000003", 44 + "BriefDescription": "Counts the number of unhalted core clock cycles." 45 + }, 46 + { 47 + "CollectPEBSRecord": "2", 48 + "PublicDescription": "Counts reference cycles (at TSC frequency) when core is not halted. This event uses a programmable general purpose perfmon counter.", 49 + "EventCode": "0x3c", 50 + "Counter": "0,1,2,3", 51 + "UMask": "0x1", 52 + "PEBScounters": "0,1,2,3", 53 + "EventName": "CPU_CLK_UNHALTED.REF", 54 + "PDIR_COUNTER": "na", 55 + "SampleAfterValue": "2000003", 56 + "BriefDescription": "Counts the number of unhalted reference clock cycles at TSC frequency." 57 + }, 58 + { 59 + "PEBS": "1", 60 + "CollectPEBSRecord": "2", 61 + "PublicDescription": "Counts the number of instructions that retire execution. For instructions that consist of multiple uops, this event counts the retirement of the last uop of the instruction. The event continues counting during hardware interrupts, traps, and inside interrupt handlers. This is an architectural performance event. This event uses a Programmable general purpose perfmon counter. *This event is Precise Event capable: The EventingRIP field in the PEBS record is precise to the address of the instruction which caused the event.", 62 + "EventCode": "0xc0", 63 + "Counter": "0,1,2,3", 64 + "PEBScounters": "0,1,2,3", 65 + "EventName": "INST_RETIRED.ANY_P", 66 + "SampleAfterValue": "2000003", 67 + "BriefDescription": "Counts the number of instructions retired." 68 + }, 69 + { 70 + "CollectPEBSRecord": "2", 71 + "EventCode": "0xc3", 72 + "Counter": "0,1,2,3", 73 + "PEBScounters": "0,1,2,3", 74 + "EventName": "MACHINE_CLEARS.ANY", 75 + "PDIR_COUNTER": "na", 76 + "SampleAfterValue": "20003", 77 + "BriefDescription": "Counts all machine clears due to, but not limited to memory ordering, memory disambiguation, SMC, page faults and FP assist." 78 + }, 79 + { 80 + "PEBS": "1", 81 + "CollectPEBSRecord": "2", 82 + "PublicDescription": "Counts branch instructions retired for all branch types. This event is Precise Event capable. This is an architectural event.", 83 + "EventCode": "0xc4", 84 + "Counter": "0,1,2,3", 85 + "PEBScounters": "0,1,2,3", 86 + "EventName": "BR_INST_RETIRED.ALL_BRANCHES", 87 + "SampleAfterValue": "200003", 88 + "BriefDescription": "Counts the number of branch instructions retired for all branch types." 89 + }, 90 + { 91 + "PEBS": "1", 92 + "CollectPEBSRecord": "2", 93 + "PublicDescription": "Counts mispredicted branch instructions retired for all branch types. This event is Precise Event capable. This is an architectural event.", 94 + "EventCode": "0xc5", 95 + "Counter": "0,1,2,3", 96 + "PEBScounters": "0,1,2,3", 97 + "EventName": "BR_MISP_RETIRED.ALL_BRANCHES", 98 + "SampleAfterValue": "200003", 99 + "BriefDescription": "Counts the number of mispredicted branch instructions retired." 100 + }, 101 + { 102 + "CollectPEBSRecord": "2", 103 + "EventCode": "0xcd", 104 + "Counter": "0,1,2,3", 105 + "PEBScounters": "0,1,2,3", 106 + "EventName": "CYCLES_DIV_BUSY.ANY", 107 + "PDIR_COUNTER": "na", 108 + "SampleAfterValue": "2000003", 109 + "BriefDescription": "Counts cycles the floating point divider or integer divider or both are busy. Does not imply a stall waiting for either divider." 110 + } 111 + ]
+73
tools/perf/pmu-events/arch/x86/tremontx/uncore-memory.json
··· 1 + [ 2 + { 3 + "BriefDescription": "read requests to memory controller. Derived from unc_m_cas_count.rd", 4 + "Counter": "0,1,2,3", 5 + "CounterType": "PGMABLE", 6 + "EventCode": "0x04", 7 + "EventName": "LLC_MISSES.MEM_READ", 8 + "PerPkg": "1", 9 + "ScaleUnit": "64Bytes", 10 + "UMask": "0x0f", 11 + "Unit": "iMC" 12 + }, 13 + { 14 + "BriefDescription": "write requests to memory controller. Derived from unc_m_cas_count.wr", 15 + "Counter": "0,1,2,3", 16 + "CounterType": "PGMABLE", 17 + "EventCode": "0x04", 18 + "EventName": "LLC_MISSES.MEM_WRITE", 19 + "PerPkg": "1", 20 + "ScaleUnit": "64Bytes", 21 + "UMask": "0x30", 22 + "Unit": "iMC" 23 + }, 24 + { 25 + "BriefDescription": "Memory controller clock ticks", 26 + "Counter": "0,1,2,3", 27 + "CounterType": "PGMABLE", 28 + "EventName": "UNC_M_CLOCKTICKS", 29 + "PerPkg": "1", 30 + "Unit": "iMC" 31 + }, 32 + { 33 + "BriefDescription": "Pre-charge for reads", 34 + "Counter": "0,1,2,3", 35 + "CounterType": "PGMABLE", 36 + "EventCode": "0x02", 37 + "EventName": "UNC_M_PRE_COUNT.RD", 38 + "PerPkg": "1", 39 + "UMask": "0x04", 40 + "Unit": "iMC" 41 + }, 42 + { 43 + "BriefDescription": "Pre-charge for writes", 44 + "Counter": "0,1,2,3", 45 + "CounterType": "PGMABLE", 46 + "EventCode": "0x02", 47 + "EventName": "UNC_M_PRE_COUNT.WR", 48 + "PerPkg": "1", 49 + "UMask": "0x08", 50 + "Unit": "iMC" 51 + }, 52 + { 53 + "BriefDescription": "Precharge due to read on page miss, write on page miss or PGT", 54 + "Counter": "0,1,2,3", 55 + "CounterType": "PGMABLE", 56 + "EventCode": "0x02", 57 + "EventName": "UNC_M_PRE_COUNT.ALL", 58 + "PerPkg": "1", 59 + "UMask": "0x1c", 60 + "Unit": "iMC" 61 + }, 62 + { 63 + "BriefDescription": "DRAM Precharge commands. : Precharge due to page table", 64 + "Counter": "0,1,2,3", 65 + "CounterType": "PGMABLE", 66 + "EventCode": "0x02", 67 + "EventName": "UNC_M_PRE_COUNT.PGT", 68 + "PerPkg": "1", 69 + "PublicDescription": "DRAM Precharge commands. : Precharge due to page table : Counts the number of DRAM Precharge commands sent on this channel.", 70 + "UMask": "0x10", 71 + "Unit": "iMC" 72 + } 73 + ]
+431
tools/perf/pmu-events/arch/x86/tremontx/uncore-other.json
··· 1 + [ 2 + { 3 + "BriefDescription": "Uncore cache clock ticks", 4 + "Counter": "0,1,2,3", 5 + "CounterType": "PGMABLE", 6 + "EventName": "UNC_CHA_CLOCKTICKS", 7 + "PerPkg": "1", 8 + "Unit": "CHA" 9 + }, 10 + { 11 + "BriefDescription": "LLC misses - Uncacheable reads (from cpu) . Derived from unc_cha_tor_inserts.ia_miss", 12 + "Counter": "0,1,2,3", 13 + "CounterType": "PGMABLE", 14 + "EventCode": "0x35", 15 + "EventName": "LLC_MISSES.UNCACHEABLE", 16 + "Filter": "config1=0x40e33", 17 + "PerPkg": "1", 18 + "UMask": "0xC001FE01", 19 + "UMaskExt": "0xC001FE", 20 + "Unit": "CHA" 21 + }, 22 + { 23 + "BriefDescription": "MMIO reads. Derived from unc_cha_tor_inserts.ia_miss", 24 + "Counter": "0,1,2,3", 25 + "CounterType": "PGMABLE", 26 + "EventCode": "0x35", 27 + "EventName": "LLC_MISSES.MMIO_READ", 28 + "Filter": "config1=0x40040e33", 29 + "PerPkg": "1", 30 + "UMask": "0xC001FE01", 31 + "UMaskExt": "0xC001FE", 32 + "Unit": "CHA" 33 + }, 34 + { 35 + "BriefDescription": "MMIO writes. Derived from unc_cha_tor_inserts.ia_miss", 36 + "Counter": "0,1,2,3", 37 + "CounterType": "PGMABLE", 38 + "EventCode": "0x35", 39 + "EventName": "LLC_MISSES.MMIO_WRITE", 40 + "Filter": "config1=0x40041e33", 41 + "PerPkg": "1", 42 + "UMask": "0xC001FE01", 43 + "UMaskExt": "0xC001FE", 44 + "Unit": "CHA" 45 + }, 46 + { 47 + "BriefDescription": "Streaming stores (full cache line). Derived from unc_cha_tor_inserts.ia_miss", 48 + "Counter": "0,1,2,3", 49 + "CounterType": "PGMABLE", 50 + "EventCode": "0x35", 51 + "EventName": "LLC_REFERENCES.STREAMING_FULL", 52 + "Filter": "config1=0x41833", 53 + "PerPkg": "1", 54 + "ScaleUnit": "64Bytes", 55 + "UMask": "0xC001FE01", 56 + "UMaskExt": "0xC001FE", 57 + "Unit": "CHA" 58 + }, 59 + { 60 + "BriefDescription": "Streaming stores (partial cache line). Derived from unc_cha_tor_inserts.ia_miss", 61 + "Counter": "0,1,2,3", 62 + "CounterType": "PGMABLE", 63 + "EventCode": "0x35", 64 + "EventName": "LLC_REFERENCES.STREAMING_PARTIAL", 65 + "Filter": "config1=0x41a33", 66 + "PerPkg": "1", 67 + "ScaleUnit": "64Bytes", 68 + "UMask": "0xC001FE01", 69 + "UMaskExt": "0xC001FE", 70 + "Unit": "CHA" 71 + }, 72 + { 73 + "BriefDescription": "PCI Express bandwidth reading at IIO. Derived from unc_iio_data_req_of_cpu.mem_read.part0", 74 + "Counter": "0,1", 75 + "CounterType": "PGMABLE", 76 + "EventCode": "0x83", 77 + "EventName": "LLC_MISSES.PCIE_READ", 78 + "FCMask": "0x07", 79 + "Filter": "ch_mask=0x1f", 80 + "MetricExpr": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART0 +UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART1 +UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART2 +UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART3", 81 + "MetricName": "LLC_MISSES.PCIE_READ", 82 + "PerPkg": "1", 83 + "PortMask": "0x01", 84 + "ScaleUnit": "4Bytes", 85 + "UMask": "0x04", 86 + "Unit": "IIO" 87 + }, 88 + { 89 + "BriefDescription": "PCI Express bandwidth writing at IIO. Derived from unc_iio_data_req_of_cpu.mem_write.part0", 90 + "Counter": "0,1", 91 + "CounterType": "PGMABLE", 92 + "EventCode": "0x83", 93 + "EventName": "LLC_MISSES.PCIE_WRITE", 94 + "FCMask": "0x07", 95 + "Filter": "ch_mask=0x1f", 96 + "MetricExpr": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART0 +UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART1 +UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART2 +UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART3", 97 + "MetricName": "LLC_MISSES.PCIE_WRITE", 98 + "PerPkg": "1", 99 + "PortMask": "0x01", 100 + "ScaleUnit": "4Bytes", 101 + "UMask": "0x01", 102 + "Unit": "IIO" 103 + }, 104 + { 105 + "BriefDescription": "PCI Express bandwidth writing at IIO, part 1", 106 + "Counter": "0,1", 107 + "CounterType": "PGMABLE", 108 + "EventCode": "0x83", 109 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART1", 110 + "FCMask": "0x07", 111 + "PerPkg": "1", 112 + "PortMask": "0x02", 113 + "ScaleUnit": "4Bytes", 114 + "UMask": "0x01", 115 + "Unit": "IIO" 116 + }, 117 + { 118 + "BriefDescription": "PCI Express bandwidth writing at IIO, part 2", 119 + "Counter": "0,1", 120 + "CounterType": "PGMABLE", 121 + "EventCode": "0x83", 122 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART2", 123 + "FCMask": "0x07", 124 + "PerPkg": "1", 125 + "PortMask": "0x04", 126 + "ScaleUnit": "4Bytes", 127 + "UMask": "0x01", 128 + "Unit": "IIO" 129 + }, 130 + { 131 + "BriefDescription": "PCI Express bandwidth writing at IIO, part 3", 132 + "Counter": "0,1", 133 + "CounterType": "PGMABLE", 134 + "EventCode": "0x83", 135 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART3", 136 + "FCMask": "0x07", 137 + "PerPkg": "1", 138 + "PortMask": "0x08", 139 + "ScaleUnit": "4Bytes", 140 + "UMask": "0x01", 141 + "Unit": "IIO" 142 + }, 143 + { 144 + "BriefDescription": "PCI Express bandwidth reading at IIO, part 1", 145 + "Counter": "0,1", 146 + "CounterType": "PGMABLE", 147 + "EventCode": "0x83", 148 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART1", 149 + "FCMask": "0x07", 150 + "PerPkg": "1", 151 + "PortMask": "0x02", 152 + "ScaleUnit": "4Bytes", 153 + "UMask": "0x04", 154 + "Unit": "IIO" 155 + }, 156 + { 157 + "BriefDescription": "PCI Express bandwidth reading at IIO, part 2", 158 + "Counter": "0,1", 159 + "CounterType": "PGMABLE", 160 + "EventCode": "0x83", 161 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART2", 162 + "FCMask": "0x07", 163 + "PerPkg": "1", 164 + "PortMask": "0x04", 165 + "ScaleUnit": "4Bytes", 166 + "UMask": "0x04", 167 + "Unit": "IIO" 168 + }, 169 + { 170 + "BriefDescription": "PCI Express bandwidth reading at IIO, part 3", 171 + "Counter": "0,1", 172 + "CounterType": "PGMABLE", 173 + "EventCode": "0x83", 174 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART3", 175 + "FCMask": "0x07", 176 + "PerPkg": "1", 177 + "PortMask": "0x08", 178 + "ScaleUnit": "4Bytes", 179 + "UMask": "0x04", 180 + "Unit": "IIO" 181 + }, 182 + { 183 + "BriefDescription": "TOR Inserts; CRd misses from local IA", 184 + "Counter": "0,1,2,3", 185 + "CounterType": "PGMABLE", 186 + "EventCode": "0x35", 187 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_CRD", 188 + "PerPkg": "1", 189 + "PublicDescription": "TOR Inserts; Code read from local IA that misses in the snoop filter", 190 + "UMask": "0xC80FFE01", 191 + "UMaskExt": "0xC80FFE", 192 + "Unit": "CHA" 193 + }, 194 + { 195 + "BriefDescription": "TOR Inserts; CRd Pref misses from local IA", 196 + "Counter": "0,1,2,3", 197 + "CounterType": "PGMABLE", 198 + "EventCode": "0x35", 199 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_CRD_PREF", 200 + "PerPkg": "1", 201 + "PublicDescription": "TOR Inserts; Code read prefetch from local IA that misses in the snoop filter", 202 + "UMask": "0xC88FFE01", 203 + "UMaskExt": "0xC88FFE", 204 + "Unit": "CHA" 205 + }, 206 + { 207 + "BriefDescription": "TOR Inserts; DRd Opt misses from local IA", 208 + "Counter": "0,1,2,3", 209 + "CounterType": "PGMABLE", 210 + "EventCode": "0x35", 211 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_DRD_OPT", 212 + "PerPkg": "1", 213 + "PublicDescription": "TOR Inserts; Data read opt from local IA that misses in the snoop filter", 214 + "UMask": "0xC827FE01", 215 + "UMaskExt": "0xC827FE", 216 + "Unit": "CHA" 217 + }, 218 + { 219 + "BriefDescription": "TOR Inserts; DRd Opt Pref misses from local IA", 220 + "Counter": "0,1,2,3", 221 + "CounterType": "PGMABLE", 222 + "EventCode": "0x35", 223 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_DRD_OPT_PREF", 224 + "PerPkg": "1", 225 + "PublicDescription": "TOR Inserts; Data read opt prefetch from local IA that misses in the snoop filter", 226 + "UMask": "0xC8A7FE01", 227 + "UMaskExt": "0xC8A7FE", 228 + "Unit": "CHA" 229 + }, 230 + { 231 + "BriefDescription": "TOR Inserts; RFO misses from local IA", 232 + "Counter": "0,1,2,3", 233 + "CounterType": "PGMABLE", 234 + "EventCode": "0x35", 235 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_RFO", 236 + "PerPkg": "1", 237 + "PublicDescription": "TOR Inserts; Read for ownership from local IA that misses in the snoop filter", 238 + "UMask": "0xC807FE01", 239 + "UMaskExt": "0xC807FE", 240 + "Unit": "CHA" 241 + }, 242 + { 243 + "BriefDescription": "TOR Inserts; RFO pref misses from local IA", 244 + "Counter": "0,1,2,3", 245 + "CounterType": "PGMABLE", 246 + "EventCode": "0x35", 247 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_RFO_PREF", 248 + "PerPkg": "1", 249 + "PublicDescription": "TOR Inserts; Read for ownership prefetch from local IA that misses in the snoop filter", 250 + "UMask": "0xC887FE01", 251 + "UMaskExt": "0xC887FE", 252 + "Unit": "CHA" 253 + }, 254 + { 255 + "BriefDescription": "TOR Inserts; WCiL misses from local IA", 256 + "Counter": "0,1,2,3", 257 + "CounterType": "PGMABLE", 258 + "EventCode": "0x35", 259 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_WCIL", 260 + "PerPkg": "1", 261 + "PublicDescription": "TOR Inserts; Data read from local IA that misses in the snoop filter", 262 + "UMask": "0xC86FFE01", 263 + "UMaskExt": "0xC86FFE", 264 + "Unit": "CHA" 265 + }, 266 + { 267 + "BriefDescription": "TOR Inserts; WCiLF misses from local IA", 268 + "Counter": "0,1,2,3", 269 + "CounterType": "PGMABLE", 270 + "EventCode": "0x35", 271 + "EventName": "UNC_CHA_TOR_INSERTS.IA_MISS_WCILF", 272 + "PerPkg": "1", 273 + "PublicDescription": "TOR Inserts; Data read from local IA that misses in the snoop filter", 274 + "UMask": "0xC867FE01", 275 + "UMaskExt": "0xC867FE", 276 + "Unit": "CHA" 277 + }, 278 + { 279 + "BriefDescription": "Clockticks of the integrated IO (IIO) traffic controller", 280 + "Counter": "0,1,2,3", 281 + "CounterType": "PGMABLE", 282 + "EventCode": "0x01", 283 + "EventName": "UNC_IIO_CLOCKTICKS", 284 + "PerPkg": "1", 285 + "PublicDescription": "Clockticks of the integrated IO (IIO) traffic controller", 286 + "Unit": "IIO" 287 + }, 288 + { 289 + "BriefDescription": "Data requested of the CPU : Card reading from DRAM", 290 + "Counter": "0,1", 291 + "CounterType": "PGMABLE", 292 + "EventCode": "0x83", 293 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART4", 294 + "FCMask": "0x07", 295 + "PerPkg": "1", 296 + "PortMask": "0x10", 297 + "PublicDescription": "Data requested of the CPU : Card reading from DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x16 card plugged in to stack, Or x8 card plugged in to Lane 0/1, Or x4 card is plugged in to slot 0", 298 + "UMask": "0x04", 299 + "Unit": "IIO" 300 + }, 301 + { 302 + "BriefDescription": "Data requested of the CPU : Card reading from DRAM", 303 + "Counter": "0,1", 304 + "CounterType": "PGMABLE", 305 + "EventCode": "0x83", 306 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART5", 307 + "FCMask": "0x07", 308 + "PerPkg": "1", 309 + "PortMask": "0x20", 310 + "PublicDescription": "Data requested of the CPU : Card reading from DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x4 card is plugged in to slot 1", 311 + "UMask": "0x04", 312 + "Unit": "IIO" 313 + }, 314 + { 315 + "BriefDescription": "Data requested of the CPU : Card reading from DRAM", 316 + "Counter": "0,1", 317 + "CounterType": "PGMABLE", 318 + "EventCode": "0x83", 319 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART6", 320 + "FCMask": "0x07", 321 + "PerPkg": "1", 322 + "PortMask": "0x40", 323 + "PublicDescription": "Data requested of the CPU : Card reading from DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x8 card plugged in to Lane 2/3, Or x4 card is plugged in to slot 1", 324 + "UMask": "0x04", 325 + "Unit": "IIO" 326 + }, 327 + { 328 + "BriefDescription": "Data requested of the CPU : Card reading from DRAM", 329 + "Counter": "0,1", 330 + "CounterType": "PGMABLE", 331 + "EventCode": "0x83", 332 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_READ.PART7", 333 + "FCMask": "0x07", 334 + "PerPkg": "1", 335 + "PortMask": "0x80", 336 + "PublicDescription": "Data requested of the CPU : Card reading from DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x4 card is plugged in to slot 3", 337 + "UMask": "0x04", 338 + "Unit": "IIO" 339 + }, 340 + { 341 + "BriefDescription": "Data requested of the CPU : Card writing to DRAM", 342 + "Counter": "0,1", 343 + "CounterType": "PGMABLE", 344 + "EventCode": "0x83", 345 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART4", 346 + "FCMask": "0x07", 347 + "PerPkg": "1", 348 + "PortMask": "0x10", 349 + "PublicDescription": "Data requested of the CPU : Card writing to DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x16 card plugged in to stack, Or x8 card plugged in to Lane 0/1, Or x4 card is plugged in to slot 0", 350 + "UMask": "0x01", 351 + "Unit": "IIO" 352 + }, 353 + { 354 + "BriefDescription": "Data requested of the CPU : Card writing to DRAM", 355 + "Counter": "0,1", 356 + "CounterType": "PGMABLE", 357 + "EventCode": "0x83", 358 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART5", 359 + "FCMask": "0x07", 360 + "PerPkg": "1", 361 + "PortMask": "0x20", 362 + "PublicDescription": "Data requested of the CPU : Card writing to DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x4 card is plugged in to slot 1", 363 + "UMask": "0x01", 364 + "Unit": "IIO" 365 + }, 366 + { 367 + "BriefDescription": "Data requested of the CPU : Card writing to DRAM", 368 + "Counter": "0,1", 369 + "CounterType": "PGMABLE", 370 + "EventCode": "0x83", 371 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART6", 372 + "FCMask": "0x07", 373 + "PerPkg": "1", 374 + "PortMask": "0x40", 375 + "PublicDescription": "Data requested of the CPU : Card writing to DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x8 card plugged in to Lane 2/3, Or x4 card is plugged in to slot 1", 376 + "UMask": "0x01", 377 + "Unit": "IIO" 378 + }, 379 + { 380 + "BriefDescription": "Data requested of the CPU : Card writing to DRAM", 381 + "Counter": "0,1", 382 + "CounterType": "PGMABLE", 383 + "EventCode": "0x83", 384 + "EventName": "UNC_IIO_DATA_REQ_OF_CPU.MEM_WRITE.PART7", 385 + "FCMask": "0x07", 386 + "PerPkg": "1", 387 + "PortMask": "0x80", 388 + "PublicDescription": "Data requested of the CPU : Card writing to DRAM : Number of DWs (4 bytes) the card requests of the main die. Includes all requests initiated by the Card, including reads and writes. : x4 card is plugged in to slot 3", 389 + "UMask": "0x01", 390 + "Unit": "IIO" 391 + }, 392 + { 393 + "BriefDescription": "Clockticks of the IO coherency tracker (IRP)", 394 + "Counter": "0,1", 395 + "CounterType": "PGMABLE", 396 + "EventCode": "0x01", 397 + "EventName": "UNC_I_CLOCKTICKS", 398 + "PerPkg": "1", 399 + "PublicDescription": "Clockticks of the IO coherency tracker (IRP)", 400 + "Unit": "IRP" 401 + }, 402 + { 403 + "BriefDescription": "Clockticks of the mesh to memory (M2M)", 404 + "Counter": "0,1,2,3", 405 + "CounterType": "PGMABLE", 406 + "EventName": "UNC_M2M_CLOCKTICKS", 407 + "PerPkg": "1", 408 + "PublicDescription": "Clockticks of the mesh to memory (M2M)", 409 + "Unit": "M2M" 410 + }, 411 + { 412 + "BriefDescription": "Clockticks of the mesh to PCI (M2P)", 413 + "Counter": "0,1,2,3", 414 + "CounterType": "PGMABLE", 415 + "EventCode": "0x01", 416 + "EventName": "UNC_M2P_CLOCKTICKS", 417 + "PerPkg": "1", 418 + "PublicDescription": "Clockticks of the mesh to PCI (M2P)", 419 + "Unit": "M2PCIe" 420 + }, 421 + { 422 + "BriefDescription": "Clockticks in the UBOX using a dedicated 48-bit Fixed Counter", 423 + "Counter": "FIXED", 424 + "CounterType": "PGMABLE", 425 + "EventCode": "0xff", 426 + "EventName": "UNC_U_CLOCKTICKS", 427 + "PerPkg": "1", 428 + "PublicDescription": "Clockticks in the UBOX using a dedicated 48-bit Fixed Counter", 429 + "Unit": "UBOX" 430 + } 431 + ]
+11
tools/perf/pmu-events/arch/x86/tremontx/uncore-power.json
··· 1 + [ 2 + { 3 + "BriefDescription": "Clockticks of the power control unit (PCU)", 4 + "Counter": "0,1,2,3", 5 + "CounterType": "PGMABLE", 6 + "EventName": "UNC_P_CLOCKTICKS", 7 + "PerPkg": "1", 8 + "PublicDescription": "Clockticks of the power control unit (PCU)", 9 + "Unit": "PCU" 10 + } 11 + ]
+86
tools/perf/pmu-events/arch/x86/tremontx/virtual-memory.json
··· 1 + [ 2 + { 3 + "CollectPEBSRecord": "2", 4 + "PublicDescription": "Counts page walks completed due to demand data loads (including SW prefetches) whose address translations missed in all TLB levels and were mapped to 4K pages. The page walks can end with or without a page fault.", 5 + "EventCode": "0x08", 6 + "Counter": "0,1,2,3", 7 + "UMask": "0x2", 8 + "PEBScounters": "0,1,2,3", 9 + "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_4K", 10 + "PDIR_COUNTER": "na", 11 + "SampleAfterValue": "200003", 12 + "BriefDescription": "Page walk completed due to a demand load to a 4K page." 13 + }, 14 + { 15 + "CollectPEBSRecord": "2", 16 + "PublicDescription": "Counts page walks completed due to demand data loads (including SW prefetches) whose address translations missed in all TLB levels and were mapped to 2M or 4M pages. The page walks can end with or without a page fault.", 17 + "EventCode": "0x08", 18 + "Counter": "0,1,2,3", 19 + "UMask": "0x4", 20 + "PEBScounters": "0,1,2,3", 21 + "EventName": "DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4M", 22 + "PDIR_COUNTER": "na", 23 + "SampleAfterValue": "200003", 24 + "BriefDescription": "Page walk completed due to a demand load to a 2M or 4M page." 25 + }, 26 + { 27 + "CollectPEBSRecord": "2", 28 + "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.", 29 + "EventCode": "0x49", 30 + "Counter": "0,1,2,3", 31 + "UMask": "0x2", 32 + "PEBScounters": "0,1,2,3", 33 + "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_4K", 34 + "PDIR_COUNTER": "na", 35 + "SampleAfterValue": "2000003", 36 + "BriefDescription": "Page walk completed due to a demand data store to a 4K page." 37 + }, 38 + { 39 + "CollectPEBSRecord": "2", 40 + "PublicDescription": "Counts page walks completed due to demand data stores whose address translations missed in the TLB and were mapped to 2M or 4M pages. The page walks can end with or without a page fault.", 41 + "EventCode": "0x49", 42 + "Counter": "0,1,2,3", 43 + "UMask": "0x4", 44 + "PEBScounters": "0,1,2,3", 45 + "EventName": "DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M", 46 + "PDIR_COUNTER": "na", 47 + "SampleAfterValue": "2000003", 48 + "BriefDescription": "Page walk completed due to a demand data store to a 2M or 4M page." 49 + }, 50 + { 51 + "CollectPEBSRecord": "2", 52 + "PublicDescription": "Counts the number of times the machine was unable to find a translation in the Instruction Translation Lookaside Buffer (ITLB) and new translation was filled into the ITLB. The event is speculative in nature, but will not count translations (page walks) that are begun and not finished, or translations that are finished but not filled into the ITLB.", 53 + "EventCode": "0x81", 54 + "Counter": "0,1,2,3", 55 + "UMask": "0x4", 56 + "PEBScounters": "0,1,2,3", 57 + "EventName": "ITLB.FILLS", 58 + "PDIR_COUNTER": "na", 59 + "SampleAfterValue": "200003", 60 + "BriefDescription": "Counts the number of times there was an ITLB miss and a new translation was filled into the ITLB." 61 + }, 62 + { 63 + "CollectPEBSRecord": "2", 64 + "PublicDescription": "Counts page walks completed due to instruction fetches whose address translations missed in the TLB and were mapped to 4K pages. The page walks can end with or without a page fault.", 65 + "EventCode": "0x85", 66 + "Counter": "0,1,2,3", 67 + "UMask": "0x2", 68 + "PEBScounters": "0,1,2,3", 69 + "EventName": "ITLB_MISSES.WALK_COMPLETED_4K", 70 + "PDIR_COUNTER": "na", 71 + "SampleAfterValue": "2000003", 72 + "BriefDescription": "Page walk completed due to an instruction fetch in a 4K page." 73 + }, 74 + { 75 + "CollectPEBSRecord": "2", 76 + "PublicDescription": "Counts page walks completed due to instruction fetches whose address translations missed in the TLB and were mapped to 2M or 4M pages. The page walks can end with or without a page fault.", 77 + "EventCode": "0x85", 78 + "Counter": "0,1,2,3", 79 + "UMask": "0x4", 80 + "PEBScounters": "0,1,2,3", 81 + "EventName": "ITLB_MISSES.WALK_COMPLETED_2M_4M", 82 + "PDIR_COUNTER": "na", 83 + "SampleAfterValue": "2000003", 84 + "BriefDescription": "Page walk completed due to an instruction fetch in a 2M or 4M page." 85 + } 86 + ]
+1
tools/perf/util/Build
··· 9 9 perf-y += evlist.o 10 10 perf-y += evsel.o 11 11 perf-y += evsel_fprintf.o 12 + perf-y += evswitch.o 12 13 perf-y += find_bit.o 13 14 perf-y += get_current_dir_name.o 14 15 perf-y += kallsyms.o
+61
tools/perf/util/evswitch.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // Copyright (C) 2019, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 3 + 4 + #include "evswitch.h" 5 + #include "evlist.h" 6 + 7 + bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel) 8 + { 9 + if (evswitch->on && evswitch->discarding) { 10 + if (evswitch->on != evsel) 11 + return true; 12 + 13 + evswitch->discarding = false; 14 + 15 + if (!evswitch->show_on_off_events) 16 + return true; 17 + 18 + return false; 19 + } 20 + 21 + if (evswitch->off && !evswitch->discarding) { 22 + if (evswitch->off != evsel) 23 + return false; 24 + 25 + evswitch->discarding = true; 26 + 27 + if (!evswitch->show_on_off_events) 28 + return true; 29 + } 30 + 31 + return false; 32 + } 33 + 34 + static int evswitch__fprintf_enoent(FILE *fp, const char *evtype, const char *evname) 35 + { 36 + int printed = fprintf(fp, "ERROR: switch-%s event not found (%s)\n", evtype, evname); 37 + 38 + return printed += fprintf(fp, "HINT: use 'perf evlist' to see the available event names\n"); 39 + } 40 + 41 + int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp) 42 + { 43 + if (evswitch->on_name) { 44 + evswitch->on = perf_evlist__find_evsel_by_str(evlist, evswitch->on_name); 45 + if (evswitch->on == NULL) { 46 + evswitch__fprintf_enoent(fp, "on", evswitch->on_name); 47 + return -ENOENT; 48 + } 49 + evswitch->discarding = true; 50 + } 51 + 52 + if (evswitch->off_name) { 53 + evswitch->off = perf_evlist__find_evsel_by_str(evlist, evswitch->off_name); 54 + if (evswitch->off == NULL) { 55 + evswitch__fprintf_enoent(fp, "off", evswitch->off_name); 56 + return -ENOENT; 57 + } 58 + } 59 + 60 + return 0; 61 + }
+31
tools/perf/util/evswitch.h
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // Copyright (C) 2019, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 3 + #ifndef __PERF_EVSWITCH_H 4 + #define __PERF_EVSWITCH_H 1 5 + 6 + #include <stdbool.h> 7 + #include <stdio.h> 8 + 9 + struct evsel; 10 + struct evlist; 11 + 12 + struct evswitch { 13 + struct evsel *on, *off; 14 + const char *on_name, *off_name; 15 + bool discarding; 16 + bool show_on_off_events; 17 + }; 18 + 19 + int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp); 20 + 21 + bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel); 22 + 23 + #define OPTS_EVSWITCH(evswitch) \ 24 + OPT_STRING(0, "switch-on", &(evswitch)->on_name, \ 25 + "event", "Consider events after the ocurrence of this event"), \ 26 + OPT_STRING(0, "switch-off", &(evswitch)->off_name, \ 27 + "event", "Stop considering events after the ocurrence of this event"), \ 28 + OPT_BOOLEAN(0, "show-on-off-events", &(evswitch)->show_on_off_events, \ 29 + "Show the on/off switch events, used with --switch-on and --switch-off") 30 + 31 + #endif /* __PERF_EVSWITCH_H */
+3 -2
tools/perf/util/map.c
··· 636 636 637 637 struct map_groups *map_groups__new(struct machine *machine) 638 638 { 639 - struct map_groups *mg = malloc(sizeof(*mg)); 639 + struct map_groups *mg = zalloc(sizeof(*mg)); 640 640 641 641 if (mg != NULL) 642 642 map_groups__init(mg, machine); ··· 647 647 void map_groups__delete(struct map_groups *mg) 648 648 { 649 649 map_groups__exit(mg); 650 + unwind__finish_access(mg); 650 651 free(mg); 651 652 } 652 653 ··· 888 887 if (new == NULL) 889 888 goto out_unlock; 890 889 891 - err = unwind__prepare_access(thread, new, NULL); 890 + err = unwind__prepare_access(mg, new, NULL); 892 891 if (err) 893 892 goto out_unlock; 894 893
+4
tools/perf/util/map_groups.h
··· 31 31 struct maps maps; 32 32 struct machine *machine; 33 33 refcount_t refcnt; 34 + #ifdef HAVE_LIBUNWIND_SUPPORT 35 + void *addr_space; 36 + struct unwind_libunwind_ops *unwind_libunwind_ops; 37 + #endif 34 38 }; 35 39 36 40 #define KMAP_NAME_LEN 256
+3 -4
tools/perf/util/thread.c
··· 105 105 } 106 106 up_write(&thread->comm_lock); 107 107 108 - unwind__finish_access(thread); 109 108 nsinfo__zput(thread->nsinfo); 110 109 srccode_state_free(&thread->srccode_state); 111 110 ··· 251 252 list_add(&new->list, &thread->comm_list); 252 253 253 254 if (exec) 254 - unwind__flush_access(thread); 255 + unwind__flush_access(thread->mg); 255 256 } 256 257 257 258 thread->comm_set = true; ··· 331 332 { 332 333 int ret; 333 334 334 - ret = unwind__prepare_access(thread, map, NULL); 335 + ret = unwind__prepare_access(thread->mg, map, NULL); 335 336 if (ret) 336 337 return ret; 337 338 ··· 351 352 down_read(&maps->lock); 352 353 353 354 for (map = maps__first(maps); map; map = map__next(map)) { 354 - err = unwind__prepare_access(thread, map, &initialized); 355 + err = unwind__prepare_access(thread->mg, map, &initialized); 355 356 if (err || initialized) 356 357 break; 357 358 }
-4
tools/perf/util/thread.h
··· 44 44 struct thread_stack *ts; 45 45 struct nsinfo *nsinfo; 46 46 struct srccode_state srccode_state; 47 - #ifdef HAVE_LIBUNWIND_SUPPORT 48 - void *addr_space; 49 - struct unwind_libunwind_ops *unwind_libunwind_ops; 50 - #endif 51 47 bool filter; 52 48 int filter_entry_depth; 53 49 };
+2
tools/perf/util/top.h
··· 3 3 #define __PERF_TOP_H 1 4 4 5 5 #include "tool.h" 6 + #include "evswitch.h" 6 7 #include "annotate.h" 7 8 #include <linux/types.h> 8 9 #include <stddef.h> ··· 19 18 struct evlist *evlist; 20 19 struct record_opts record_opts; 21 20 struct annotation_options annotation_opts; 21 + struct evswitch evswitch; 22 22 /* 23 23 * Symbols will be added here in perf_event__process_sample and will 24 24 * get out after decayed.
+9 -9
tools/perf/util/unwind-libunwind-local.c
··· 616 616 .get_proc_name = get_proc_name, 617 617 }; 618 618 619 - static int _unwind__prepare_access(struct thread *thread) 619 + static int _unwind__prepare_access(struct map_groups *mg) 620 620 { 621 - thread->addr_space = unw_create_addr_space(&accessors, 0); 622 - if (!thread->addr_space) { 621 + mg->addr_space = unw_create_addr_space(&accessors, 0); 622 + if (!mg->addr_space) { 623 623 pr_err("unwind: Can't create unwind address space.\n"); 624 624 return -ENOMEM; 625 625 } 626 626 627 - unw_set_caching_policy(thread->addr_space, UNW_CACHE_GLOBAL); 627 + unw_set_caching_policy(mg->addr_space, UNW_CACHE_GLOBAL); 628 628 return 0; 629 629 } 630 630 631 - static void _unwind__flush_access(struct thread *thread) 631 + static void _unwind__flush_access(struct map_groups *mg) 632 632 { 633 - unw_flush_cache(thread->addr_space, 0, 0); 633 + unw_flush_cache(mg->addr_space, 0, 0); 634 634 } 635 635 636 - static void _unwind__finish_access(struct thread *thread) 636 + static void _unwind__finish_access(struct map_groups *mg) 637 637 { 638 - unw_destroy_addr_space(thread->addr_space); 638 + unw_destroy_addr_space(mg->addr_space); 639 639 } 640 640 641 641 static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb, ··· 660 660 */ 661 661 if (max_stack - 1 > 0) { 662 662 WARN_ONCE(!ui->thread, "WARNING: ui->thread is NULL"); 663 - addr_space = ui->thread->addr_space; 663 + addr_space = ui->thread->mg->addr_space; 664 664 665 665 if (addr_space == NULL) 666 666 return -1;
+17 -23
tools/perf/util/unwind-libunwind.c
··· 11 11 struct unwind_libunwind_ops __weak *x86_32_unwind_libunwind_ops; 12 12 struct unwind_libunwind_ops __weak *arm64_unwind_libunwind_ops; 13 13 14 - static void unwind__register_ops(struct thread *thread, 14 + static void unwind__register_ops(struct map_groups *mg, 15 15 struct unwind_libunwind_ops *ops) 16 16 { 17 - thread->unwind_libunwind_ops = ops; 17 + mg->unwind_libunwind_ops = ops; 18 18 } 19 19 20 - int unwind__prepare_access(struct thread *thread, struct map *map, 20 + int unwind__prepare_access(struct map_groups *mg, struct map *map, 21 21 bool *initialized) 22 22 { 23 23 const char *arch; ··· 28 28 if (!dwarf_callchain_users) 29 29 return 0; 30 30 31 - if (thread->addr_space) { 31 + if (mg->addr_space) { 32 32 pr_debug("unwind: thread map already set, dso=%s\n", 33 33 map->dso->name); 34 34 if (initialized) ··· 37 37 } 38 38 39 39 /* env->arch is NULL for live-mode (i.e. perf top) */ 40 - if (!thread->mg->machine->env || !thread->mg->machine->env->arch) 40 + if (!mg->machine->env || !mg->machine->env->arch) 41 41 goto out_register; 42 42 43 - dso_type = dso__type(map->dso, thread->mg->machine); 43 + dso_type = dso__type(map->dso, mg->machine); 44 44 if (dso_type == DSO__TYPE_UNKNOWN) 45 45 return 0; 46 46 47 - arch = perf_env__arch(thread->mg->machine->env); 47 + arch = perf_env__arch(mg->machine->env); 48 48 49 49 if (!strcmp(arch, "x86")) { 50 50 if (dso_type != DSO__TYPE_64BIT) ··· 59 59 return 0; 60 60 } 61 61 out_register: 62 - unwind__register_ops(thread, ops); 62 + unwind__register_ops(mg, ops); 63 63 64 - err = thread->unwind_libunwind_ops->prepare_access(thread); 64 + err = mg->unwind_libunwind_ops->prepare_access(mg); 65 65 if (initialized) 66 66 *initialized = err ? false : true; 67 67 return err; 68 68 } 69 69 70 - void unwind__flush_access(struct thread *thread) 70 + void unwind__flush_access(struct map_groups *mg) 71 71 { 72 - if (!dwarf_callchain_users) 73 - return; 74 - 75 - if (thread->unwind_libunwind_ops) 76 - thread->unwind_libunwind_ops->flush_access(thread); 72 + if (mg->unwind_libunwind_ops) 73 + mg->unwind_libunwind_ops->flush_access(mg); 77 74 } 78 75 79 - void unwind__finish_access(struct thread *thread) 76 + void unwind__finish_access(struct map_groups *mg) 80 77 { 81 - if (!dwarf_callchain_users) 82 - return; 83 - 84 - if (thread->unwind_libunwind_ops) 85 - thread->unwind_libunwind_ops->finish_access(thread); 78 + if (mg->unwind_libunwind_ops) 79 + mg->unwind_libunwind_ops->finish_access(mg); 86 80 } 87 81 88 82 int unwind__get_entries(unwind_entry_cb_t cb, void *arg, 89 83 struct thread *thread, 90 84 struct perf_sample *data, int max_stack) 91 85 { 92 - if (thread->unwind_libunwind_ops) 93 - return thread->unwind_libunwind_ops->get_entries(cb, arg, thread, data, max_stack); 86 + if (thread->mg->unwind_libunwind_ops) 87 + return thread->mg->unwind_libunwind_ops->get_entries(cb, arg, thread, data, max_stack); 94 88 return 0; 95 89 }
+13 -12
tools/perf/util/unwind.h
··· 6 6 #include <linux/types.h> 7 7 8 8 struct map; 9 + struct map_groups; 9 10 struct perf_sample; 10 11 struct symbol; 11 12 struct thread; ··· 20 19 typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry, void *arg); 21 20 22 21 struct unwind_libunwind_ops { 23 - int (*prepare_access)(struct thread *thread); 24 - void (*flush_access)(struct thread *thread); 25 - void (*finish_access)(struct thread *thread); 22 + int (*prepare_access)(struct map_groups *mg); 23 + void (*flush_access)(struct map_groups *mg); 24 + void (*finish_access)(struct map_groups *mg); 26 25 int (*get_entries)(unwind_entry_cb_t cb, void *arg, 27 26 struct thread *thread, 28 27 struct perf_sample *data, int max_stack); ··· 47 46 #endif 48 47 49 48 int LIBUNWIND__ARCH_REG_ID(int regnum); 50 - int unwind__prepare_access(struct thread *thread, struct map *map, 49 + int unwind__prepare_access(struct map_groups *mg, struct map *map, 51 50 bool *initialized); 52 - void unwind__flush_access(struct thread *thread); 53 - void unwind__finish_access(struct thread *thread); 51 + void unwind__flush_access(struct map_groups *mg); 52 + void unwind__finish_access(struct map_groups *mg); 54 53 #else 55 - static inline int unwind__prepare_access(struct thread *thread __maybe_unused, 54 + static inline int unwind__prepare_access(struct map_groups *mg __maybe_unused, 56 55 struct map *map __maybe_unused, 57 56 bool *initialized __maybe_unused) 58 57 { 59 58 return 0; 60 59 } 61 60 62 - static inline void unwind__flush_access(struct thread *thread __maybe_unused) {} 63 - static inline void unwind__finish_access(struct thread *thread __maybe_unused) {} 61 + static inline void unwind__flush_access(struct map_groups *mg __maybe_unused) {} 62 + static inline void unwind__finish_access(struct map_groups *mg __maybe_unused) {} 64 63 #endif 65 64 #else 66 65 static inline int ··· 73 72 return 0; 74 73 } 75 74 76 - static inline int unwind__prepare_access(struct thread *thread __maybe_unused, 75 + static inline int unwind__prepare_access(struct map_groups *mg __maybe_unused, 77 76 struct map *map __maybe_unused, 78 77 bool *initialized __maybe_unused) 79 78 { 80 79 return 0; 81 80 } 82 81 83 - static inline void unwind__flush_access(struct thread *thread __maybe_unused) {} 84 - static inline void unwind__finish_access(struct thread *thread __maybe_unused) {} 82 + static inline void unwind__flush_access(struct map_groups *mg __maybe_unused) {} 83 + static inline void unwind__finish_access(struct map_groups *mg __maybe_unused) {} 85 84 #endif /* HAVE_DWARF_UNWIND_SUPPORT */ 86 85 #endif /* __UNWIND_H */