Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-28 Thread Jiri Olsa
On Mon, Sep 28, 2020 at 08:54:04AM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Sep 25, 2020 at 03:51:33PM +0200, Jiri Olsa escreveu: > > On Fri, Sep 25, 2020 at 10:44:53PM +0900, Namhyung Kim wrote: > > > On Fri, Sep 25, 2020 at 10:26 PM Jiri Olsa wrote: > > > > On Thu, Sep 24, 2020 at

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-28 Thread Arnaldo Carvalho de Melo
Em Thu, Sep 24, 2020 at 09:44:53PM +0900, Namhyung Kim escreveu: > The metricgroup__copy_metric_events() is to handle metrics events when > expanding event for cgroups. As the metric events keep pointers to > evsel, it should be refreshed when events are cloned during the > operation. > > The

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-28 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 25, 2020 at 03:51:33PM +0200, Jiri Olsa escreveu: > On Fri, Sep 25, 2020 at 10:44:53PM +0900, Namhyung Kim wrote: > > On Fri, Sep 25, 2020 at 10:26 PM Jiri Olsa wrote: > > > On Thu, Sep 24, 2020 at 09:44:53PM +0900, Namhyung Kim wrote: > > No actually, I still think perf record should

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-25 Thread Jiri Olsa
On Fri, Sep 25, 2020 at 10:44:53PM +0900, Namhyung Kim wrote: > On Fri, Sep 25, 2020 at 10:26 PM Jiri Olsa wrote: > > > > On Thu, Sep 24, 2020 at 09:44:53PM +0900, Namhyung Kim wrote: > > > > SNIP > > > > > > > > + if (metric_events) { > > > + orig_metric_events = *metric_events;

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-25 Thread Namhyung Kim
On Fri, Sep 25, 2020 at 10:26 PM Jiri Olsa wrote: > > On Thu, Sep 24, 2020 at 09:44:53PM +0900, Namhyung Kim wrote: > > SNIP > > > > > + if (metric_events) { > > + orig_metric_events = *metric_events; > > + rblist__init(metric_events); > > + } else { > > +

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-25 Thread Jiri Olsa
On Thu, Sep 24, 2020 at 09:44:53PM +0900, Namhyung Kim wrote: SNIP > > + if (metric_events) { > + orig_metric_events = *metric_events; > + rblist__init(metric_events); > + } else { > + rblist__init(_metric_events); > + } > + > for (;;) { >

[PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-24 Thread Namhyung Kim
The metricgroup__copy_metric_events() is to handle metrics events when expanding event for cgroups. As the metric events keep pointers to evsel, it should be refreshed when events are cloned during the operation. The perf_stat__collect_metric_expr() is also called in case an event has a metric

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-23 Thread Namhyung Kim
On Wed, Sep 23, 2020 at 7:23 PM Jiri Olsa wrote: > > On Wed, Sep 23, 2020 at 10:59:43AM +0900, Namhyung Kim wrote: > > SNIP > > > > diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c > > index 8b6a4fa49082..dcd18ef268a1 100644 > > --- a/tools/perf/util/cgroup.c > > +++

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-23 Thread Jiri Olsa
On Wed, Sep 23, 2020 at 10:59:43AM +0900, Namhyung Kim wrote: SNIP > diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c > index 8b6a4fa49082..dcd18ef268a1 100644 > --- a/tools/perf/util/cgroup.c > +++ b/tools/perf/util/cgroup.c > @@ -3,6 +3,9 @@ > #include "evsel.h" > #include

[PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-22 Thread Namhyung Kim
The metricgroup__copy_metric_events() is to handle metrics events when expanding event for cgroups. As the metric events keep pointers to evsel, it should be refreshed when events are cloned during the operation. The perf_stat__collect_metric_expr() is also called in case an event has a metric

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-22 Thread Namhyung Kim
On Wed, Sep 23, 2020 at 6:29 AM Jiri Olsa wrote: > > On Mon, Sep 21, 2020 at 06:46:08PM +0900, Namhyung Kim wrote: > > SNIP > > > @@ -260,6 +267,11 @@ int evlist__expand_cgroup(struct evlist *evlist, const > > char *str) > > cgroup__put(cgrp); > > nr_cgroups++; > > >

Re: [PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-22 Thread Jiri Olsa
On Mon, Sep 21, 2020 at 06:46:08PM +0900, Namhyung Kim wrote: SNIP > @@ -260,6 +267,11 @@ int evlist__expand_cgroup(struct evlist *evlist, const > char *str) > cgroup__put(cgrp); > nr_cgroups++; > > + perf_stat__collect_metric_expr(tmp_list); > +

[PATCH 3/5] perf tools: Copy metric events properly when expand cgroups

2020-09-21 Thread Namhyung Kim
The metricgroup__copy_metric_events() is to handle metrics events when expanding event for cgroups. As the metric events keep pointers to evsel, it should be refreshed when events are cloned during the operation. The perf_stat__collect_metric_expr() is also called in case an event has a metric