All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 00/10] Better fixes for  grouping of events
@ 2023-03-02  4:12 Ian Rogers
  2023-03-02  4:12 ` [PATCH v1 01/10] libperf evlist: Avoid a use of evsel idx Ian Rogers
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: Ian Rogers @ 2023-03-02  4:12 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Kan Liang, Zhengjun Xing, Ravi Bangoria, Adrian Hunter,
	Steinar H. Gunderson, Qi Liu, Kim Phillips, Florian Fischer,
	James Clark, Suzuki Poulouse, Sean Christopherson, Leo Yan,
	John Garry, Kajol Jain, linux-perf-users, linux-kernel
  Cc: Stephane Eranian, Ian Rogers

The rules for grouping events has grown more complex. Topdown events
must be grouped, but flags like --metric-no-group and flags on metrics
don't respect this. Uncore events may be expanded using wild cards for
PMU names, but then the events need reordering so the group members
are adjacent. Rather than fixing metrics, this change fixes the main
event parsing code to first sort and then regroup evsels.

As this is shared functionality changes to it should cause
concern. The change is done with the intent of simplifying and making
more robust the grouping logic, examples are given. If additional
changes are necessary, they are most likely necessary to the
evsel__pmu_name logic as the code avoids breaking groups that are on
the same PMU. The pmu_name is tweaked in the case of software and aux
events, that use groups in a slightly different manner to conventional
events.

The code was manually tested as well as passing perf test on a Intel
tigerlake CPU with intel-pt.

Ian Rogers (10):
  libperf evlist: Avoid a use of evsel idx
  perf stat: Don't remove all grouped events when CPU maps disagree
  perf record: Early auxtrace initialization before event parsing
  perf stat: Modify the group test
  perf evsel: Limit in group test to CPUs
  perf evsel: Allow const evsel for certain accesses
  perf evsel: Add function to compute pmu_name
  perf parse-events: Pass ownership of the group name
  perf parse-events: Sort and group parsed events
  perf evsel: Remove use_uncore_alias

 tools/lib/perf/evlist.c             |  13 +-
 tools/perf/arch/x86/util/auxtrace.c |  17 +-
 tools/perf/arch/x86/util/evlist.c   |  39 ++---
 tools/perf/arch/x86/util/evsel.c    |   3 +
 tools/perf/builtin-record.c         |   6 +
 tools/perf/builtin-stat.c           |  24 ++-
 tools/perf/util/auxtrace.h          |   2 +
 tools/perf/util/evlist.h            |   2 +-
 tools/perf/util/evsel.c             |  27 ++-
 tools/perf/util/evsel.h             |   8 +-
 tools/perf/util/parse-events.c      | 253 +++++++++++++---------------
 tools/perf/util/parse-events.h      |   6 +-
 tools/perf/util/parse-events.y      |  17 +-
 tools/perf/util/pmu.c               |   6 +-
 tools/perf/util/python.c            |   2 +-
 tools/perf/util/stat-shadow.c       |   2 +-
 16 files changed, 228 insertions(+), 199 deletions(-)

-- 
2.39.2.722.g9855ee24e9-goog


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2023-03-02 20:29 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02  4:12 [PATCH v1 00/10] Better fixes for grouping of events Ian Rogers
2023-03-02  4:12 ` [PATCH v1 01/10] libperf evlist: Avoid a use of evsel idx Ian Rogers
2023-03-02 14:33   ` Arnaldo Carvalho de Melo
2023-03-02  4:12 ` [PATCH v1 02/10] perf stat: Don't remove all grouped events when CPU maps disagree Ian Rogers
2023-03-02 14:33   ` Arnaldo Carvalho de Melo
2023-03-02  4:12 ` [PATCH v1 03/10] perf record: Early auxtrace initialization before event parsing Ian Rogers
2023-03-02 14:32   ` Arnaldo Carvalho de Melo
2023-03-02 16:05     ` Ian Rogers
2023-03-02  4:12 ` [PATCH v1 04/10] perf stat: Modify the group test Ian Rogers
2023-03-02 14:34   ` Arnaldo Carvalho de Melo
2023-03-02 16:10     ` Ian Rogers
2023-03-02  4:12 ` [PATCH v1 05/10] perf evsel: Limit in group test to CPUs Ian Rogers
2023-03-02 14:35   ` Arnaldo Carvalho de Melo
2023-03-02 15:24   ` Liang, Kan
2023-03-02 19:38     ` Ian Rogers
2023-03-02 20:28       ` Liang, Kan
2023-03-02  4:12 ` [PATCH v1 06/10] perf evsel: Allow const evsel for certain accesses Ian Rogers
2023-03-02 14:36   ` Arnaldo Carvalho de Melo
2023-03-02  4:12 ` [PATCH v1 07/10] perf evsel: Add function to compute pmu_name Ian Rogers
2023-03-02 14:39   ` Arnaldo Carvalho de Melo
2023-03-02 16:13     ` Ian Rogers
2023-03-02  4:12 ` [PATCH v1 08/10] perf parse-events: Pass ownership of the group name Ian Rogers
2023-03-02 14:45   ` Arnaldo Carvalho de Melo
2023-03-02  4:12 ` [PATCH v1 09/10] perf parse-events: Sort and group parsed events Ian Rogers
2023-03-02 14:51   ` Arnaldo Carvalho de Melo
2023-03-02 17:20     ` Ian Rogers
2023-03-02  4:12 ` [PATCH v1 10/10] perf evsel: Remove use_uncore_alias Ian Rogers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.