perf dlfilter: Add dlfilter-show-cycles
Adrian Hunter
reviewerPATCH 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
@@ -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
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.
Adrian Hunter
reviewerQuoted 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.
Arnaldo Carvalho de Melo
maintainerEm 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