linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch v2 0/5] Bug fixes on topdown events reordering
@ 2024-07-08 14:41 Dapeng Mi
  2024-07-08 14:42 ` [Patch v2 1/5] perf x86/topdown: Complete topdown slots/metrics events check Dapeng Mi
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Dapeng Mi @ 2024-07-08 14:41 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Ian Rogers, Adrian Hunter, Alexander Shishkin,
	Kan Liang
  Cc: linux-perf-users, linux-kernel, Yongwei Ma, Dapeng Mi, Dapeng Mi

Changes:
v1 -> v2"
  * Use event/umask code instead of event name to indentify if an event
    is a topdown slots/metric event (patch 1/5).
  * Add perf tests to validate topdown events reordering including raw
    format topdown events (patch 5/5).
  * Drop the v1 patch 3/4 which doesn't move slots event if no topdown
    metrics event in group.

Currently whether an event is a topdown slots/metric event is only
identified by comparing event name. It's inaccurate since topdown events
can be assigned by raw format and the event name is null in this case,
e.g.

perf stat -e '{instructions,cpu/r400/,cpu/r8300/}' sleep 1

 Performance counter stats for 'sleep 1':

     <not counted>      instructions
     <not counted>      cpu/r400/
   <not supported>      cpu/r8300/

       1.002917796 seconds time elapsed

       0.002955000 seconds user
       0.000000000 seconds sys

In this case slots and topdown-be-bound events are assigned by raw
format (slots:r400, topdown-be-bound:r8300) and they are not reordered
correctly.

The reason of dropping the patch "don't move slots event if no topdown
metric events in group" is that no any function issues but a warning is
introduced, and the cost of fixing this issue is expensive.

History:
  v1: https://lore.kernel.org/all/20240702224037.343958-1-dapeng1.mi@linux.intel.com/

Dapeng Mi (5):
  perf x86/topdown: Complete topdown slots/metrics events check
  perf x86/topdown: Correct leader selection with sample_read enabled
  perf x86/topdown: Don't move topdown metrics events when sorting
    events
  perf tests: Add leader sampling test in record tests
  perf tests: Add topdown events counting and sampling tests

 tools/perf/arch/x86/util/evlist.c  |  9 ++---
 tools/perf/arch/x86/util/evsel.c   |  3 +-
 tools/perf/arch/x86/util/topdown.c | 57 ++++++++++++++++++++++++++++--
 tools/perf/arch/x86/util/topdown.h |  2 ++
 tools/perf/tests/shell/record.sh   | 34 ++++++++++++++++++
 tools/perf/tests/shell/stat.sh     |  6 ++++
 6 files changed, 101 insertions(+), 10 deletions(-)


base-commit: 73e931504f8e0d42978bfcda37b323dbbd1afc08
-- 
2.40.1


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

end of thread, other threads:[~2024-07-11  4:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08 14:41 [Patch v2 0/5] Bug fixes on topdown events reordering Dapeng Mi
2024-07-08 14:42 ` [Patch v2 1/5] perf x86/topdown: Complete topdown slots/metrics events check Dapeng Mi
2024-07-08 13:28   ` Liang, Kan
2024-07-09  1:58     ` Mi, Dapeng
2024-07-08 14:42 ` [Patch v2 2/5] perf x86/topdown: Correct leader selection with sample_read enabled Dapeng Mi
2024-07-08 14:42 ` [Patch v2 3/5] perf x86/topdown: Don't move topdown metrics events when sorting events Dapeng Mi
2024-07-08 15:08   ` Ian Rogers
2024-07-09  4:17     ` Mi, Dapeng
2024-07-09 22:37       ` Ian Rogers
2024-07-10  9:40         ` Mi, Dapeng
2024-07-10 15:07           ` Ian Rogers
2024-07-11  4:48             ` Mi, Dapeng
2024-07-08 14:42 ` [Patch v2 4/5] perf tests: Add leader sampling test in record tests Dapeng Mi
2024-07-08 14:42 ` [Patch v2 5/5] perf tests: Add topdown events counting and sampling tests Dapeng Mi
2024-07-08 13:40   ` Liang, Kan
2024-07-09  5:27     ` Mi, Dapeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).