andikleen / pmu-tools

Intel PMU profiling tools
GNU General Public License v2.0
1.98k stars 331 forks source link

toplev --show-sample adds unnecessary perf -o parameter #437

Closed turol closed 1 year ago

turol commented 1 year ago

Using toplev's --show-sample parameter generates a perf command with an unnecessary -o perf.data.n parameter where n is some number. It seems to be related to the used level. This makes it harder to use the generated command since it has to be edited out instead of just copy-pasting the whole command.

andikleen commented 1 year ago

On Thu, Sep 15, 2022 at 08:14:35AM -0700, Turo Lamminen wrote:

Using toplev's --show-sample parameter generates a perf command with an unnecessary -o perf.data.n parameter where n is some number. It seems to be related to the used level. This makes it harder to use the generated command since it has to be edited out instead of just copy-pasting the whole command.

Do you have a command line? It should only add the number if it could collect multiple runs, which requires different output files.

turol commented 1 year ago

Command and slightly redacted output: https://gist.github.com/turol/f768fa7efb10f1e2215cfaf4b944eb56

andikleen commented 1 year ago

You are using --drilldown, so it shows the sample steps multiple times for each drill down step and each needs an unique file name.

Maybe it could only show it for the last one, and not do that but that would be different semantics.

turol commented 1 year ago

I think that whatever toplev needs to do internally should have no effect on the command shown to the user. The command shown should be one that is simple to copy and execute.