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

Configure Feed

Select the types of activity you want to include in your feed.

perf pmu: Avoid passing format list to perf_pmu__format_type

Pass the pmu so the format list can be better abstracted and later
lazily loaded.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230823080828.1460376-7-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
7eb54733 804fee5d

+4 -4
+1 -1
tools/perf/util/parse-events.c
··· 1159 1159 list_for_each_entry(term, head_config, list) { 1160 1160 switch (term->type_term) { 1161 1161 case PARSE_EVENTS__TERM_TYPE_USER: 1162 - type = perf_pmu__format_type(&pmu->format, term->config); 1162 + type = perf_pmu__format_type(pmu, term->config); 1163 1163 if (type != PERF_PMU_FORMAT_VALUE_CONFIG) 1164 1164 continue; 1165 1165 bits |= perf_pmu__format_bits(&pmu->format, term->config);
+2 -2
tools/perf/util/pmu.c
··· 1038 1038 return bits; 1039 1039 } 1040 1040 1041 - int perf_pmu__format_type(struct list_head *formats, const char *name) 1041 + int perf_pmu__format_type(struct perf_pmu *pmu, const char *name) 1042 1042 { 1043 - struct perf_pmu_format *format = pmu_find_format(formats, name); 1043 + struct perf_pmu_format *format = pmu_find_format(&pmu->format, name); 1044 1044 1045 1045 if (!format) 1046 1046 return -1;
+1 -1
tools/perf/util/pmu.h
··· 222 222 struct list_head *head_terms, 223 223 bool zero, struct parse_events_error *error); 224 224 __u64 perf_pmu__format_bits(struct list_head *formats, const char *name); 225 - int perf_pmu__format_type(struct list_head *formats, const char *name); 225 + int perf_pmu__format_type(struct perf_pmu *pmu, const char *name); 226 226 int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms, 227 227 struct perf_pmu_info *info); 228 228 struct list_head *perf_pmu__alias(struct perf_pmu *pmu,