lkml.org 
[lkml]   [2021]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 1/6] perf metricgroup: Make find_metric() public with name change
    Date
    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".

    Tested-by: Paul A. Clarke <pc@us.ibm.com>
    Signed-off-by: John Garry <john.garry@huawei.com>
    Reviewed-by: Kajol Jain <kjain@linux.ibm.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..37fe34a5d93d 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 *metricgroup__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 = metricgroup__find_metric(cur->key, map);
    if (!pe)
    continue;

    diff --git a/tools/perf/util/metricgroup.h b/tools/perf/util/metricgroup.h
    index ed1b9392e624..1424e7c1af77 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 *metricgroup__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
    \
     
     \ /
      Last update: 2021-04-07 12:39    [W:3.821 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site