Commit 7eb54733 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

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: default avatarIan 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 804fee5d
...@@ -1159,7 +1159,7 @@ static int get_config_chgs(struct perf_pmu *pmu, struct list_head *head_config, ...@@ -1159,7 +1159,7 @@ static int get_config_chgs(struct perf_pmu *pmu, struct list_head *head_config,
list_for_each_entry(term, head_config, list) { list_for_each_entry(term, head_config, list) {
switch (term->type_term) { switch (term->type_term) {
case PARSE_EVENTS__TERM_TYPE_USER: case PARSE_EVENTS__TERM_TYPE_USER:
type = perf_pmu__format_type(&pmu->format, term->config); type = perf_pmu__format_type(pmu, term->config);
if (type != PERF_PMU_FORMAT_VALUE_CONFIG) if (type != PERF_PMU_FORMAT_VALUE_CONFIG)
continue; continue;
bits |= perf_pmu__format_bits(&pmu->format, term->config); bits |= perf_pmu__format_bits(&pmu->format, term->config);
......
...@@ -1038,9 +1038,9 @@ __u64 perf_pmu__format_bits(struct list_head *formats, const char *name) ...@@ -1038,9 +1038,9 @@ __u64 perf_pmu__format_bits(struct list_head *formats, const char *name)
return bits; return bits;
} }
int perf_pmu__format_type(struct list_head *formats, const char *name) int perf_pmu__format_type(struct perf_pmu *pmu, const char *name)
{ {
struct perf_pmu_format *format = pmu_find_format(formats, name); struct perf_pmu_format *format = pmu_find_format(&pmu->format, name);
if (!format) if (!format)
return -1; return -1;
......
...@@ -222,7 +222,7 @@ int perf_pmu__config_terms(struct perf_pmu *pmu, ...@@ -222,7 +222,7 @@ int perf_pmu__config_terms(struct perf_pmu *pmu,
struct list_head *head_terms, struct list_head *head_terms,
bool zero, struct parse_events_error *error); bool zero, struct parse_events_error *error);
__u64 perf_pmu__format_bits(struct list_head *formats, const char *name); __u64 perf_pmu__format_bits(struct list_head *formats, const char *name);
int perf_pmu__format_type(struct list_head *formats, const char *name); int perf_pmu__format_type(struct perf_pmu *pmu, const char *name);
int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms, int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms,
struct perf_pmu_info *info); struct perf_pmu_info *info);
struct list_head *perf_pmu__alias(struct perf_pmu *pmu, struct list_head *perf_pmu__alias(struct perf_pmu *pmu,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment