google / UIforETW

User interface for recording and managing ETW traces
https://randomascii.wordpress.com/2015/04/14/uiforetw-windows-performance-made-easier/
Apache License 2.0
1.55k stars 201 forks source link

flamegrapth.exe creates an empty .flamegrapth.txt #86

Closed ewirch closed 7 years ago

ewirch commented 7 years ago

Running flamegrapth.exe on a trace:

> c:\tools\UIforETW\bin\flame_graph.exe --trace 2016-08-25_08-17-45_ew.etl --process_name ssh-agent.exe
Converting trace file to CSV format.
Reading trace events.
Generating flame graph.
Wrote flame graph data in file 2016-08-25_08-17-45_ew.etl.flamegraph.txt

The written CSV is 300 MB in size, the 2016-08-25_08-17-45_ew.etl.flamegraph.txt is empty. The CSV file does contain ssh-agent stacks:

            CSwitch,      19092,    ssh-agent.exe (29588),      24056,    5,   -1,         129,        0,             Idle (   0),          0,    0,   -1,         Running,        Executive,  NonSwap,    129,   4,   4,          0,    0,    0
            CSwitch,      19094,             Idle (   0),          0,    0,   -1,           0,        0,   SourceTree.exe (25860),      18684,   10,   -1,         Waiting,       WrResource,  NonSwap,    155,   2,   5,   80418816,    0,    0
        ReadyThread,      19095,   SourceTree.exe (25860),      21952,   SourceTree.exe (25860),      18684,       Unwait,               1,   3,      
              Stack,      19095,      21952,   1, 0xfffff802bbd9e0fd,     ntoskrnl.exe! ?? ::FNODOBFM::`string'
              Stack,      19095,      21952,   2, 0xfffff802bbccb235,     ntoskrnl.exe!ExpReleaseResourceForThreadLite
              Stack,      19095,      21952,   3, 0xfffff802bbcca554,     ntoskrnl.exe!ExReleaseResourceAndLeavePriorityRegion
              Stack,      19095,      21952,   4, 0xfffff960bec6d942,   win32kbase.sys!0xfffff960bec6d942
              Stack,      19095,      21952,   5, 0xfffff802bbd591a3,     ntoskrnl.exe!KiSystemServiceCopyEnd

              Stack,      19092,      24056,   1, 0xfffff802bbd539af,     ntoskrnl.exe!SwapContext
              Stack,      19092,      24056,   2, 0xfffff802bbd533d6,     ntoskrnl.exe!KiSwapContext
              Stack,      19092,      24056,   3, 0xfffff802bbcdb80a,     ntoskrnl.exe!KiSwapThread
              Stack,      19092,      24056,   4, 0xfffff802bbcdb299,     ntoskrnl.exe!KiCommitThreadWait
              Stack,      19092,      24056,   5, 0xfffff802bbcdaf05,     ntoskrnl.exe!KeWaitForSingleObject
              Stack,      19092,      24056,   6, 0xfffff80119d41297,         NTFS.sys!NtfsNonCachedIo
              Stack,      19092,      24056,   7, 0xfffff80119d435cf,         NTFS.sys!NtfsCommonRead
              Stack,      19092,      24056,   8, 0xfffff80119d428f2,         NTFS.sys!NtfsFsdRead
              Stack,      19092,      24056,   9, 0xfffff80118d57895,       FLTMGR.SYS!FltpLegacyProcessingAfterPreCallbacksCompleted
              Stack,      19092,      24056,  10, 0xfffff80118d55816,       FLTMGR.SYS!FltpDispatch
              Stack,      19092,      24056,  11, 0xfffff802bbc90b2d,     ntoskrnl.exe!IoPageRead
              Stack,      19092,      24056,  12, 0xfffff802bbc8f024,     ntoskrnl.exe!MiIssueHardFaultIo
              Stack,      19092,      24056,  13, 0xfffff802bbc8e3d2,     ntoskrnl.exe!MiIssueHardFault
              Stack,      19092,      24056,  14, 0xfffff802bbca9823,     ntoskrnl.exe!MmAccessFault
              Stack,      19092,      24056,  15, 0xfffff802bbd57bbc,     ntoskrnl.exe!KiPageFault
              Stack,      19092,      24056,  16, 0xfffff802bbc79c2a,     ntoskrnl.exe!RtlpLookupFunctionEntryForStackWalks
              Stack,      19092,      24056,  17, 0xfffff802bbc77f7c,     ntoskrnl.exe!RtlpWalkFrameChain
              Stack,      19092,      24056,  18, 0xfffff802bbc77ddf,     ntoskrnl.exe!RtlWalkFrameChain
              Stack,      19092,      24056,  19, 0xfffff802bbe17781,     ntoskrnl.exe!EtwpTraceStackWalk
              Stack,      19092,      24056,  20, 0xfffff802bbe175c5,     ntoskrnl.exe!EtwpStackWalkApc
              Stack,      19092,      24056,  21, 0xfffff802bbcdd195,     ntoskrnl.exe!KiDeliverApc
              Stack,      19092,      24056,  22, 0xfffff802bbd51b33,     ntoskrnl.exe!KiApcInterrupt
              Stack,      19092,      24056,  23, 0xfffff802bbcd1399,     ntoskrnl.exe!KiExitDispatcher
              Stack,      19092,      24056,  24, 0xfffff802bbcd0df3,     ntoskrnl.exe!KeReleaseMutant
              Stack,      19092,      24056,  25, 0xfffff802bbffd826,     ntoskrnl.exe!NtReleaseMutant
              Stack,      19092,      24056,  26, 0xfffff802bbd591a3,     ntoskrnl.exe!KiSystemServiceCopyEnd

Running flamegraph.exe without process_name writes 3 MB .flamegraph.txt.

randomascii commented 7 years ago

I'm not the original author of flame_graph.exe. You could try the flame graph script as discussed here:

https://randomascii.wordpress.com/2013/03/26/summarizing-xperf-cpu-usage-with-flame-graphs/

or you could try debugging the code. Or, share out the trace and the repro steps and somebody may take a look at it.

On Wed, Aug 24, 2016 at 11:48 PM, ewirch notifications@github.com wrote:

Running flamegrapth.exe on a trace:

c:\tools\UIforETW\bin\flame_graph.exe --trace 2016-08-25_08-17-45_ew.etl --process_name ssh-agent.exe Converting trace file to CSV format. Reading trace events. Generating flame graph. Wrote flame graph data in file 2016-08-25_08-17-45_ew.etl.flamegraph.txt

The written CSV is 300 MB in size, the 2016-08-25_08-17-45_ew.etl. flamegraph.txt is empty. The CSV file does contain ssh-agent lines:

            CSwitch,      19092,    ssh-agent.exe (29588),      24056,    5,   -1,         129,        0,             Idle (   0),          0,    0,   -1,         Running,        Executive,  NonSwap,    129,   4,   4,          0,    0,    0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/UIforETW/issues/86, or mute the thread https://github.com/notifications/unsubscribe-auth/AKTLqZBZRrrm0e4-lFhaTYnM3kJ9iFspks5qjTrXgaJpZM4Jsvwz .

Bruce Dawson

randomascii commented 7 years ago

Note that the 10.0.14393 version of WPA (Anniversary edition, auto installed by UIforETW on windows 8.0 and above) supports flame graphs! So, the external flame graph tools should be less necessary. The only built-in flame graph I could find was under CPU Usage (Sampled) but it is possible to create different configurations.