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

LTTngDataExtensions unable to process traces from NET6.0+ project #102

Closed tomithychen closed 1 year ago

tomithychen commented 1 year ago

During trace processing, an exception is thrown (shown below) when processing an LTTng trace when run from a NET6.0 or NET7.0 project. When used from netcoreapp3.1 and NET5.0, the trace processing still works.

You can repro this by modifying the LTTng unit tests within the repo to target those versions of .NET

Repro

  1. Change LTTngDataExtUnitTest/LTTngDataExtUnitTest.csproj targetframeworks to build NET5.0, NET6.0, and NET7.0 a. <TargetFramework>netcoreapp3.1</TargetFramework> -> <TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
  2. Rebuild LTTngDataExtUnitTest (will probably have to re-open solution first)
  3. Run all LTTngDataExtUnitTest tests in each framework
  4. netcoreapp3.1 and net5.0 tests all pass
  5. net6.0 and net7.0 unit tests all fail to process traces (although 3 of the unit tests still pass in each)

Exception:

CtfPlayback.Metadata.CtfMetadataException
  HResult=0x80131500
  Message=type_specifier does not have TypeSpecifier: line=1, startToken=new_setting
  Source=CtfPlayback
  StackTrace:
   at CtfPlayback.Metadata.AntlrParser.CtfListener.ExitDeclarationSpecifierTypeSpecifier(DeclarationSpecifierTypeSpecifierContext context) in D:\git\Microsoft-Performance-Tools-Linux-Android\CtfPlayback\Metadata\AntlrParser\CtfListener.cs:line 842
   at CtfParser.DeclarationSpecifierTypeSpecifierContext.ExitRule(IParseTreeListener listener) in D:\git\Microsoft-Performance-Tools-Linux-Android\CtfPlayback\Metadata\AntlrParser\Generated\CtfParser.cs:line 581
   at Antlr4.Runtime.Tree.ParseTreeWalker.ExitRule(IParseTreeListener listener, IRuleNode r)
   at Antlr4.Runtime.Tree.ParseTreeWalker.Walk(IParseTreeListener listener, IParseTree t)
   at Antlr4.Runtime.Tree.ParseTreeWalker.Walk(IParseTreeListener listener, IParseTree t)
   at CtfPlayback.Metadata.AntlrParser.CtfAntlrMetadataParser.Parse(Stream metadataStream) in D:\git\Microsoft-Performance-Tools-Linux-Android\CtfPlayback\Metadata\AntlrParser\CtfAntlrMetadataParser.cs:line 60
   at CtfPlayback.CtfPlayback.GeneratePlaybackStreams(ICtfInput source, CtfPlaybackOptions playbackOptions) in D:\git\Microsoft-Performance-Tools-Linux-Android\CtfPlayback\CtfPlayback.cs:line 142
   at CtfPlayback.CtfPlayback.Playback(ICtfInput source, CtfPlaybackOptions playbackOptions, IProgress`1 progress) in D:\git\Microsoft-Performance-Tools-Linux-Android\CtfPlayback\CtfPlayback.cs:line 69
   at LTTngCds.LTTngSourceParser.ProcessSource(ISourceDataProcessor`3 dataProcessor, ILogger logger, IProgress`1 progress, CancellationToken cancellationToken) in D:\git\Microsoft-Performance-Tools-Linux-Android\LTTngCds\LTTngSourceParser.cs:line 134
   at Microsoft.Performance.SDK.Runtime.Extensibility.SourceProcessingSession`3.ProcessSource(ILogger logger, IProgress`1 totalProgress, CancellationToken cancellationToken)
   at Microsoft.Performance.SDK.Processing.CustomDataProcessorWithSourceParser`3.ProcessAsyncCore(IProgress`1 progress, CancellationToken cancellationToken)
   at Microsoft.Performance.SDK.Processing.CustomDataProcessor.ProcessAsync(IProgress`1 progress, CancellationToken cancellationToken)
   at Microsoft.Performance.SDK.Runtime.ProcessingSourceExecutor.<ExecuteAsync>d__14.MoveNext()