lkml.org 
[lkml]   [2020]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/13] perf tools: Factor out parse_groups function
    Date
    Factor out the parse_groups function, it will be used
    for new test interface coming in following changes.

    Signed-off-by: Jiri Olsa <jolsa@kernel.org>
    ---
    tools/perf/util/metricgroup.c | 22 ++++++++++++++++------
    1 file changed, 16 insertions(+), 6 deletions(-)

    diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
    index 9a90afb4428c..47afe5867f9b 100644
    --- a/tools/perf/util/metricgroup.c
    +++ b/tools/perf/util/metricgroup.c
    @@ -709,14 +709,12 @@ static void metricgroup__free_egroups(struct list_head *group_list)
    }
    }

    -int metricgroup__parse_groups(const struct option *opt,
    - const char *str,
    - bool metric_no_group,
    - bool metric_no_merge,
    - struct rblist *metric_events)
    +static int parse_groups(struct evlist *perf_evlist, const char *str,
    + bool metric_no_group,
    + bool metric_no_merge,
    + struct rblist *metric_events)
    {
    struct parse_events_error parse_error;
    - struct evlist *perf_evlist = *(struct evlist **)opt->value;
    struct strbuf extra_events;
    LIST_HEAD(group_list);
    int ret;
    @@ -742,6 +740,18 @@ int metricgroup__parse_groups(const struct option *opt,
    return ret;
    }

    +int metricgroup__parse_groups(const struct option *opt,
    + const char *str,
    + bool metric_no_group,
    + bool metric_no_merge,
    + struct rblist *metric_events)
    +{
    + struct evlist *perf_evlist = *(struct evlist **)opt->value;
    +
    + return parse_groups(perf_evlist, str, metric_no_group,
    + metric_no_merge, metric_events);
    +}
    +
    bool metricgroup__has_metric(const char *metric)
    {
    struct pmu_events_map *map = perf_pmu__find_map(NULL);
    --
    2.25.4
    \
     
     \ /
      Last update: 2020-06-02 13:54    [W:2.821 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site