Lines Matching +full:cpu +full:- +full:offset

2 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <pmu-events/pmu-events.h>
12 int offset; member
22 /* offset=0 */ "software\000"
23 /* offset=9 */ "cpu-clock\000software\000Per-CPU high-resolution timer based event\000config=0\000\…
24 /* offset=87 */ "task-clock\000software\000Per-task high-resolution timer based event\000config=1\0…
25 /* offset=167 */ "faults\000software\000Number of page faults [This event is an alias of page-fault…
26 /* offset=262 */ "page-faults\000software\000Number of page faults [This event is an alias of fault…
27 /* offset=357 */ "context-switches\000software\000Number of context switches [This event is an alia…
28 /* offset=458 */ "cs\000software\000Number of context switches [This event is an alias of context-s…
29 /* offset=559 */ "cpu-migrations\000software\000Number of times a process has migrated to a new CPU
30 /* offset=691 */ "migrations\000software\000Number of times a process has migrated to a new CPU [Th…
31 /* offset=823 */ "minor-faults\000software\000Number of minor page faults. Minor faults don't requi…
32 /* offset=932 */ "major-faults\000software\000Number of major page faults. Major faults require I/O…
33 /* offset=1035 */ "alignment-faults\000software\000Number of kernel handled memory alignment faults…
34 /* offset=1127 */ "emulation-faults\000software\000Number of kernel handled unimplemented instructi…
35 /* offset=1254 */ "dummy\000software\000A placeholder event that doesn't count anything\000config=9…
36 /* offset=1334 */ "bpf-output\000software\000An event used by BPF programs to write to the perf rin…
37 /* offset=1436 */ "cgroup-switches\000software\000Number of context switches to a task in a differe…
38 /* offset=1539 */ "tool\000"
39 /* offset=1544 */ "duration_time\000tool\000Wall clock interval time in nanoseconds\000config=1\000…
40 /* offset=1620 */ "user_time\000tool\000User (non-kernel) time in nanoseconds\000config=2\000\00000…
41 /* offset=1690 */ "system_time\000tool\000System/kernel time in nanoseconds\000config=3\000\00000\0…
42 /* offset=1758 */ "has_pmem\000tool\0001 if persistent memory installed otherwise 0\000config=4\000…
43 …* offset=1834 */ "num_cores\000tool\000Number of cores. A core consists of 1 or more thread, with …
44 /* offset=1979 */ "num_cpus\000tool\000Number of logical Linux CPUs. There may be multiple such CPU…
45 /* offset=2082 */ "num_cpus_online\000tool\000Number of online logical Linux CPUs. There may be mul…
46 /* offset=2199 */ "num_dies\000tool\000Number of dies. Each die has 1 or more cores\000config=8\000…
47 /* offset=2275 */ "num_packages\000tool\000Number of packages. Each package has 1 or more die\000co…
48 /* offset=2361 */ "slots\000tool\000Number of functional units that in parallel can execute parts o…
49 /* offset=2471 */ "smt_on\000tool\0001 if simultaneous multithreading (aka hyperthreading) is enabl…
50 /* offset=2578 */ "system_tsc_freq\000tool\000The amount a Time Stamp Counter (TSC) increases per s…
51 /* offset=2677 */ "default_core\000"
52 /* offset=2690 */ "bp_l1_btb_correct\000branch\000L1 BTB Correction\000event=0x8a\000\00000\000\000…
53 /* offset=2752 */ "bp_l2_btb_correct\000branch\000L2 BTB Correction\000event=0x8b\000\00000\000\000…
54 /* offset=2814 */ "l3_cache_rd\000cache\000L3 cache access, read\000event=0x40\000\00000\000\000\00…
55 /* offset=2912 */ "segment_reg_loads.any\000other\000Number of segment register loads\000event=6,pe…
56 /* offset=3014 */ "dispatch_blocked.any\000other\000Memory cluster signals to block micro-op dispat…
57 /* offset=3147 */ "eist_trans\000other\000Number of Enhanced Intel SpeedStep(R) Technology (EIST) t…
58 /* offset=3265 */ "hisi_sccl,ddrc\000"
59 /* offset=3280 */ "uncore_hisi_ddrc.flux_wcmd\000uncore\000DDRC write commands\000event=2\000\00000…
60 /* offset=3350 */ "uncore_cbox\000"
61 /* offset=3362 */ "unc_cbo_xsnp_response.miss_eviction\000uncore\000A cross-core snoop resulted fro…
62 /* offset=3516 */ "event-hyphen\000uncore\000UNC_CBO_HYPHEN\000event=0xe0\000\00000\000\000\000\000…
63 /* offset=3570 */ "event-two-hyph\000uncore\000UNC_CBO_TWO_HYPH\000event=0xc0\000\00000\000\000\000…
64 /* offset=3628 */ "hisi_sccl,l3c\000"
65 /* offset=3642 */ "uncore_hisi_l3c.rd_hit_cpipe\000uncore\000Total read hits\000event=7\000\00000\0…
66 /* offset=3710 */ "uncore_imc_free_running\000"
67 /* offset=3734 */ "uncore_imc_free_running.cache_miss\000uncore\000Total cache misses\000event=0x12…
68 /* offset=3814 */ "uncore_imc\000"
69 /* offset=3825 */ "uncore_imc.cache_hits\000uncore\000Total cache hits\000event=0x34\000\00000\000\…
70 /* offset=3890 */ "uncore_sys_ddr_pmu\000"
71 /* offset=3909 */ "sys_ddr_pmu.write_cycles\000uncore\000ddr write-cycles event\000event=0x2b\000v8…
72 /* offset=3985 */ "uncore_sys_ccn_pmu\000"
73 /* offset=4004 */ "sys_ccn_pmu.read_cycles\000uncore\000ccn read-cycles event\000config=0x2c\0000x0…
74 /* offset=4081 */ "uncore_sys_cmn_pmu\000"
75 /* offset=4100 */ "sys_cmn_pmu.hnf_cache_miss\000uncore\000Counts total cache misses in first looku…
76 /* offset=4243 */ "CPI\000\0001 / IPC\000\000\000\000\000\000\000\00000"
77 /* offset=4265 */ "IPC\000group1\000inst_retired.any / cpu_clk_unhalted.thread\000\000\000\000\000\…
78 /* offset=4328 */ "Frontend_Bound_SMT\000\000idq_uops_not_delivered.core / (4 * (cpu_clk_unhalted.t…
79 /* offset=4494 */ "dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\0…
80 /* offset=4558 */ "icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\00…
81 /* offset=4625 */ "cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\…
82 /* offset=4696 */ "DCache_L2_All_Hits\000\000l2_rqsts.demand_data_rd_hit + l2_rqsts.pf_hit + l2_rqs…
83 /* offset=4790 */ "DCache_L2_All_Miss\000\000max(l2_rqsts.all_demand_data_rd - l2_rqsts.demand_data…
84 /* offset=4924 */ "DCache_L2_All\000\000DCache_L2_All_Hits + DCache_L2_All_Miss\000\000\000\000\000…
85 /* offset=4988 */ "DCache_L2_Hits\000\000d_ratio(DCache_L2_All_Hits, DCache_L2_All)\000\000\000\000…
86 /* offset=5056 */ "DCache_L2_Misses\000\000d_ratio(DCache_L2_All_Miss, DCache_L2_All)\000\000\000\0…
87 /* offset=5126 */ "M1\000\000ipc + M2\000\000\000\000\000\000\000\00000"
88 /* offset=5148 */ "M2\000\000ipc + M1\000\000\000\000\000\000\000\00000"
89 /* offset=5170 */ "M3\000\0001 / M3\000\000\000\000\000\000\000\00000"
90 /* offset=5190 */ "L1D_Cache_Fill_BW\000\00064 * l1d.replacement / 1e9 / duration_time\000\000\000\…
94 { 1035 }, /* alignment-faults\000software\000Number of kernel handled memory alignment faults\000co…
95 { 1334 }, /* bpf-output\000software\000An event used by BPF programs to write to the perf ring buff…
96 { 1436 }, /* cgroup-switches\000software\000Number of context switches to a task in a different cgr…
97 { 357 }, /* context-switches\000software\000Number of context switches [This event is an alias of c…
98 { 9 }, /* cpu-clock\000software\000Per-CPU high-resolution timer based event\000config=0\000\00000\…
99 { 559 }, /* cpu-migrations\000software\000Number of times a process has migrated to a new CPU [This…
100 { 458 }, /* cs\000software\000Number of context switches [This event is an alias of context-switche…
102 { 1127 }, /* emulation-faults\000software\000Number of kernel handled unimplemented instruction fau…
103 { 167 }, /* faults\000software\000Number of page faults [This event is an alias of page-faults]\000…
104 { 932 }, /* major-faults\000software\000Number of major page faults. Major faults require I/O to ha…
105 …oftware\000Number of times a process has migrated to a new CPU [This event is an alias of cpu-migr…
106 { 823 }, /* minor-faults\000software\000Number of minor page faults. Minor faults don't require I/O…
107 { 262 }, /* page-faults\000software\000Number of page faults [This event is an alias of faults]\000…
108 { 87 }, /* task-clock\000software\000Per-task high-resolution timer based event\000config=1\000\000…
113 …f 1 or more thread, with each thread being associated with a logical Linux CPU\000config=5\000\000…
122 { 1620 }, /* user_time\000tool\000User (non-kernel) time in nanoseconds\000config=2\000\00000\000\0…
142 { 3014 }, /* dispatch_blocked.any\000other\000Memory cluster signals to block micro-op dispatch for…
154 { 3516 }, /* event-hyphen\000uncore\000UNC_CBO_HYPHEN\000event=0xe0\000\00000\000\000\000\000\000 */
155 { 3570 }, /* event-two-hyph\000uncore\000UNC_CBO_TWO_HYPH\000event=0xc0\000\00000\000\000\000\000\0…
156 { 3362 }, /* unc_cbo_xsnp_response.miss_eviction\000uncore\000A cross-core snoop resulted from L3 E…
203 { 4790 }, /* DCache_L2_All_Miss\000\000max(l2_rqsts.all_demand_data_rd - l2_rqsts.demand_data_rd_hi…
213 { 4494 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000…
214 { 4558 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\…
227 { 4004 }, /* sys_ccn_pmu.read_cycles\000uncore\000ccn read-cycles event\000config=0x2c\0000x01\0000…
233 { 3909 }, /* sys_ddr_pmu.write_cycles\000uncore\000ddr write-cycles event\000event=0x2b\000v8\00000…
269 * Map a CPU to its table of PMU events. The CPU is identified by the
270 * cpuid field, which is an arch-specific identifier for the CPU.
271 * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile
284 * Global table mapping each known CPU for the architecture to its
337 static void decompress_event(int offset, struct pmu_event *pe) in decompress_event() argument
339 const char *p = &big_c_string[offset]; in decompress_event()
341 pe->name = (*p == '\0' ? NULL : p); in decompress_event()
343 pe->topic = (*p == '\0' ? NULL : p); in decompress_event()
345 pe->desc = (*p == '\0' ? NULL : p); in decompress_event()
347 pe->event = (*p == '\0' ? NULL : p); in decompress_event()
349 pe->compat = (*p == '\0' ? NULL : p); in decompress_event()
351 pe->deprecated = *p - '0'; in decompress_event()
353 pe->perpkg = *p - '0'; in decompress_event()
355 pe->unit = (*p == '\0' ? NULL : p); in decompress_event()
357 pe->retirement_latency_mean = (*p == '\0' ? NULL : p); in decompress_event()
359 pe->retirement_latency_min = (*p == '\0' ? NULL : p); in decompress_event()
361 pe->retirement_latency_max = (*p == '\0' ? NULL : p); in decompress_event()
363 pe->long_desc = (*p == '\0' ? NULL : p); in decompress_event()
366 static void decompress_metric(int offset, struct pmu_metric *pm) in decompress_metric() argument
368 const char *p = &big_c_string[offset]; in decompress_metric()
370 pm->metric_name = (*p == '\0' ? NULL : p); in decompress_metric()
372 pm->metric_group = (*p == '\0' ? NULL : p); in decompress_metric()
374 pm->metric_expr = (*p == '\0' ? NULL : p); in decompress_metric()
376 pm->metric_threshold = (*p == '\0' ? NULL : p); in decompress_metric()
378 pm->desc = (*p == '\0' ? NULL : p); in decompress_metric()
380 pm->long_desc = (*p == '\0' ? NULL : p); in decompress_metric()
382 pm->unit = (*p == '\0' ? NULL : p); in decompress_metric()
384 pm->compat = (*p == '\0' ? NULL : p); in decompress_metric()
386 pm->metricgroup_no_group = (*p == '\0' ? NULL : p); in decompress_metric()
388 pm->default_metricgroup_name = (*p == '\0' ? NULL : p); in decompress_metric()
390 pm->aggr_mode = *p - '0'; in decompress_metric()
392 pm->event_grouping = *p - '0'; in decompress_metric()
402 .pmu = &big_c_string[pmu->pmu_name.offset], in pmu_events_table__for_each_event_pmu()
405 for (uint32_t i = 0; i < pmu->num_entries; i++) { in pmu_events_table__for_each_event_pmu()
406 decompress_event(pmu->entries[i].offset, &pe); in pmu_events_table__for_each_event_pmu()
423 .pmu = &big_c_string[pmu->pmu_name.offset], in pmu_events_table__find_event_pmu()
425 int low = 0, high = pmu->num_entries - 1; in pmu_events_table__find_event_pmu()
430 decompress_event(pmu->entries[mid].offset, &pe); in pmu_events_table__find_event_pmu()
440 high = mid - 1; in pmu_events_table__find_event_pmu()
450 high = mid - 1; in pmu_events_table__find_event_pmu()
464 for (size_t i = 0; i < table->num_pmus; i++) { in pmu_events_table__for_each_event()
465 const struct pmu_table_entry *table_pmu = &table->pmus[i]; in pmu_events_table__for_each_event()
466 const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset]; in pmu_events_table__for_each_event()
485 for (size_t i = 0; i < table->num_pmus; i++) { in pmu_events_table__find_event()
486 const struct pmu_table_entry *table_pmu = &table->pmus[i]; in pmu_events_table__find_event()
487 const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset]; in pmu_events_table__find_event()
505 for (size_t i = 0; i < table->num_pmus; i++) { in pmu_events_table__num_events()
506 const struct pmu_table_entry *table_pmu = &table->pmus[i]; in pmu_events_table__num_events()
507 const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset]; in pmu_events_table__num_events()
510 count += table_pmu->num_entries; in pmu_events_table__num_events()
522 .pmu = &big_c_string[pmu->pmu_name.offset], in pmu_metrics_table__for_each_metric_pmu()
525 for (uint32_t i = 0; i < pmu->num_entries; i++) { in pmu_metrics_table__for_each_metric_pmu()
526 decompress_metric(pmu->entries[i].offset, &pm); in pmu_metrics_table__for_each_metric_pmu()
543 .pmu = &big_c_string[pmu->pmu_name.offset], in pmu_metrics_table__find_metric_pmu()
545 int low = 0, high = pmu->num_entries - 1; in pmu_metrics_table__find_metric_pmu()
550 decompress_metric(pmu->entries[mid].offset, &pm); in pmu_metrics_table__find_metric_pmu()
560 high = mid - 1; in pmu_metrics_table__find_metric_pmu()
570 high = mid - 1; in pmu_metrics_table__find_metric_pmu()
583 for (size_t i = 0; i < table->num_pmus; i++) { in pmu_metrics_table__for_each_metric()
584 int ret = pmu_metrics_table__for_each_metric_pmu(table, &table->pmus[i], in pmu_metrics_table__for_each_metric()
599 for (size_t i = 0; i < table->num_pmus; i++) { in pmu_metrics_table__find_metric()
600 const struct pmu_table_entry *table_pmu = &table->pmus[i]; in pmu_metrics_table__find_metric()
601 const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset]; in pmu_metrics_table__find_metric()
614 static const struct pmu_events_map *map_for_cpu(struct perf_cpu cpu) in map_for_cpu() argument
618 struct perf_cpu cpu; in map_for_cpu() member
629 if (has_last_result && last_result.cpu.cpu == cpu.cpu) in map_for_cpu()
632 cpuid = get_cpuid_allow_env_override(cpu); in map_for_cpu()
649 if (!map->arch) { in map_for_cpu()
654 if (!strcmp_cpuid_str(map->cpuid, cpuid)) in map_for_cpu()
663 last_result.cpu = cpu; in map_for_cpu()
671 struct perf_cpu cpu = {-1}; in map_for_pmu() local
675 const char *pmu_name = &big_c_string[pmu_events__common[i].pmu_name.offset]; in map_for_pmu()
677 if (!strcmp(pmu_name, pmu->name)) { in map_for_pmu()
680 while (strcmp("common", map->arch)) in map_for_pmu()
685 cpu = perf_cpu_map__min(pmu->cpus); in map_for_pmu()
687 return map_for_cpu(cpu); in map_for_pmu()
698 return &map->event_table; in perf_pmu__find_events_table()
700 for (size_t i = 0; i < map->event_table.num_pmus; i++) { in perf_pmu__find_events_table()
701 const struct pmu_table_entry *table_pmu = &map->event_table.pmus[i]; in perf_pmu__find_events_table()
702 const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset]; in perf_pmu__find_events_table()
705 return &map->event_table; in perf_pmu__find_events_table()
712 struct perf_cpu cpu = {-1}; in pmu_metrics_table__find() local
713 const struct pmu_events_map *map = map_for_cpu(cpu); in pmu_metrics_table__find()
715 return map ? &map->metric_table : NULL; in pmu_metrics_table__find()
721 tables->arch; in find_core_events_table()
723 if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid)) in find_core_events_table()
724 return &tables->event_table; in find_core_events_table()
732 tables->arch; in find_core_metrics_table()
734 if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid)) in find_core_metrics_table()
735 return &tables->metric_table; in find_core_metrics_table()
743 tables->arch; in pmu_for_each_core_event()
745 int ret = pmu_events_table__for_each_event(&tables->event_table, in pmu_for_each_core_event()
757 tables->arch; in pmu_for_each_core_metric()
759 int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data); in pmu_for_each_core_metric()
770 tables->name; in find_sys_events_table()
772 if (!strcmp(tables->name, name)) in find_sys_events_table()
773 return &tables->event_table; in find_sys_events_table()
781 tables->name; in pmu_for_each_sys_event()
783 int ret = pmu_events_table__for_each_event(&tables->event_table, in pmu_for_each_sys_event()
795 tables->name; in pmu_for_each_sys_metric()
797 int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data); in pmu_for_each_sys_metric()
811 int low = 0, high = (int)ARRAY_SIZE(metricgroups) - 1; in describe_metricgroup()
823 high = mid - 1; in describe_metricgroup()