I want to extend the dotnet trace tool with the possibility to convert trace files captured with PerfCollect to Speedscope file format. Just to be able to run perf investigation on Linux machine without copying the trace file to Windows and converting it to SpeedScope using PerfView.
I was hoping that it's going to be a matter of replacing this line of code with:
// before
var etlxFilePath = TraceLog.CreateFromEventPipeDataFile(fileToConvert, null, new TraceLogOptions() { ContinueOnError = continueOnError } );
// after
var etlxFilePath =
fileToConvert.EndsWith(".trace.zip")
? TraceLog.CreateFromLttngTextDataFile(fileToConvert, null, new TraceLogOptions() { ContinueOnError = continueOnError })
: TraceLog.CreateFromEventPipeDataFile(fileToConvert, null, new TraceLogOptions() { ContinueOnError = continueOnError });
However, for all the trace files I have I am getting following exception:
System.IO.EndOfStreamException: No CTF Information found in ZIP file.
at Microsoft.Diagnostics.Tracing.CtfTraceEventSource..ctor(String fileName)
at Microsoft.Diagnostics.Tracing.Etlx.TraceLog.CreateFromLttngTextDataFile(String filePath, String etlxFilePath, TraceLogOptions options)
The exception is thrown here:
|
if (firstChannel == null) |
|
{ |
|
throw new EndOfStreamException("No CTF Information found in ZIP file."); |
|
} |
Since PerfView was able to open this trace file I've debugged it and it turned out that the exception is handled by the GetTraceLog method:
|
if (e is EndOfStreamException) |
|
{ |
|
log.WriteLine("Warning: Trying to open CTF stream failed, no CTF (lttng) information"); |
|
} |
and later ParallelLinuxPerfScriptStackSource is used to create a StackSource from the trace file. The problem is that ParallelLinuxPerfScriptStackSource is not part of the TraceEvent library so I can't use it outside of PerfView.
Have the LTTng trace file format changed and the throwing code should be updated?
Would it be OK to move ParallelLinuxPerfScriptStackSource to TraceEvent library? (I could send a PR ofc)
/cc @brianrob
I want to extend the
dotnet tracetool with the possibility to convert trace files captured with PerfCollect to Speedscope file format. Just to be able to run perf investigation on Linux machine without copying the trace file to Windows and converting it to SpeedScope using PerfView.I was hoping that it's going to be a matter of replacing this line of code with:
However, for all the trace files I have I am getting following exception:
The exception is thrown here:
perfview/src/TraceEvent/Ctf/CtfTraceEventSource.cs
Lines 83 to 86 in 2fb635b
Since PerfView was able to open this trace file I've debugged it and it turned out that the exception is handled by the
GetTraceLogmethod:perfview/src/PerfView/PerfViewData.cs
Lines 8463 to 8466 in b2f8e0e
and later ParallelLinuxPerfScriptStackSource is used to create a
StackSourcefrom the trace file. The problem is thatParallelLinuxPerfScriptStackSourceis not part of theTraceEventlibrary so I can't use it outside of PerfView.Have the LTTng trace file format changed and the throwing code should be updated?
Would it be OK to move
ParallelLinuxPerfScriptStackSourcetoTraceEventlibrary? (I could send a PR ofc)/cc @brianrob