microsoft / Microsoft-Performance-Tools-Linux-Android

Linux, Android and Chromium Performance Tools built using the Microsoft Performance Toolkit. Cross-platform .NET Core + WPA GUI
MIT License
316 stars 34 forks source link

Loading perf artifact is not well documented, or not flexible #106

Closed ami-GS closed 1 month ago

ami-GS commented 1 year ago

Hi team,

I did reverse engineering to load perf file. Then I felt it is not well documented and not flexible.

Especially about the extension requirements, as WPA extends feature for .txt loading as shown in Diagnostic Console

ivberg commented 1 year ago

The current Perf capture is documented here, including exact script commands and conversion to txt format with the right naming - https://github.com/microsoft/Microsoft-Performance-Tools-Linux-Android/blob/develop/LinuxTraceLogCapture.md#perf

Unfortunately, it's a bit complicated, but that is because LTTng does not support CPU Sampling capture yet, and the perf tool is the built-in kernel standard tool that allows this. Decoding to text is required not only to read the format but because it contains symbols. LTTng does not have great symbol support at the moment.

I don't particularly love that we REQUIRE a certain extension (like .txt). However, with a plugin framework as is used by Microsoft Performance Toolkit SDK, you do need to see if a certain plugin (like perf) supports a certain file format, and an extension is a standard way to do that. The file is indeed txt format. We also use the same format and general capture method as https://aka.ms/perfcollect

Do you have any suggestions or PR to improve @ami-GS?

FYI @Nemati as he recently used this and may also have some ideas as well

ami-GS commented 1 year ago

I did not notice the document. but what I did was more simpler than the one written.

perf record -F XX -a -g -o out.perf.data MY_COMMAND
perf script -i out.perf.data > out.perf.data.txt

This file could be visualized on WPA what the difference with the commands on your doc?

And, just .txt file failed to be loaded. Need to have XXX.perf.data.txt. This is more complicated and nothing mentioned as much as I investigated. My recommendation is that WPA Diagnostic console to mention ".perf.data.txt" like
Associating .PERF.DATA.TXT with `Linux Perf Txt Data
instead of

Associating .TXT with `Linux Perf Txt Data
or mention the requirements in the doc

ivberg commented 1 month ago

Closing as this has been documented for some time the required format and name