andikleen / pmu-tools

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

Properly split arguments #508

Closed TLCFEM closed 6 months ago

TLCFEM commented 6 months ago

When calling toplev with, for example,

toplev ./test -v

The argument -v is captured by toplev instead of the target application. The intended behaviour is most likely to pass -v to ./test. This applies to other arguments such as -F and -S, which may also be used by the target application.

This PR reparses the arguments and passes all arguments after (including) ./test to perf.

To pass the same argument to toplev, one can write

toplev -v ./test -v
andikleen commented 6 months ago

We support -- to separate the two kind of arguments. perf has complex arguments and it is not easy to parse them. I don't think I want such a drastic change of behavior, it might break existing scripts, sorry.