Commit 4000519e authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf pmu-events: Add extra underscore to function names

Add extra underscore before "for" of pmu_events_table_for_each_event
and pmu_metrics_table_for_each_metric.
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/20230824041330.266337-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c3245d20
...@@ -266,7 +266,7 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = { ...@@ -266,7 +266,7 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = {
}, },
}; };
int pmu_events_table_for_each_event(const struct pmu_events_table *table, pmu_event_iter_fn fn, int pmu_events_table__for_each_event(const struct pmu_events_table *table, pmu_event_iter_fn fn,
void *data) void *data)
{ {
for (const struct pmu_event *pe = &table->entries[0]; pe->name; pe++) { for (const struct pmu_event *pe = &table->entries[0]; pe->name; pe++) {
...@@ -278,7 +278,7 @@ int pmu_events_table_for_each_event(const struct pmu_events_table *table, pmu_ev ...@@ -278,7 +278,7 @@ int pmu_events_table_for_each_event(const struct pmu_events_table *table, pmu_ev
return 0; return 0;
} }
int pmu_metrics_table_for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn, int pmu_metrics_table__for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn,
void *data) void *data)
{ {
for (const struct pmu_metric *pm = &table->entries[0]; pm->metric_expr; pm++) { for (const struct pmu_metric *pm = &table->entries[0]; pm->metric_expr; pm++) {
...@@ -371,7 +371,7 @@ const struct pmu_metrics_table *find_core_metrics_table(const char *arch, const ...@@ -371,7 +371,7 @@ const struct pmu_metrics_table *find_core_metrics_table(const char *arch, const
int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data) int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data)
{ {
for (const struct pmu_events_map *tables = &pmu_events_map[0]; tables->arch; tables++) { for (const struct pmu_events_map *tables = &pmu_events_map[0]; tables->arch; tables++) {
int ret = pmu_events_table_for_each_event(&tables->event_table, fn, data); int ret = pmu_events_table__for_each_event(&tables->event_table, fn, data);
if (ret) if (ret)
return ret; return ret;
...@@ -384,7 +384,7 @@ int pmu_for_each_core_metric(pmu_metric_iter_fn fn, void *data) ...@@ -384,7 +384,7 @@ int pmu_for_each_core_metric(pmu_metric_iter_fn fn, void *data)
for (const struct pmu_events_map *tables = &pmu_events_map[0]; for (const struct pmu_events_map *tables = &pmu_events_map[0];
tables->arch; tables->arch;
tables++) { tables++) {
int ret = pmu_metrics_table_for_each_metric(&tables->metric_table, fn, data); int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data);
if (ret) if (ret)
return ret; return ret;
...@@ -408,7 +408,7 @@ int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data) ...@@ -408,7 +408,7 @@ int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data)
for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0]; for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
tables->name; tables->name;
tables++) { tables++) {
int ret = pmu_events_table_for_each_event(&tables->table, fn, data); int ret = pmu_events_table__for_each_event(&tables->table, fn, data);
if (ret) if (ret)
return ret; return ret;
......
...@@ -753,7 +753,7 @@ static void decompress_metric(int offset, struct pmu_metric *pm) ...@@ -753,7 +753,7 @@ static void decompress_metric(int offset, struct pmu_metric *pm)
_args.output_file.write('\twhile (*p++);') _args.output_file.write('\twhile (*p++);')
_args.output_file.write("""} _args.output_file.write("""}
int pmu_events_table_for_each_event(const struct pmu_events_table *table, int pmu_events_table__for_each_event(const struct pmu_events_table *table,
pmu_event_iter_fn fn, pmu_event_iter_fn fn,
void *data) void *data)
{ {
...@@ -771,7 +771,7 @@ int pmu_events_table_for_each_event(const struct pmu_events_table *table, ...@@ -771,7 +771,7 @@ int pmu_events_table_for_each_event(const struct pmu_events_table *table,
return 0; return 0;
} }
int pmu_metrics_table_for_each_metric(const struct pmu_metrics_table *table, int pmu_metrics_table__for_each_metric(const struct pmu_metrics_table *table,
pmu_metric_iter_fn fn, pmu_metric_iter_fn fn,
void *data) void *data)
{ {
...@@ -870,7 +870,7 @@ int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data) ...@@ -870,7 +870,7 @@ int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data)
for (const struct pmu_events_map *tables = &pmu_events_map[0]; for (const struct pmu_events_map *tables = &pmu_events_map[0];
tables->arch; tables->arch;
tables++) { tables++) {
int ret = pmu_events_table_for_each_event(&tables->event_table, fn, data); int ret = pmu_events_table__for_each_event(&tables->event_table, fn, data);
if (ret) if (ret)
return ret; return ret;
...@@ -883,7 +883,7 @@ int pmu_for_each_core_metric(pmu_metric_iter_fn fn, void *data) ...@@ -883,7 +883,7 @@ int pmu_for_each_core_metric(pmu_metric_iter_fn fn, void *data)
for (const struct pmu_events_map *tables = &pmu_events_map[0]; for (const struct pmu_events_map *tables = &pmu_events_map[0];
tables->arch; tables->arch;
tables++) { tables++) {
int ret = pmu_metrics_table_for_each_metric(&tables->metric_table, fn, data); int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data);
if (ret) if (ret)
return ret; return ret;
...@@ -907,7 +907,7 @@ int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data) ...@@ -907,7 +907,7 @@ int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data)
for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0]; for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
tables->name; tables->name;
tables++) { tables++) {
int ret = pmu_events_table_for_each_event(&tables->event_table, fn, data); int ret = pmu_events_table__for_each_event(&tables->event_table, fn, data);
if (ret) if (ret)
return ret; return ret;
...@@ -920,7 +920,7 @@ int pmu_for_each_sys_metric(pmu_metric_iter_fn fn, void *data) ...@@ -920,7 +920,7 @@ int pmu_for_each_sys_metric(pmu_metric_iter_fn fn, void *data)
for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0]; for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
tables->name; tables->name;
tables++) { tables++) {
int ret = pmu_metrics_table_for_each_metric(&tables->metric_table, fn, data); int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data);
if (ret) if (ret)
return ret; return ret;
......
...@@ -77,9 +77,9 @@ typedef int (*pmu_metric_iter_fn)(const struct pmu_metric *pm, ...@@ -77,9 +77,9 @@ typedef int (*pmu_metric_iter_fn)(const struct pmu_metric *pm,
const struct pmu_metrics_table *table, const struct pmu_metrics_table *table,
void *data); void *data);
int pmu_events_table_for_each_event(const struct pmu_events_table *table, pmu_event_iter_fn fn, int pmu_events_table__for_each_event(const struct pmu_events_table *table, pmu_event_iter_fn fn,
void *data); void *data);
int pmu_metrics_table_for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn, int pmu_metrics_table__for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn,
void *data); void *data);
const struct pmu_events_table *perf_pmu__find_events_table(struct perf_pmu *pmu); const struct pmu_events_table *perf_pmu__find_events_table(struct perf_pmu *pmu);
......
...@@ -477,12 +477,12 @@ static int test__pmu_event_table(struct test_suite *test __maybe_unused, ...@@ -477,12 +477,12 @@ static int test__pmu_event_table(struct test_suite *test __maybe_unused,
if (!table || !sys_event_table) if (!table || !sys_event_table)
return -1; return -1;
err = pmu_events_table_for_each_event(table, test__pmu_event_table_core_callback, err = pmu_events_table__for_each_event(table, test__pmu_event_table_core_callback,
&map_events); &map_events);
if (err) if (err)
return err; return err;
err = pmu_events_table_for_each_event(sys_event_table, test__pmu_event_table_sys_callback, err = pmu_events_table__for_each_event(sys_event_table, test__pmu_event_table_sys_callback,
&map_events); &map_events);
if (err) if (err)
return err; return err;
......
...@@ -527,7 +527,7 @@ void metricgroup__print(const struct print_callbacks *print_cb, void *print_stat ...@@ -527,7 +527,7 @@ void metricgroup__print(const struct print_callbacks *print_cb, void *print_stat
groups.node_delete = mep_delete; groups.node_delete = mep_delete;
table = pmu_metrics_table__find(); table = pmu_metrics_table__find();
if (table) { if (table) {
pmu_metrics_table_for_each_metric(table, pmu_metrics_table__for_each_metric(table,
metricgroup__add_to_mep_groups_callback, metricgroup__add_to_mep_groups_callback,
&groups); &groups);
} }
...@@ -1069,7 +1069,7 @@ static bool metricgroup__find_metric(const char *pmu, ...@@ -1069,7 +1069,7 @@ static bool metricgroup__find_metric(const char *pmu,
.pm = pm, .pm = pm,
}; };
return pmu_metrics_table_for_each_metric(table, metricgroup__find_metric_callback, &data) return pmu_metrics_table__for_each_metric(table, metricgroup__find_metric_callback, &data)
? true : false; ? true : false;
} }
...@@ -1255,7 +1255,7 @@ static int metricgroup__add_metric(const char *pmu, const char *metric_name, con ...@@ -1255,7 +1255,7 @@ static int metricgroup__add_metric(const char *pmu, const char *metric_name, con
* Iterate over all metrics seeing if metric matches either the * Iterate over all metrics seeing if metric matches either the
* name or group. When it does add the metric to the list. * name or group. When it does add the metric to the list.
*/ */
ret = pmu_metrics_table_for_each_metric(table, metricgroup__add_metric_callback, ret = pmu_metrics_table__for_each_metric(table, metricgroup__add_metric_callback,
&data); &data);
if (ret) if (ret)
goto out; goto out;
...@@ -1740,7 +1740,7 @@ bool metricgroup__has_metric(const char *pmu, const char *metric) ...@@ -1740,7 +1740,7 @@ bool metricgroup__has_metric(const char *pmu, const char *metric)
if (!table) if (!table)
return false; return false;
return pmu_metrics_table_for_each_metric(table, metricgroup__has_metric_callback, &data) return pmu_metrics_table__for_each_metric(table, metricgroup__has_metric_callback, &data)
? true : false; ? true : false;
} }
...@@ -1770,7 +1770,7 @@ unsigned int metricgroups__topdown_max_level(void) ...@@ -1770,7 +1770,7 @@ unsigned int metricgroups__topdown_max_level(void)
if (!table) if (!table)
return false; return false;
pmu_metrics_table_for_each_metric(table, metricgroup__topdown_max_level_callback, pmu_metrics_table__for_each_metric(table, metricgroup__topdown_max_level_callback,
&max_level); &max_level);
return max_level; return max_level;
} }
......
...@@ -896,7 +896,7 @@ void pmu_add_cpu_aliases_table(struct perf_pmu *pmu, const struct pmu_events_tab ...@@ -896,7 +896,7 @@ void pmu_add_cpu_aliases_table(struct perf_pmu *pmu, const struct pmu_events_tab
.pmu = pmu, .pmu = pmu,
}; };
pmu_events_table_for_each_event(table, pmu_add_cpu_aliases_map_callback, &data); pmu_events_table__for_each_event(table, pmu_add_cpu_aliases_map_callback, &data);
free(data.default_pmu_name); free(data.default_pmu_name);
} }
......
...@@ -168,7 +168,7 @@ static const char *get_counter_name(int set, int nr, const struct pmu_events_tab ...@@ -168,7 +168,7 @@ static const char *get_counter_name(int set, int nr, const struct pmu_events_tab
if (!table) if (!table)
return NULL; return NULL;
pmu_events_table_for_each_event(table, get_counter_name_callback, &data); pmu_events_table__for_each_event(table, get_counter_name_callback, &data);
return data.result; return data.result;
} }
......
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