FlameGraph icon indicating copy to clipboard operation
FlameGraph copied to clipboard

stackcollapse-perf: fix flag in example

Open wolfgang42 opened this issue 2 years ago • 2 comments

Looks like the intent was to pass --fields, not --force.

I was already confused when I started reading the docs for this script, using the wrong option didn't help matters any ;-)

wolfgang42 avatar Apr 06 '22 04:04 wolfgang42

No, please see lines 115 to 118 -- the docs should match the usage message.

brendangregg avatar Sep 18 '22 00:09 brendangregg

Well, that's confusing, it depends on the kernel version?:

https://github.com/brendangregg/FlameGraph/blob/15c0c5719fe4d14190c96d155cfe4ad5dd883b98/stackcollapse-perf.pl#L115-L118

Ah, I see, the meaning of -f was changed in 4.1:

And -f is already taken up by --fields, which makes --force confused, so change the short option name of --fields to -F like what other perf commands do (e.g. perf report -F) and use -f as the short option name of --force.

In that case, would you instead accept a patch to just change the docs in this file to use the long option --fields and skip the short option confusion altogether? It looks to me like that should work back to 2.6.39 when custom field selection was introduced.

wolfgang42 avatar Sep 18 '22 18:09 wolfgang42