Re: [PATCH v2 2/2] perf record: Add --synth option
From: Namhyung Kim
Date: Wed Aug 11 2021 - 00:34:36 EST
Hi Jiri,
On Mon, Jul 26, 2021 at 6:15 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>
> On Fri, Jul 23, 2021 at 09:01:29PM -0700, Namhyung Kim wrote:
> > Add an option to control synthesize behavior.
> >
> > --synth <no|all|task|mmap|cgroup>
> > Fine-tune event synthesis: default=all
> >
> > This can be useful when we know it doesn't need some synthesis like
> > in a specific usecase and/or when using pipe:
> >
> > $ perf record -a --all-cgroups --synth cgroup -o- sleep 1 | \
> > > perf report -i- -s cgroup
> >
> > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> > ---
> > tools/perf/Documentation/perf-record.txt | 9 +++++
> > tools/perf/builtin-record.c | 48 +++++++++++++++++++-----
> > tools/perf/util/record.h | 1 +
> > tools/perf/util/synthetic-events.c | 28 ++++++++++++++
> > tools/perf/util/synthetic-events.h | 12 ++++++
> > 5 files changed, 89 insertions(+), 9 deletions(-)
> >
> > diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
> > index d71bac847936..03a41bec0583 100644
> > --- a/tools/perf/Documentation/perf-record.txt
> > +++ b/tools/perf/Documentation/perf-record.txt
> > @@ -596,6 +596,15 @@ options.
> > 'perf record --dry-run -e' can act as a BPF script compiler if llvm.dump-obj
> > in config file is set to true.
> >
> > +--synth=TYPE::
> > +Collect and synthesize given type of events (comma separated).
> > +Available types are:
> > + 'task' - synthesize FORK and COMM events for each task
> > + 'mmap' - synthesize MMAP events for each process (implies 'task')
> > + 'cgroup' - synthesize CGROUP events for each cgroup
> > + 'all' - synthesize all events (default)
> > + 'no' - do not synthesize any of the above events
>
> this only affects events we take from proc right?
Right.
>
> should we perhaps mention it, because you'll get mmap
> events from kernel even if you specify --synth=task
Good point, will update.
Thanks,
Namhyung