hotspot icon indicating copy to clipboard operation
hotspot copied to clipboard

FR: View combined results of multiple recordings.

Open GitMensch opened this issue 2 years ago • 4 comments
trafficstars

Is your feature request related to a problem? Please describe. System wide profiling on an active machine gives lots of data, which is commonly not useful and may result in lost chunks and big files. Limiting this to a specific users helps, but on production machine the system user of an interesting program is not unlikely to be "all the same" for a lot of processes. To work around the recording issue, it is most easy to run multiple processes, each with perf record, which results in multiple smaller files. ... But how to view them combined afterwards?

File->Open only allows to open a single file and - I guess - just cat ing multiple files together won't work for neither perf.data.* nor *.perfparser.

Describe the solution you'd like Option to open multiple recordings at once (all in the same session, similar as it i done in a system/user wide recording) via File->Open, and possibly a File->Add option to post-add more recordings after the initial file(s) are opened.

Describe alternatives you've considered Uer-wide recording, but that will commonly record too much; wrapping multiple runs in a single shell script with async starts, but that needs to be written and may not be applicable, either.

GitMensch avatar Jan 26 '23 10:01 GitMensch

here's an easy alternative that I used in the past:

write a shell script or similar "launcher" that starts all the processes you want to profile, then profile that. perf will profile subprocesses, so you'll get all apps started there in one file

anything else is super hard as I believe that time stamps are not equivalent between perf data files (potentially, would have to check). anyhow definitely not a use case I would work on myself - patches welcome as always

milianw avatar Feb 08 '23 15:02 milianw

@GitMensch ping? any response to my above message? I'm inclined to close this ticket as it's not really actionable

milianw avatar Mar 06 '23 18:03 milianw

The workarounds mentioned by me and detailed by you do often work, but the main goal would be to get a combined view "as if" there would have been a single starter, but actually there are multiple perf files.

Maybe perfparser could "combine" those (giving it a "virtual" common start process, if that's needed)?

GitMensch avatar Mar 06 '23 20:03 GitMensch

While this dos not cover all cases (combination seems still useful for me) the run of a script via perf record that starts everything works in many cases.

Of course I now have a huge perf.data file which contains bash, make and even gcc along with the data that I'm interested in. running hotspot perf.data --exportTo data.perfparser then also raises a lot of warnings and takes a while.

Opening the file in hotspot does allow "filter by binary" which allows me to post inspect the binaries I'm interested in, too.

Would it be possible to add a --filter option to perfparser (or hotspot --exportTo) where I could specify the binaries I'm (not) interested in? This would make the "collect altogether" option much more useful.

GitMensch avatar Mar 24 '23 13:03 GitMensch