lkml.org 
[lkml]   [2021]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 21/21] perf metric: Allow modifiers on metrics.
Em Tue, Oct 19, 2021 at 12:13:52PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Oct 19, 2021 at 12:06:17PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Fri, Oct 15, 2021 at 10:21:32AM -0700, Ian Rogers escreveu:
> > > By allowing modifiers on metrics we can, for example, gather the
> > > same metric for kernel and user mode. On a SkylakeX with
> > > TopDownL1 this gives:
> > >
> > > $ perf stat -M TopDownL1:u,TopDownL1:k -a sleep 2
> > >
> > > Performance counter stats for 'system wide':
> >
> > Hi Ian, can you please take a look on this? this is on my perf/core
> > branch.
>
> I processed the first version of this series, reviewed by Andi, can you
> please submit the diff from one to the other?

The interdiff from the 21st patch on the first batch versus on the v2
batch is below, but it doesn't apply to my current perf/core branch,
lemme push it to tmp.perf/core...

- Arnaldo

⬢[acme@toolbox perf]$ interdiff ~/wb/old.patch ~/wb/new.patch
diff -u b/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
--- b/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -1308,8 +1308,7 @@
int ret;

*out_evlist = NULL;
- ret = metricgroup__build_event_string(&events, ids, modifier,
- has_constraint);
+ ret = metricgroup__build_event_string(&events, ids, has_constraint);
if (ret)
return ret;

@@ -1324,7 +1323,8 @@

ids__insert(ids->ids, tmp);
}
- ret = metricgroup__build_event_string(&events, ids, has_constraint);
+ ret = metricgroup__build_event_string(&events, ids, modifier,
+ has_constraint);
if (ret)
return ret;

@@ -1568,7 +1568,10 @@
return -ENOMEM;

new_expr->metric_expr = old_expr->metric_expr;
- new_expr->metric_name = old_expr->metric_name;
+ new_expr->metric_name = strdup(old_expr->metric_name);
+ if (!new_expr->metric_name)
+ return -ENOMEM;
+
new_expr->metric_unit = old_expr->metric_unit;
new_expr->runtime = old_expr->runtime;

⬢[acme@toolbox perf]$
\
 
 \ /
  Last update: 2021-10-19 17:17    [W:1.157 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site