Re: [PATCH v2 2/2] perf stat: Support regex pattern in --for-each-cgroup
From: Namhyung Kim
Date: Tue Oct 27 2020 - 01:00:47 EST
Hi Arnaldo,
On Tue, Oct 27, 2020 at 2:53 AM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> Em Mon, Oct 26, 2020 at 09:32:34PM +0900, Namhyung Kim escreveu:
> > Hi Jiri,
> >
> > On Mon, Oct 26, 2020 at 8:40 PM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> > > also perhaps we want to warn if there's no match found:
> > >
> > > $ sudo ./perf stat -a -e cpu-clock,cycles --for-each-cgroup ^foo sleep 1
> > >
> > > Performance counter stats for 'system wide':
> > >
> > >
> > > 1.002375575 seconds time elapsed
> > >
> >
> > Right, will check this case.
>
> Hum, I thought that could be done on top of this one, but then, the
> ambiguity of:
>
> 1. No samples for a cgroups matching that expression
>
> 2. No cgroups match that expression
>
> Is real and warrants a warning for the 'no cgroups match the
> --for-each-group regexp' case.
The 1 will be handled by perf stat showing <not counted> and
I'll add a warning for the item 2 like below:
# perf stat -a -e cycles --for-each-cgroup ^foo sleep 1
no cgroup matched: ^foo
Usage: perf stat [<options>] [<command>]
--for-each-cgroup <name>
expand events for each cgroup
Thanks
Namhyung