Re: [PATCH] perf, tools, script: Allow adding and removing fields

Andi Kleen
2017-06-11T19:06:35Z

On Fri, Jun 09, 2017 at 11:13:11AM +0200, Milian Wolff wrote:
> > > But I cannot do:
> > >
> > > $ perf record -e "topdown-*" ls
> > > event syntax error: 'topdown-*'
> >
> > That's actually good because the current topdown events are not useful to
> > sample
>
> Can you elaborate? I assume it's because you actually want to sample on
> instructions, and then group it together with the topdown events and
> potentially other counters like instructions?

The topdown-* events are inputs to a formula. But you cannot directly
sample for the formula.

What you can do is to compute the formuals from counts, determine
the bottlenecks and then sample for events which look for the
bottlebeck. For example FRONTEND_* for Frontend Bound.
These events are generally different.

toplev in pmu-tools implements this automatically, but it's a bit
too complicated for standard perf.

>
> > Usually you need to have at least some idea about the events you're
> > collecting, and also for non trivial collections you need groups to get
> > good results.
>
> Yes, sure. But replace `record` with `stat` in the above and my point still
> stands

The comment was for stat.

-Andi