[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXNFpDGJtESvYy=JF8snPyYrUVZ0m_G3XajXqqS_XLbHg@mail.gmail.com>
Date: Fri, 30 Jun 2023 10:22:16 -0700
From: Ian Rogers <irogers@...gle.com>
To: John Garry <john.g.garry@...cle.com>
Cc: acme@...nel.org, namhyung@...nel.org, jolsa@...nel.org,
linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
renyu.zj@...ux.alibaba.com, shangxiaojing@...wei.com,
zhangshaokun@...ilicon.com, qiangqing.zhang@....com,
kjain@...ux.ibm.com, kan.liang@...ux.intel.com
Subject: Re: [PATCH RFC 1/9] perf metrics: Delete metricgroup_add_iter_data.table
On Wed, Jun 28, 2023 at 3:30 AM John Garry <john.g.garry@...cle.com> wrote:
>
> Member metricgroup_add_iter_data.table is only used in
> metricgroup__add_metric_sys_event_iter() as the @table arg to the
> add_metric() call there.
>
> However we only use the @table arg in add_metric() for resolving metrics,
> which is currently not relevant to sys event metrics. As such, don't
> bother passing this @table arg and use iter table instead, which is more
> sane.
>
> Signed-off-by: John Garry <john.g.garry@...cle.com>
Acked-by: Ian Rogers <irogers@...gle.com>
Thanks,
Ian
> ---
> tools/perf/util/metricgroup.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
> index a6a5ed44a679..4389ccd29fe7 100644
> --- a/tools/perf/util/metricgroup.c
> +++ b/tools/perf/util/metricgroup.c
> @@ -798,7 +798,6 @@ struct metricgroup_add_iter_data {
> bool system_wide;
> struct metric *root_metric;
> const struct visited_metric *visited;
> - const struct pmu_metrics_table *table;
> };
>
> static bool metricgroup__find_metric(const char *pmu,
> @@ -1112,7 +1111,7 @@ static int add_metric(struct list_head *metric_list,
> }
>
> static int metricgroup__add_metric_sys_event_iter(const struct pmu_metric *pm,
> - const struct pmu_metrics_table *table __maybe_unused,
> + const struct pmu_metrics_table *table,
> void *data)
> {
> struct metricgroup_add_iter_data *d = data;
> @@ -1123,7 +1122,7 @@ static int metricgroup__add_metric_sys_event_iter(const struct pmu_metric *pm,
>
> ret = add_metric(d->metric_list, pm, d->modifier, d->metric_no_group,
> d->metric_no_threshold, d->user_requested_cpu_list,
> - d->system_wide, d->root_metric, d->visited, d->table);
> + d->system_wide, d->root_metric, d->visited, table);
> if (ret)
> goto out;
>
> @@ -1275,7 +1274,6 @@ static int metricgroup__add_metric(const char *pmu, const char *metric_name, con
> .system_wide = system_wide,
> .has_match = &has_match,
> .ret = &ret,
> - .table = table,
> },
> };
>
> --
> 2.35.3
>
Powered by blists - more mailing lists