janestreet / magic-trace

magic-trace collects and displays high-resolution traces of what a process is doing
https://magic-trace.org
MIT License
4.7k stars 93 forks source link

Add optional command arguments in the end for "attach" command #267

Open DMaroo opened 1 year ago

DMaroo commented 1 year ago

This PR adds extra arguments at the end of "attach" command, and these will be forwarded on to perf verbatim. Therefore, we can now use the following command

$ magic-trace attach -p $(pidof foo) -trigger bar sleep 5

The perf command called under the hood would be

perf <args> sleep 5

Done in collaboration with @Mantra-7.

Fixes #230.