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

perf pmu-events: Hide pmu_events_map

Move usage of the table to pmu-events.c so it may be hidden. By
abstracting the table the implementation can later be changed.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.garry@huawei.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20220812230949.683239-8-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
29be2fe0 eeac7730

+284 -184
+79 -2
tools/perf/pmu-events/empty-pmu-events.c
··· 6 6 * The test cpu/soc is provided for testing. 7 7 */ 8 8 #include "pmu-events/pmu-events.h" 9 + #include "util/header.h" 10 + #include "util/pmu.h" 9 11 #include <string.h> 10 12 #include <stddef.h> 11 13 ··· 112 110 }, 113 111 }; 114 112 115 - const struct pmu_events_map pmu_events_map[] = { 113 + 114 + /* 115 + * Map a CPU to its table of PMU events. The CPU is identified by the 116 + * cpuid field, which is an arch-specific identifier for the CPU. 117 + * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile 118 + * must match the get_cpuid_str() in tools/perf/arch/xxx/util/header.c) 119 + * 120 + * The cpuid can contain any character other than the comma. 121 + */ 122 + struct pmu_events_map { 123 + const char *arch; 124 + const char *cpuid; 125 + const struct pmu_event *table; 126 + }; 127 + 128 + /* 129 + * Global table mapping each known CPU for the architecture to its 130 + * table of PMU events. 131 + */ 132 + static const struct pmu_events_map pmu_events_map[] = { 116 133 { 117 134 .arch = "testarch", 118 135 .cpuid = "testcpu", ··· 183 162 }, 184 163 }; 185 164 165 + const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu) 166 + { 167 + const struct pmu_event *table = NULL; 168 + char *cpuid = perf_pmu__getcpuid(pmu); 169 + int i; 170 + 171 + /* on some platforms which uses cpus map, cpuid can be NULL for 172 + * PMUs other than CORE PMUs. 173 + */ 174 + if (!cpuid) 175 + return NULL; 176 + 177 + i = 0; 178 + for (;;) { 179 + const struct pmu_events_map *map = &pmu_events_map[i++]; 180 + 181 + if (!map->table) 182 + break; 183 + 184 + if (!strcmp_cpuid_str(map->cpuid, cpuid)) { 185 + table = map->table; 186 + break; 187 + } 188 + } 189 + free(cpuid); 190 + return table; 191 + } 192 + 193 + const struct pmu_event *find_core_events_table(const char *arch, const char *cpuid) 194 + { 195 + for (const struct pmu_events_map *tables = &pmu_events_map[0]; 196 + tables->table; 197 + tables++) { 198 + if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid)) 199 + return tables->table; 200 + } 201 + return NULL; 202 + } 203 + 204 + int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data) 205 + { 206 + for (const struct pmu_events_map *tables = &pmu_events_map[0]; 207 + tables->table; 208 + tables++) { 209 + for (const struct pmu_event *pe = &tables->table[0]; 210 + pe->name || pe->metric_group || pe->metric_name; 211 + pe++) { 212 + int ret = fn(pe, &tables->table[0], data); 213 + 214 + if (ret) 215 + return ret; 216 + } 217 + } 218 + return 0; 219 + } 220 + 186 221 const struct pmu_event *find_sys_events_table(const char *name) 187 222 { 188 223 for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0]; ··· 258 181 for (const struct pmu_event *pe = &tables->table[0]; 259 182 pe->name || pe->metric_group || pe->metric_name; 260 183 pe++) { 261 - int ret = fn(pe, data); 184 + int ret = fn(pe, &tables->table[0], data); 262 185 263 186 if (ret) 264 187 return ret;
+79 -2
tools/perf/pmu-events/jevents.py
··· 334 334 335 335 def print_mapping_table(archs: Sequence[str]) -> None: 336 336 """Read the mapfile and generate the struct from cpuid string to event table.""" 337 - _args.output_file.write('const struct pmu_events_map pmu_events_map[] = {\n') 337 + _args.output_file.write(""" 338 + /* 339 + * Map a CPU to its table of PMU events. The CPU is identified by the 340 + * cpuid field, which is an arch-specific identifier for the CPU. 341 + * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile 342 + * must match the get_cpuid_str() in tools/perf/arch/xxx/util/header.c) 343 + * 344 + * The cpuid can contain any character other than the comma. 345 + */ 346 + struct pmu_events_map { 347 + const char *arch; 348 + const char *cpuid; 349 + const struct pmu_event *table; 350 + }; 351 + 352 + /* 353 + * Global table mapping each known CPU for the architecture to its 354 + * table of PMU events. 355 + */ 356 + const struct pmu_events_map pmu_events_map[] = { 357 + """) 338 358 for arch in archs: 339 359 if arch == 'test': 340 360 _args.output_file.write("""{ ··· 410 390 \t}, 411 391 }; 412 392 393 + const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu) 394 + { 395 + const struct pmu_event *table = NULL; 396 + char *cpuid = perf_pmu__getcpuid(pmu); 397 + int i; 398 + 399 + /* on some platforms which uses cpus map, cpuid can be NULL for 400 + * PMUs other than CORE PMUs. 401 + */ 402 + if (!cpuid) 403 + return NULL; 404 + 405 + i = 0; 406 + for (;;) { 407 + const struct pmu_events_map *map = &pmu_events_map[i++]; 408 + if (!map->table) 409 + break; 410 + 411 + if (!strcmp_cpuid_str(map->cpuid, cpuid)) { 412 + table = map->table; 413 + break; 414 + } 415 + } 416 + free(cpuid); 417 + return table; 418 + } 419 + 420 + const struct pmu_event *find_core_events_table(const char *arch, const char *cpuid) 421 + { 422 + for (const struct pmu_events_map *tables = &pmu_events_map[0]; 423 + tables->table; 424 + tables++) { 425 + if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid)) 426 + return tables->table; 427 + } 428 + return NULL; 429 + } 430 + 431 + int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data) 432 + { 433 + for (const struct pmu_events_map *tables = &pmu_events_map[0]; 434 + tables->table; 435 + tables++) { 436 + for (const struct pmu_event *pe = &tables->table[0]; 437 + pe->name || pe->metric_group || pe->metric_name; 438 + pe++) { 439 + int ret = fn(pe, &tables->table[0], data); 440 + 441 + if (ret) 442 + return ret; 443 + } 444 + } 445 + return 0; 446 + } 447 + 413 448 const struct pmu_event *find_sys_events_table(const char *name) 414 449 { 415 450 for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0]; ··· 484 409 for (const struct pmu_event *pe = &tables->table[0]; 485 410 pe->name || pe->metric_group || pe->metric_name; 486 411 pe++) { 487 - int ret = fn(pe, data); 412 + int ret = fn(pe, &tables->table[0], data); 488 413 489 414 if (ret) 490 415 return ret; ··· 525 450 526 451 _args.output_file.write(""" 527 452 #include "pmu-events/pmu-events.h" 453 + #include "util/header.h" 454 + #include "util/pmu.h" 528 455 #include <string.h> 529 456 #include <stddef.h> 530 457
+8 -21
tools/perf/pmu-events/pmu-events.h
··· 2 2 #ifndef PMU_EVENTS_H 3 3 #define PMU_EVENTS_H 4 4 5 + struct perf_pmu; 6 + 5 7 enum aggr_mode_class { 6 8 PerChip = 1, 7 9 PerCore ··· 30 28 const char *metric_constraint; 31 29 }; 32 30 33 - /* 34 - * 35 - * Map a CPU to its table of PMU events. The CPU is identified by the 36 - * cpuid field, which is an arch-specific identifier for the CPU. 37 - * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile 38 - * must match the get_cpuid_str() in tools/perf/arch/xxx/util/header.c) 39 - * 40 - * The cpuid can contain any character other than the comma. 41 - */ 42 - struct pmu_events_map { 43 - const char *arch; 44 - const char *cpuid; 45 - const struct pmu_event *table; 46 - }; 31 + typedef int (*pmu_event_iter_fn)(const struct pmu_event *pe, 32 + const struct pmu_event *table, 33 + void *data); 47 34 48 - /* 49 - * Global table mapping each known CPU for the architecture to its 50 - * table of PMU events. 51 - */ 52 - extern const struct pmu_events_map pmu_events_map[]; 35 + const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu); 36 + const struct pmu_event *find_core_events_table(const char *arch, const char *cpuid); 37 + int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data); 53 38 54 39 const struct pmu_event *find_sys_events_table(const char *name); 55 - 56 - typedef int (*pmu_event_iter_fn)(const struct pmu_event *pe, void *data); 57 40 int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data); 58 41 59 42 #endif
+104 -122
tools/perf/tests/pmu-events.c
··· 272 272 return !strcmp(reference, test); 273 273 } 274 274 275 - static const struct pmu_event *__test_pmu_get_events_table(void) 276 - { 277 - for (const struct pmu_events_map *map = &pmu_events_map[0]; map->cpuid; map++) { 278 - if (!strcmp(map->cpuid, "testcpu")) 279 - return map->table; 280 - } 281 - 282 - pr_err("could not find test events map\n"); 283 - 284 - return NULL; 285 - } 286 - 287 275 static int compare_pmu_events(const struct pmu_event *e1, const struct pmu_event *e2) 288 276 { 289 277 if (!is_same(e1->name, e2->name)) { ··· 426 438 int subtest __maybe_unused) 427 439 { 428 440 const struct pmu_event *sys_event_tables = find_sys_events_table("pme_test_soc_sys"); 429 - const struct pmu_event *table = __test_pmu_get_events_table(); 441 + const struct pmu_event *table = find_core_events_table("testarch", "testcpu"); 430 442 int map_events = 0, expected_events; 431 443 432 444 /* ignore 3x sentinels */ ··· 522 534 struct perf_pmu *pmu; 523 535 LIST_HEAD(aliases); 524 536 int res = 0; 525 - const struct pmu_event *table = __test_pmu_get_events_table(); 537 + const struct pmu_event *table = find_core_events_table("testarch", "testcpu"); 526 538 struct perf_pmu_alias *a, *tmp; 527 539 528 540 if (!table) ··· 579 591 LIST_HEAD(aliases); 580 592 int res = 0; 581 593 582 - events_table = __test_pmu_get_events_table(); 594 + events_table = find_core_events_table("testarch", "testcpu"); 583 595 if (!events_table) 584 596 return -1; 585 597 pmu_add_cpu_aliases_table(&aliases, pmu, events_table); ··· 833 845 return ret; 834 846 } 835 847 836 - static void expr_failure(const char *msg, const struct pmu_event *pe) 837 - { 838 - pr_debug("%s\nOn metric %s\nOn expression %s\n", msg, pe->metric_name, pe->metric_expr); 839 - } 840 - 841 848 struct metric { 842 849 struct list_head list; 843 850 struct metric_ref metric_ref; ··· 898 915 899 916 } 900 917 918 + static void expr_failure(const char *msg, const struct pmu_event *pe) 919 + { 920 + pr_debug("%s\nOn metric %s\nOn expression %s\n", msg, pe->metric_name, pe->metric_expr); 921 + } 922 + 923 + 924 + struct test__parsing_data { 925 + const struct pmu_event *cpus_table; 926 + struct expr_parse_ctx *ctx; 927 + int failures; 928 + }; 929 + 930 + static int test__parsing_callback(const struct pmu_event *pe, const struct pmu_event *table, 931 + void *vdata) 932 + { 933 + struct test__parsing_data *data = vdata; 934 + struct metric *metric, *tmp; 935 + struct hashmap_entry *cur; 936 + LIST_HEAD(compound_list); 937 + size_t bkt; 938 + int k; 939 + double result; 940 + 941 + if (!pe->metric_expr) 942 + return 0; 943 + 944 + pr_debug("Found metric '%s'\n", pe->metric_name); 945 + 946 + expr__ctx_clear(data->ctx); 947 + if (expr__find_ids(pe->metric_expr, NULL, data->ctx) < 0) { 948 + expr_failure("Parse find ids failed", pe); 949 + data->failures++; 950 + return 0; 951 + } 952 + 953 + if (resolve_metric_simple(data->ctx, &compound_list, table, 954 + pe->metric_name)) { 955 + expr_failure("Could not resolve metrics", pe); 956 + data->failures++; 957 + return TEST_FAIL; /* Don't tolerate errors due to severity */ 958 + } 959 + 960 + /* 961 + * Add all ids with a made up value. The value may trigger divide by 962 + * zero when subtracted and so try to make them unique. 963 + */ 964 + k = 1; 965 + hashmap__for_each_entry(data->ctx->ids, cur, bkt) 966 + expr__add_id_val(data->ctx, strdup(cur->key), k++); 967 + 968 + hashmap__for_each_entry(data->ctx->ids, cur, bkt) { 969 + if (check_parse_cpu(cur->key, table == data->cpus_table, pe)) 970 + data->failures++; 971 + } 972 + 973 + list_for_each_entry_safe(metric, tmp, &compound_list, list) { 974 + expr__add_ref(data->ctx, &metric->metric_ref); 975 + free(metric); 976 + } 977 + 978 + if (expr__parse(&result, data->ctx, pe->metric_expr)) { 979 + /* 980 + * Parsing failed, make numbers go from large to small which can 981 + * resolve divide by zero issues. 982 + */ 983 + k = 1024; 984 + hashmap__for_each_entry(data->ctx->ids, cur, bkt) 985 + expr__add_id_val(data->ctx, strdup(cur->key), k--); 986 + if (expr__parse(&result, data->ctx, pe->metric_expr)) { 987 + expr_failure("Parse failed", pe); 988 + data->failures++; 989 + } 990 + } 991 + return 0; 992 + } 993 + 901 994 static int test__parsing(struct test_suite *test __maybe_unused, 902 995 int subtest __maybe_unused) 903 996 { 904 - const struct pmu_event *cpus_table = pmu_events_table__find(); 905 - const struct pmu_event *pe; 906 - int i, j, k; 907 - int ret = 0; 908 - struct expr_parse_ctx *ctx; 909 - double result; 997 + struct test__parsing_data data = { 998 + .cpus_table = pmu_events_table__find(), 999 + .ctx = expr__ctx_new(), 1000 + .failures = 0, 1001 + }; 910 1002 911 - ctx = expr__ctx_new(); 912 - if (!ctx) { 1003 + if (!data.ctx) { 913 1004 pr_debug("expr__ctx_new failed"); 914 1005 return TEST_FAIL; 915 1006 } 916 - i = 0; 917 - for (;;) { 918 - const struct pmu_events_map *map = &pmu_events_map[i++]; 1007 + pmu_for_each_core_event(test__parsing_callback, &data); 1008 + pmu_for_each_sys_event(test__parsing_callback, &data); 919 1009 920 - if (!map->table) 921 - break; 922 - j = 0; 923 - for (;;) { 924 - struct metric *metric, *tmp; 925 - struct hashmap_entry *cur; 926 - LIST_HEAD(compound_list); 927 - size_t bkt; 928 - 929 - pe = &map->table[j++]; 930 - if (!pe->name && !pe->metric_group && !pe->metric_name) 931 - break; 932 - if (!pe->metric_expr) 933 - continue; 934 - expr__ctx_clear(ctx); 935 - if (expr__find_ids(pe->metric_expr, NULL, ctx) < 0) { 936 - expr_failure("Parse find ids failed", pe); 937 - ret++; 938 - continue; 939 - } 940 - 941 - if (resolve_metric_simple(ctx, &compound_list, map->table, 942 - pe->metric_name)) { 943 - expr_failure("Could not resolve metrics", pe); 944 - ret++; 945 - goto exit; /* Don't tolerate errors due to severity */ 946 - } 947 - 948 - /* 949 - * Add all ids with a made up value. The value may 950 - * trigger divide by zero when subtracted and so try to 951 - * make them unique. 952 - */ 953 - k = 1; 954 - hashmap__for_each_entry(ctx->ids, cur, bkt) 955 - expr__add_id_val(ctx, strdup(cur->key), k++); 956 - 957 - hashmap__for_each_entry(ctx->ids, cur, bkt) { 958 - if (check_parse_cpu(cur->key, map->table == cpus_table, 959 - pe)) 960 - ret++; 961 - } 962 - 963 - list_for_each_entry_safe(metric, tmp, &compound_list, list) { 964 - expr__add_ref(ctx, &metric->metric_ref); 965 - free(metric); 966 - } 967 - 968 - if (expr__parse(&result, ctx, pe->metric_expr)) { 969 - /* 970 - * Parsing failed, make numbers go from large to 971 - * small which can resolve divide by zero 972 - * issues. 973 - */ 974 - k = 1024; 975 - hashmap__for_each_entry(ctx->ids, cur, bkt) 976 - expr__add_id_val(ctx, strdup(cur->key), k--); 977 - if (expr__parse(&result, ctx, pe->metric_expr)) { 978 - expr_failure("Parse failed", pe); 979 - ret++; 980 - } 981 - } 982 - } 983 - } 984 - expr__ctx_free(ctx); 985 - /* TODO: fail when not ok */ 986 - exit: 987 - return ret == 0 ? TEST_OK : TEST_SKIP; 1010 + expr__ctx_free(data.ctx); 1011 + return data.failures == 0 ? TEST_OK : TEST_FAIL; 988 1012 } 989 1013 990 1014 struct test_metric { ··· 1063 1073 return ret; 1064 1074 } 1065 1075 1076 + static int test__parsing_fake_callback(const struct pmu_event *pe, 1077 + const struct pmu_event *table __maybe_unused, 1078 + void *data __maybe_unused) 1079 + { 1080 + if (!pe->metric_expr) 1081 + return 0; 1082 + 1083 + return metric_parse_fake(pe->metric_expr); 1084 + } 1085 + 1066 1086 /* 1067 1087 * Parse all the metrics for current architecture, 1068 1088 * or all defined cpus via the 'fake_pmu' ··· 1081 1081 static int test__parsing_fake(struct test_suite *test __maybe_unused, 1082 1082 int subtest __maybe_unused) 1083 1083 { 1084 - unsigned int i, j; 1085 1084 int err = 0; 1086 1085 1087 - for (i = 0; i < ARRAY_SIZE(metrics); i++) { 1086 + for (size_t i = 0; i < ARRAY_SIZE(metrics); i++) { 1088 1087 err = metric_parse_fake(metrics[i].str); 1089 1088 if (err) 1090 1089 return err; 1091 1090 } 1092 1091 1093 - i = 0; 1094 - for (;;) { 1095 - const struct pmu_events_map *map = &pmu_events_map[i++]; 1092 + err = pmu_for_each_core_event(test__parsing_fake_callback, NULL); 1093 + if (err) 1094 + return err; 1096 1095 1097 - if (!map->table) 1098 - break; 1099 - j = 0; 1100 - for (;;) { 1101 - const struct pmu_event *pe = &map->table[j++]; 1102 - 1103 - if (!pe->name && !pe->metric_group && !pe->metric_name) 1104 - break; 1105 - if (!pe->metric_expr) 1106 - continue; 1107 - pr_debug("Found metric '%s' for '%s'\n", pe->metric_name, map->cpuid); 1108 - err = metric_parse_fake(pe->metric_expr); 1109 - if (err) 1110 - return err; 1111 - } 1112 - } 1113 - 1114 - return 0; 1096 + return pmu_for_each_sys_event(test__parsing_fake_callback, NULL); 1115 1097 } 1116 1098 1117 1099 static struct test_case pmu_events_tests[] = {
+9 -6
tools/perf/util/metricgroup.c
··· 502 502 bool details; 503 503 }; 504 504 505 - typedef int (*metricgroup_sys_event_iter_fn)(const struct pmu_event *pe, void *); 506 - 507 505 struct metricgroup_iter_data { 508 - metricgroup_sys_event_iter_fn fn; 506 + pmu_event_iter_fn fn; 509 507 void *data; 510 508 }; 511 509 512 - static int metricgroup__sys_event_iter(const struct pmu_event *pe, void *data) 510 + static int metricgroup__sys_event_iter(const struct pmu_event *pe, 511 + const struct pmu_event *table __maybe_unused, 512 + void *data) 513 513 { 514 514 struct metricgroup_iter_data *d = data; 515 515 struct perf_pmu *pmu = NULL; ··· 522 522 if (!pmu->id || strcmp(pmu->id, pe->compat)) 523 523 continue; 524 524 525 - return d->fn(pe, d->data); 525 + return d->fn(pe, table, d->data); 526 526 } 527 527 528 528 return 0; 529 529 } 530 530 531 - static int metricgroup__print_sys_event_iter(const struct pmu_event *pe, void *data) 531 + static int metricgroup__print_sys_event_iter(const struct pmu_event *pe, 532 + const struct pmu_event *table __maybe_unused, 533 + void *data) 532 534 { 533 535 struct metricgroup_print_sys_idata *d = data; 534 536 ··· 1103 1101 } 1104 1102 1105 1103 static int metricgroup__add_metric_sys_event_iter(const struct pmu_event *pe, 1104 + const struct pmu_event *table __maybe_unused, 1106 1105 void *data) 1107 1106 { 1108 1107 struct metricgroup_add_iter_data *d = data;
+4 -30
tools/perf/util/pmu.c
··· 690 690 return file_available(path); 691 691 } 692 692 693 - static char *perf_pmu__getcpuid(struct perf_pmu *pmu) 693 + char *perf_pmu__getcpuid(struct perf_pmu *pmu) 694 694 { 695 695 char *cpuid; 696 696 static bool printed; ··· 708 708 printed = true; 709 709 } 710 710 return cpuid; 711 - } 712 - 713 - const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu) 714 - { 715 - const struct pmu_event *table = NULL; 716 - char *cpuid = perf_pmu__getcpuid(pmu); 717 - int i; 718 - 719 - /* on some platforms which uses cpus map, cpuid can be NULL for 720 - * PMUs other than CORE PMUs. 721 - */ 722 - if (!cpuid) 723 - return NULL; 724 - 725 - i = 0; 726 - for (;;) { 727 - const struct pmu_events_map *map = &pmu_events_map[i++]; 728 - 729 - if (!map->table) 730 - break; 731 - 732 - if (!strcmp_cpuid_str(map->cpuid, cpuid)) { 733 - table = map->table; 734 - break; 735 - } 736 - } 737 - free(cpuid); 738 - return table; 739 711 } 740 712 741 713 __weak const struct pmu_event *pmu_events_table__find(void) ··· 846 874 struct perf_pmu *pmu; 847 875 }; 848 876 849 - static int pmu_add_sys_aliases_iter_fn(const struct pmu_event *pe, void *data) 877 + static int pmu_add_sys_aliases_iter_fn(const struct pmu_event *pe, 878 + const struct pmu_event *table __maybe_unused, 879 + void *data) 850 880 { 851 881 struct pmu_sys_event_iter_data *idata = data; 852 882 struct perf_pmu *pmu = idata->pmu;
+1 -1
tools/perf/util/pmu.h
··· 128 128 void pmu_add_cpu_aliases_table(struct list_head *head, struct perf_pmu *pmu, 129 129 const struct pmu_event *table); 130 130 131 - const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu); 131 + char *perf_pmu__getcpuid(struct perf_pmu *pmu); 132 132 const struct pmu_event *pmu_events_table__find(void); 133 133 bool pmu_uncore_alias_match(const char *pmu_name, const char *name); 134 134 void perf_pmu_free_alias(struct perf_pmu_alias *alias);