Skip to content

Commit

Permalink
Update WPA Plugin Stream Lifetime Table (#4467)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks authored Aug 16, 2024
1 parent 6a37cdc commit ff4b88b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ jobs:
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee
with:
dotnet-version: 6.0.x
- name: Install Dependencies
run: dotnet tool install --global Microsoft.Performance.Toolkit.Plugins.Cli --version 0.1.25-preview
- name: Build
run: dotnet build src\plugins\QuicTrace.sln -c ${{ matrix.configuration }}
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
with:
name: bin_quictrace_${{ matrix.configuration }}
path: artifacts/bin/quictrace/${{ matrix.configuration }}
# Package the plugin
- name: Install plugintool
run: dotnet tool install --global Microsoft.Performance.Toolkit.Plugins.Cli --version 0.1.25-preview
- name: Package
shell: pwsh
run: |
Expand Down
36 changes: 36 additions & 0 deletions src/plugins/trace/dll/Tables/QuicStreamLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ public sealed class QuicStreamLifetimeTable
new ColumnMetadata(new Guid("{D0612FB2-4243-4C13-9164-5D55837F7E04}"), "Type"),
new UIHints { AggregationMode = AggregationMode.UniqueCount });

private static readonly ColumnConfiguration processIdColumnConfig =
new ColumnConfiguration(
new ColumnMetadata(new Guid("{73bf47c1-a87e-473e-8337-dfc8442da9bb}"), "Process (ID)"),
new UIHints { AggregationMode = AggregationMode.Max });

private static readonly ColumnConfiguration threadIdColumnConfig =
new ColumnConfiguration(
new ColumnMetadata(new Guid("{b58d4999-21b8-4462-8dd7-6bf483d45b15}"), "ThreadId"),
new UIHints { AggregationMode = AggregationMode.Max });

private static readonly ColumnConfiguration cpuColumnConfig =
new ColumnConfiguration(
new ColumnMetadata(new Guid("{48ab57b9-e0df-4068-856a-a2c2ffdfa8f3}"), "CPU"),
new UIHints { AggregationMode = AggregationMode.Sum });

private static readonly ColumnConfiguration countColumnConfig =
new ColumnConfiguration(
new ColumnMetadata(new Guid("{9583D245-BD70-4BA3-A249-088F0D6C0D8C}"), "Count"),
Expand All @@ -102,6 +117,9 @@ public sealed class QuicStreamLifetimeTable
typeColumnConfig,
TableConfiguration.PivotColumn,
TableConfiguration.LeftFreezeColumn,
processIdColumnConfig,
threadIdColumnConfig,
cpuColumnConfig,
timeColumnConfig,
TableConfiguration.RightFreezeColumn,
TableConfiguration.GraphColumn,
Expand All @@ -123,6 +141,9 @@ public static void BuildTable(ITableBuilder tableBuilder, QuicState quicState)
var dataProjection = Projection.Index(events);

table.AddColumn(typeColumnConfig, dataProjection.Compose(ProjectType));
table.AddColumn(processIdColumnConfig, dataProjection.Compose(ProjectProcessId));
table.AddColumn(threadIdColumnConfig, dataProjection.Compose(ProjectThreadId));
table.AddColumn(cpuColumnConfig, dataProjection.Compose(ProjectCpu));
table.AddColumn(countColumnConfig, Projection.Constant<uint>(1));
table.AddColumn(timeColumnConfig, dataProjection.Compose(ProjectTime));

Expand All @@ -139,6 +160,21 @@ private static string ProjectType(QuicEvent evt)
return evt.EventId == QuicEventId.StreamCreated ? "Stream Create" : "Stream Destroy";
}

private static uint ProjectProcessId(QuicEvent evt)
{
return evt.ProcessId;
}

private static uint ProjectThreadId(QuicEvent evt)
{
return evt.ThreadId;
}

private static ushort ProjectCpu(QuicEvent evt)
{
return evt.Processor;
}

private static Timestamp ProjectTime(QuicEvent evt)
{
return evt.TimeStamp;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/trace/dll/pluginManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/microsoft/microsoft-performance-toolkit-sdk/main/src/PluginsSystem/Tools/Microsoft.Performance.Toolkit.Plugins.Cli/Manifest/PluginManifestSchema.json",
"identity": {
"id": "QuicTrace",
"version": "1.0.2"
"version": "1.0.3"
},
"displayName": "QuicTrace",
"description": "Used to open MsQuic trace files.",
Expand Down

0 comments on commit ff4b88b

Please sign in to comment.