Skip to contentSkip to conversation

perf dlfilter: Add dlfilter-show-cycles

PATCH Superseded Adrian Hunter 3 participants 4 messages Sep 6, 2021 – Sep 8, 2021 perf events

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

PATCH 1/1 perf dlfilter: Add dlfilter-show-cycles

Add a new dlfilter to show cycles.

Cycle counts are accumulated per CPU (or per thread if CPU is not recorded) from IPC information, and printed together with the change since the last print, at the start of each line.

---
 tools/perf/Makefile.perf                    |   2 +-
 tools/perf/dlfilters/dlfilter-show-cycles.c | 107 ++++++++++++++++++++
 2 files changed, 108 insertions(+), 1 deletion(-)
 create mode 100644 tools/perf/dlfilters/dlfilter-show-cycles.c
tools/perf/Makefile.perf +1 -1
index e04313c4d840..6b2c8b46ea80 100644
@@ -360,7 +360,7 @@ ifndef NO_JVMTI
 PROGRAMS += $(OUTPUT)$(LIBJVMTI)
 endif
 
-DLFILTERS := dlfilter-test-api-v0.so
+DLFILTERS := dlfilter-test-api-v0.so dlfilter-show-cycles.so
 DLFILTERS := $(patsubst %,$(OUTPUT)dlfilters/%,$(DLFILTERS))
 
 # what 'all' will build and 'install' will install, in perfexecdir
tools/perf/dlfilters/dlfilter-show-cycles.c new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Adrian Hunter

Add a new dlfilter to show cycles.

Cycle counts are accumulated per CPU (or per thread if CPU is not recorded) from IPC information, and printed together with the change since the last print, at the start of each line.

Thanks! An example how to use it would be nice (but maybe Arnaldo will just add that with his usual testing comment). And I guess the linear search could be a problem at some point, but I guess it's good enough for now.

author reviewer
#2 lore raw
Quoted 10 lines · Andi Kleen
Quoted 5 lines · Adrian Hunter

Add a new dlfilter to show cycles.

Cycle counts are accumulated per CPU (or per thread if CPU is not recorded) from IPC information, and printed together with the change since the last print, at the start of each line.

Thanks! An example how to use it would be nice

I started looking at making an example and noticed that this approach does not work very well because the IPC cycle count only increases when the IPC is output which (for CYC accurate mode) is only happens when a CYC packet is output that corresponds to the current sample. Seems like this needs a re-think, sorry.

#3 lore raw

Em Tue, Sep 07, 2021 at 10:06:03AM +0300, Adrian Hunter escreveu:

Quoted 8 lines · Andi Kleen
Quoted 6 lines · Adrian Hunter
Quoted 5 lines

Add a new dlfilter to show cycles.

Cycle counts are accumulated per CPU (or per thread if CPU is not recorded) from IPC information, and printed together with the change since the last print, at the start of each line.

Quoted 7 lines
Quoted 1 line

Thanks! An example how to use it would be nice

I started looking at making an example and noticed that this approach does not work very well because the IPC cycle count only increases when the IPC is output which (for CYC accurate mode) is only happens when a CYC packet is output that corresponds to the current sample. Seems like this needs a re-think, sorry.

Ok, will wait then. And this shows part of the value of this, checking if it works as expected :-)

- Arnaldo