lkml.org 
[lkml]   [2020]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/7] perf metricgroup: Remove duped metric group events
On Wed, May 20, 2020 at 12:28:12AM -0700, Ian Rogers wrote:

SNIP

>
> @@ -157,7 +183,7 @@ static int metricgroup__setup_events(struct list_head *groups,
> int i = 0;
> int ret = 0;
> struct egroup *eg;
> - struct evsel *evsel;
> + struct evsel *evsel, *tmp;
> unsigned long *evlist_used;
>
> evlist_used = bitmap_alloc(perf_evlist->core.nr_entries);
> @@ -173,7 +199,8 @@ static int metricgroup__setup_events(struct list_head *groups,
> ret = -ENOMEM;
> break;
> }
> - evsel = find_evsel_group(perf_evlist, &eg->pctx, metric_events,
> + evsel = find_evsel_group(perf_evlist, &eg->pctx,
> + eg->has_constraint, metric_events,
> evlist_used);
> if (!evsel) {
> pr_debug("Cannot resolve %s: %s\n",
> @@ -200,6 +227,12 @@ static int metricgroup__setup_events(struct list_head *groups,
> list_add(&expr->nd, &me->head);
> }
>
> + evlist__for_each_entry_safe(perf_evlist, tmp, evsel) {
> + if (!test_bit(evsel->idx, evlist_used)) {
> + evlist__remove(perf_evlist, evsel);
> + evsel__delete(evsel);
> + }

is the groupping still enabled when we merge groups? could part
of the metric (events) be now computed in different groups?

I was wondering if we could merge all the hasmaps into single
one before the parse the evlist.. this way we won't need removing
later.. but I did not thought this through completely, so it
might not work at some point

jirka

\
 
 \ /
  Last update: 2020-05-20 15:50    [W:0.084 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site