[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e5fc65ef-b146-e677-43de-42482c755441@linux.ibm.com>
Date: Wed, 7 Apr 2021 11:09:03 +0530
From: kajoljain <kjain@...ux.ibm.com>
To: John Garry <john.garry@...wei.com>, Ian Rogers <irogers@...gle.com>
Cc: Will Deacon <will@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>, linuxarm@...wei.com,
"Liang, Kan" <kan.liang@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
zhangshaokun@...ilicon.com, Paul Clarke <pc@...ibm.com>
Subject: Re: [PATCH v2 1/6] perf metricgroup: Make find_metric() public with
name change
On 4/6/21 3:24 PM, John Garry wrote:
> On 02/04/2021 00:16, Ian Rogers wrote:
>> On Thu, Mar 25, 2021 at 3:38 AM John Garry <john.garry@...wei.com> wrote:
>>>
>>> Function find_metric() is required for the metric processing in the
>>> pmu-events testcase, so make it public. Also change the name to include
>>> "metricgroup".
>>
>> Would it make more sense as "pmu_events_map__find_metric" ?
>>
>
> So all functions apart from one in metricgroup.h are named metricgroup__XXX, so I was trying to keep this style - apart from the double-underscore (which can be remedied).
>
> Personally I don't think pmu_events_map__find_metric name fits with that convention.
I agree, most of the functions in metricgroup.c named as metricgroup__xxx. May be something like metricgroup__find_metric will be better.
Thanks,
Kajol Jain
>
> Thanks,
> John
>
>> Thanks,
>> Ian
>>
>>> Signed-off-by: John Garry <john.garry@...wei.com>
>>> ---
>>> tools/perf/util/metricgroup.c | 5 +++--
>>> tools/perf/util/metricgroup.h | 3 ++-
>>> 2 files changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
>>> index 6acb44ad439b..71a13406e0bd 100644
>>> --- a/tools/perf/util/metricgroup.c
>>> +++ b/tools/perf/util/metricgroup.c
>>> @@ -900,7 +900,8 @@ static int __add_metric(struct list_head *metric_list,
>>> (match_metric(__pe->metric_group, __metric) || \
>>> match_metric(__pe->metric_name, __metric)))
>>>
>>> -static struct pmu_event *find_metric(const char *metric, struct pmu_events_map *map)
>>> +struct pmu_event *metrcgroup_find_metric(const char *metric,
>>> + struct pmu_events_map *map)
>>> {
>>> struct pmu_event *pe;
>>> int i;
>>> @@ -985,7 +986,7 @@ static int __resolve_metric(struct metric *m,
>>> struct expr_id *parent;
>>> struct pmu_event *pe;
>>>
>>> - pe = find_metric(cur->key, map);
>>> + pe = metrcgroup_find_metric(cur->key, map);
>>> if (!pe)
>>> continue;
>>>
>>> diff --git a/tools/perf/util/metricgroup.h b/tools/perf/util/metricgroup.h
>>> index ed1b9392e624..1674c6a36d74 100644
>>> --- a/tools/perf/util/metricgroup.h
>>> +++ b/tools/perf/util/metricgroup.h
>>> @@ -44,7 +44,8 @@ int metricgroup__parse_groups(const struct option *opt,
>>> bool metric_no_group,
>>> bool metric_no_merge,
>>> struct rblist *metric_events);
>>> -
>>> +struct pmu_event *metrcgroup_find_metric(const char *metric,
>>> + struct pmu_events_map *map);
>>> int metricgroup__parse_groups_test(struct evlist *evlist,
>>> struct pmu_events_map *map,
>>> const char *str,
>>> --
>>> 2.26.2
>>>
>> .
>>
>
Powered by blists - more mailing lists