Can perf-stat results be generated from perf.data?

When I want to generate performance reports using perf-stat and perf-report from the Linux perf toolkit, I run:

$ perf record -o my.perf.data myCmd $ perf report -i my.perf.data 

and

 $ perf stat myCmd 

But that means that I run 'myCmd' a second time, which takes a few minutes. Instead, I was hoping:

 $ perf stat -i my.perf.data 

But unlike most tools in the primary set, I don't see the -i option for perf-stat. Is there another tool for this or a way to get initial reporting to create similar information for perf-stat?

+6
source share
1 answer

I burst into the source code on kernel.org, and there seems to be no way to get perf stat for analysis perf.data p>

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-stat.c;h=c70d72003557f17f29345b0f219dc5ca9f572d75;hb=refs /heads/linux-2.6.33.y

If you look at line 245, you will see the "run_perf_stat" function, and lines around 308-320 are likely to be what they actually write and map.

I did not complicate it so much as to determine whether the desired functionality can be enabled.

This is not like there are many additional formatting options in the initial report. You can check if you want:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-report.c;h=860f1eeeea7dbf8e43779308eaaffb1dbcf79d10;hb=refs /heads/linux-2.6.33.y

+3
source

Source: https://habr.com/ru/post/914156/


All Articles