microsoft / perfview

PerfView is a CPU and memory performance-analysis tool
http://channel9.msdn.com/Series/PerfView-Tutorial
MIT License
4.21k stars 712 forks source link

perfcollect on Fedora/RHEL8 #1130

Open tmds opened 4 years ago

tmds commented 4 years ago

@brianrob I'm trying to run perfcollect on Fedora.

It is trying to install some dependencies: https://github.com/microsoft/perfview/blob/cb1943b8ded584e136e140746e5771ca63668c5a/src/perfcollect/perfcollect#L987

The source of packages is an external repository meant for RHEL7: https://packages.efficios.com/repo.files/EfficiOS-RHEL7-x86-64.repo.

On Fedora, I get an error kmod-lttng-modules is not compatible with my kernel. Fedora repositories itself actually include all packages, except kmod-lttng-modules. Maybe we can make perfcollect still do something meaningful when kmod-lttng-modules is not available for the distro?

On RHEL8 we are in a similar situation for kmod-lttng-modules. RHEL8 repositories include these packages except kmod-lttng-modules and lttng-tools. Can perfcollect still be meaningful even in the absence of lttng data?

cc @omajid

omajid commented 4 years ago

Can perfcollect extract the same information from different tools? Could this information be extracted using systemtap (which can read lttng markers) and/or perf, both of which can also do kernel tracing without unsupported (on Fedora/RHEL) kernel modules.

brianrob commented 4 years ago

@tmds, perfcollect can collect useful data using either perf, LTTng, or both. Today, perfcollect install will attempt to install both, but I do think it's reasonable to modify the logic to check to see if the packages exist, and if not, to emit a warning (presumably at the end of installation), telling the user what was installed and what was not. I'm thinking an "installation summary". If you're interested, feel free to give this a shot - if not, I can see about doing this at some point. I think it would be a nice addition.

@omajid, today perfcollect does not know how to extract information from tools other than perf and lttng, though it would be reasonable to add this functionality. The general strategy that I would use for this is the following:

(a) Modify perfcollect install to do the right thing on Fedora/RHEL. (b) Modify perfcollect collect and perfcollect start/stop to use systemtap or otherwise. (c) When stopping collection, keep the raw trace around and save it in the trace.zip file. (d) Convert the systemtap file into the appropriate format so that it can be viewed by the existing tools. For example, lttng tracepoints collected by systemtap should result in a CTF trace. perf events should result in a perf.data.txt file like what we generate with perf script.

I'm not sure if all of (d) is possible today, but that would be the idea.

tmds commented 4 years ago

If you're interested, feel free to give this a shot - if not, I can see about doing this at some point. I think it would be a nice addition.

I'll look into it, you can assign this issue to me.

brianrob commented 4 years ago

Sounds great. Thanks!

tmds commented 4 years ago

@brianrob what is the role of lttng in perfcollect?

It is used to configure the events that get published? I guess EventPipe could be used for that also? Does it provide stack trace info with the events? I guess sample stack traces come from perf, and not lttng? kmod-lttng-modules is for events coming from Linux kernel? And the kernel stack info that is found in the trace.zip file also comes from perf?

brianrob commented 4 years ago

@tmds, you're right that lttng captures events that are published by the runtime and EventSources. There are no stacks collected as of yet - lttng only supports stack traces on kernelspace events at this time to my knowledge. kmod-lttng-modules is for capturing kernel space events. All of the stacks that are captured come from perf.

tmds commented 4 years ago

@brianrob We care about being able to provide packages that support performance tracing .NET as part of base RHEL. Since lttng packages are missing, we could use EventPipe to configure the session. I don't know if we could configure EventPipe from the perfcollect script. Probably it would be a better match to add this to the dotnet trace tool? Does that make sense? Is it something you have considered?