diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs deleted file mode 100644 index 1956460..0000000 --- a/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,66 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("wpa-plugin-etl")] -[assembly: AssemblyDescription("WPA plugin to read ETW output from WindowsPerf")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Linaro.org")] -[assembly: AssemblyProduct("wpa-plugin-etl")] -[assembly: AssemblyCopyright("Linaro.org 2024")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b7c4374e-0236-4c7c-9565-9a142858f381")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] diff --git a/ReadGPCAppDataCooker.cs b/ReadGPCAppDataCooker.cs deleted file mode 100644 index 736e69f..0000000 --- a/ReadGPCAppDataCooker.cs +++ /dev/null @@ -1,74 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using Microsoft.Performance.SDK.Extensibility.DataCooking; -using Microsoft.Performance.SDK.Extensibility; -using Microsoft.Performance.SDK; -using Microsoft.Performance.SDK.Extensibility.DataCooking.SourceDataCooking; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Threading; - -namespace wpa_plugin_etl -{ - public class ReadGPCAppDataCooker : SourceDataCooker - { - public static readonly DataCookerPath DataCookerPath = DataCookerPath.ForSource(nameof(WpaPluginEtlSourceParser), nameof(ReadGPCAppDataCooker)); - private readonly List eventsList; - - [DataOutput] - public IReadOnlyList Events { get; } - - public override string Description => "Passes the ReadGPC event data from app"; - - public ReadGPCAppDataCooker() : base(ReadGPCAppDataCooker.DataCookerPath) - { - eventsList = new List(); - Events = new ReadOnlyCollection(eventsList); - } - - public override ReadOnlyHashSet DataKeys => - new ReadOnlyHashSet( - new HashSet - { - "WindowsPerf App", - nameof(ReadGPCEvent) - }); - - public override DataProcessingResult CookDataElement(ReadGPCEvent data, WpaPluginEtlSourceParser context, CancellationToken cancellationToken) - { - if (data.Key.IndexOf("WindowsPerf App") != -1) - { - eventsList.Add(data); - } - return DataProcessingResult.Processed; - } - } -} diff --git a/ReadGPCDriverDataCooker.cs b/ReadGPCDriverDataCooker.cs deleted file mode 100644 index 1e82c06..0000000 --- a/ReadGPCDriverDataCooker.cs +++ /dev/null @@ -1,75 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using Microsoft.Performance.SDK; -using Microsoft.Performance.SDK.Extensibility; -using Microsoft.Performance.SDK.Extensibility.DataCooking; -using Microsoft.Performance.SDK.Extensibility.DataCooking.SourceDataCooking; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Threading; - -namespace wpa_plugin_etl -{ - public class ReadGPCDriverDataCooker : SourceDataCooker - { - public static readonly DataCookerPath DataCookerPath = DataCookerPath.ForSource(nameof(WpaPluginEtlSourceParser), nameof(ReadGPCDriverDataCooker)); - private readonly List eventsList; - - [DataOutput] - public IReadOnlyList Events { get; } - - public override string Description => "Passes the ReadGPC event data from driver"; - - public ReadGPCDriverDataCooker() : base(ReadGPCDriverDataCooker.DataCookerPath) - { - eventsList = new List(); - Events = new ReadOnlyCollection(eventsList); - } - - - public override ReadOnlyHashSet DataKeys => - new ReadOnlyHashSet( - new HashSet - { - "WindowsPerf Driver", - nameof(ReadGPCEvent) - }); - - public override DataProcessingResult CookDataElement(ReadGPCEvent data, WpaPluginEtlSourceParser context, CancellationToken cancellationToken) - { - if (data.Key.IndexOf("WindowsPerf Driver") != -1) - { - eventsList.Add(data); - } - return DataProcessingResult.Processed; - } - } -} diff --git a/ReadGPCEvent.cs b/ReadGPCEvent.cs deleted file mode 100644 index 9fdfb26..0000000 --- a/ReadGPCEvent.cs +++ /dev/null @@ -1,67 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using Microsoft.Performance.SDK; -using Microsoft.Performance.SDK.Extensibility; -using System; - -namespace wpa_plugin_etl -{ - public class ReadGPCEvent : IKeyedDataType - { - public ulong Core { get; set; } - public String Event { get; set; } - public uint EventIdx { get; set; } - public uint GPCIdx { get; set; } - public String EventNote { get; set; } - public ulong Value { get; set; } - public string Key { get; set; } - public Timestamp Time { get; set; } - - public ReadGPCEvent() { } - - public ReadGPCEvent(ReadGPCEvent ev) - { - Core = ev.Core; - Event = ev.Event; - EventIdx = ev.EventIdx; - EventNote = ev.EventNote; - Value = ev.Value; - GPCIdx = ev.GPCIdx; - Key = ev.Key; - Time = ev.Time; - } - - public string GetKey() - { - return this.Key; - } - } -} diff --git a/Tables/ReadGPCAppTable.cs b/Tables/ReadGPCAppTable.cs deleted file mode 100644 index a318813..0000000 --- a/Tables/ReadGPCAppTable.cs +++ /dev/null @@ -1,146 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using Microsoft.Performance.SDK.Processing; -using System; -using System.Collections.Generic; -using Microsoft.Performance.SDK.Extensibility; - -namespace wpa_plugin_etl.Tables -{ - [Table] - public static class ReadGPCAppTable - { - public static readonly DataCookerPath dataCookerPath = DataCookerPath.ForSource(nameof(WpaPluginEtlSourceParser), nameof(ReadGPCAppDataCooker)); - - public static TableDescriptor TableDescriptor => new TableDescriptor( - Guid.Parse("{CC0CDEC2-710D-4955-8C3C-CEBF606960D2}"), - "WindowsPerf GPC Data from App", - "GPC data gathered with WindowsPerf App", - "PMU from WindowsPerf", - requiredDataCookers: new List { ReadGPCAppTable.dataCookerPath }); - - private static readonly ColumnConfiguration EventIdxColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{58A54596-0A1A-4F59-91E5-4F231F80F06E}"), "Event Index", "The raw index of the event"), - new UIHints { Width = 150 }); - - private static readonly ColumnConfiguration TimeColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{61979965-B0B8-4529-AE52-3C6E2A58BA8A}"), "Time", "The time of the event"), - new UIHints - { - IsVisible = false, - }); - - private static readonly ColumnConfiguration CoreColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{B8F574DD-1DAC-44AD-A623-4B39D39A09F6}"), "Core", "The CPU core that generated this event"), - new UIHints - { - Width = 150 - }); - - private static readonly ColumnConfiguration EventColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{15C1CB95-FA17-4C10-8EE9-1851C8992D8E}"), "Event Name", "The human readable name of the event"), - new UIHints - { - Width = 150 - }); - - private static readonly ColumnConfiguration EventNoteColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{C646628B-DD05-489A-9DF1-A1BB2E62561D}"), "Event Note", "The event note"), - new UIHints - { - Width = 150 - }); - - private static readonly ColumnConfiguration ValueColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{30971239-377C-443C-B00D-EE8047E59B28}"), "Value", "The value read"), - new UIHints - { - AggregationMode = AggregationMode.Sum, - Width = 150 - }); - - public static void Build(ITableBuilder tableBuilder, IReadOnlyList data) - { - var baseProjection = Projection.Index(data); - - var eventProjection = baseProjection.Compose(x => x.Event); - var timeProjection = baseProjection.Compose(x => x.Time); - - var coreProjection = baseProjection.Compose(x => x.Core); - var eventIdxProjection = baseProjection.Compose(x => x.EventIdx); - var eventNoteProjection = baseProjection.Compose(x => x.EventNote); - var valueProjection = baseProjection.Compose(x => x.Value); - - var config = new TableConfiguration("App PMU Data") - { - Columns = new[] - { - EventColumn, - CoreColumn, - TableConfiguration.PivotColumn, - TableConfiguration.LeftFreezeColumn, - EventIdxColumn, - EventNoteColumn, - TimeColumn, - TableConfiguration.GraphColumn, - TableConfiguration.RightFreezeColumn, - ValueColumn, - }, - }; - - config.AddColumnRole(ColumnRole.StartTime, TimeColumn); - - _ = tableBuilder.AddTableConfiguration(config) - .SetDefaultTableConfiguration(config) - .SetRowCount(data.Count) - .AddColumn(EventColumn, eventProjection) - .AddColumn(TimeColumn, timeProjection) - .AddColumn(CoreColumn, coreProjection) - .AddColumn(EventIdxColumn, eventIdxProjection) - .AddColumn(EventNoteColumn, eventNoteProjection) - .AddColumn(ValueColumn, valueProjection); - - } - - public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieval dataExtensionRetrieval) - { - IReadOnlyList lineItems = dataExtensionRetrieval.QueryOutput>( - new DataOutputPath(ReadGPCAppDataCooker.DataCookerPath, nameof(ReadGPCAppDataCooker.Events)) - ); - if (lineItems.Count == 0) - { - return; - } - - Build(tableBuilder, lineItems); - } - } -} diff --git a/Tables/ReadGPCDriverTable.cs b/Tables/ReadGPCDriverTable.cs deleted file mode 100644 index 0c046eb..0000000 --- a/Tables/ReadGPCDriverTable.cs +++ /dev/null @@ -1,133 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using Microsoft.Performance.SDK.Extensibility; -using Microsoft.Performance.SDK.Processing; -using System; -using System.Collections.Generic; - -namespace wpa_plugin_etl.Tables -{ - [Table] - public static class ReadGPCDriverTable - { - public static readonly DataCookerPath dataCookerPath = DataCookerPath.ForSource(nameof(WpaPluginEtlSourceParser), nameof(ReadGPCDriverDataCooker)); - - public static TableDescriptor TableDescriptor => new TableDescriptor( - Guid.Parse("{E122471E-25A6-4F7F-BE6C-E62774FD0410}"), - "WindowsPerf GPC Data from Driver", - "GPC data gathered with WindowsPerf Driver", - "PMU from WindowsPerf", - requiredDataCookers: new List { ReadGPCDriverTable.dataCookerPath }); - - private static readonly ColumnConfiguration EventColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{E7907471-C6E2-41D2-AAA2-E4D790EB8676}"), "Event Index", "The raw index of the event"), - new UIHints { Width = 150 }); - - private static readonly ColumnConfiguration TimeColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{E3056A08-D44D-4CD6-8158-503BDAEF899C}"), "Time", "The time of the event"), - new UIHints { - IsVisible = true, - }); - - private static readonly ColumnConfiguration CoreColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{229769EA-126A-4F29-8AB9-DACE3331FCD3}"), "Core", "The CPU core that generated this event"), - new UIHints - { - Width = 150 - }); - - private static readonly ColumnConfiguration GPCIdxColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{2E057186-CE48-45DB-85C2-4948D332FCB7}"), "GPC Index", "The index of the GPC that the value was read from"), - new UIHints - { - Width = 150 - }); - - private static readonly ColumnConfiguration ValueColumn = new ColumnConfiguration( - new ColumnMetadata(new Guid("{54B4A016-9F78-4BAE-A0AB-AFDFBF33C3F1}"), "Value", "The value read"), - new UIHints { - AggregationMode = AggregationMode.Sum, - Width = 150 }); - - public static void Build(ITableBuilder tableBuilder, IReadOnlyList data) - { - var baseProjection = Projection.Index(data); - - var eventProjection = baseProjection.Compose(x => x.Event); - var timeProjection = baseProjection.Compose(x => x.Time); - - var coreProjection = baseProjection.Compose(x => x.Core); - var GPCIdxProjection = baseProjection.Compose(x => x.GPCIdx); - var valueProjection = baseProjection.Compose(x => x.Value); - - var config = new TableConfiguration("Driver PMU Data") - { - Columns = new[] - { - EventColumn, - CoreColumn, - TableConfiguration.PivotColumn, - TableConfiguration.LeftFreezeColumn, - GPCIdxColumn, - TimeColumn, - TableConfiguration.GraphColumn, - TableConfiguration.RightFreezeColumn, - ValueColumn, - }, - }; - - config.AddColumnRole(ColumnRole.StartTime, TimeColumn); - - _ = tableBuilder.AddTableConfiguration(config) - .SetDefaultTableConfiguration(config) - .SetRowCount(data.Count) - .AddColumn(EventColumn, eventProjection) - .AddColumn(CoreColumn, coreProjection) - .AddColumn(GPCIdxColumn, GPCIdxProjection) - .AddColumn(TimeColumn, timeProjection) - .AddColumn(ValueColumn, valueProjection); - - } - - public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieval dataExtensionRetrieval) - { - IReadOnlyList lineItems = dataExtensionRetrieval.QueryOutput>( - new DataOutputPath(ReadGPCDriverDataCooker.DataCookerPath, nameof(ReadGPCDriverDataCooker.Events)) - ); - if (lineItems.Count == 0) - { - return; - } - - Build(tableBuilder, lineItems); - } - } -} diff --git a/WpaPluginEtlDataProcessor.cs b/WpaPluginEtlDataProcessor.cs deleted file mode 100644 index 1cf490d..0000000 --- a/WpaPluginEtlDataProcessor.cs +++ /dev/null @@ -1,44 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using Microsoft.Performance.SDK.Processing; -using Microsoft.Performance.SDK.Extensibility.SourceParsing; - -namespace wpa_plugin_etl -{ - public class WpaPluginEtlDataProcessor : CustomDataProcessorWithSourceParser - { - public WpaPluginEtlDataProcessor( - ISourceParser sourceParser, - ProcessorOptions options, - IApplicationEnvironment applicationEnvironment, - IProcessorEnvironment processorEnvironment) : base(sourceParser, options, applicationEnvironment, processorEnvironment) { } - } -} diff --git a/WpaPluginEtlProcessingSource.cs b/WpaPluginEtlProcessingSource.cs deleted file mode 100644 index 5b2932d..0000000 --- a/WpaPluginEtlProcessingSource.cs +++ /dev/null @@ -1,104 +0,0 @@ -// BSD 3-Clause License -// -// Copyright (c) 2024, Arm Limited -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using Microsoft.Performance.SDK.Processing; -using System.Collections.Generic; -using System.Linq; - -namespace wpa_plugin_etl -{ - [ProcessingSource( - "{3ABDFE57-0E4F-4223-A7F4-3F6F5813D741}", // The GUID must be unique for your Processing Source. You can use Visual Studio's Tools -> Create Guid… tool to create a new GUID - "WindowsPerf WPA Plugin ETL", - "WindowsPerf Driver ETW Reader")] - [FileDataSource( - ".etl", - "ETL files")] - public class WpaPluginEtlProcessingSource : ProcessingSource - { - private IApplicationEnvironment applicationEnvironment; - - public override ProcessingSourceInfo GetAboutInfo() - { - return new ProcessingSourceInfo - { - CopyrightNotice = "Linaro.org 2024", - - LicenseInfo = new LicenseInfo - { - Name = "BSD 3-Clause License", - Text = "Please see the link for the full license text.", - Uri = "https://gitlab.com/everton.constantino/wpa-plugin-etl/-/raw/master/LICENSE", - }, - - Owners = new[] - { - new ContactInfo - { - Address = "Everton Constantino", - EmailAddresses = new[] - { - "everton.constantino@linaro.org", - }, - }, - }, - - ProjectInfo = new ProjectInfo - { - Uri = "https://gitlab.com/everton.constantino/wpa-plugin-etl", - }, - }; - } - - protected override void SetApplicationEnvironmentCore(IApplicationEnvironment applicationEnvironment) - { - this.applicationEnvironment = applicationEnvironment; - } - - protected override ICustomDataProcessor CreateProcessorCore( - IEnumerable dataSources, - IProcessorEnvironment processorEnvironment, - ProcessorOptions options) - { - WpaPluginEtlSourceParser parser = new WpaPluginEtlSourceParser(dataSources.Select(x => x.Uri.LocalPath).ToArray()); - - return new WpaPluginEtlDataProcessor( - parser, - options, - this.applicationEnvironment, - processorEnvironment); - } - - protected override bool IsDataSourceSupportedCore(IDataSource source) - { - return true; - } - } -} diff --git a/WpaPluginEtlSourceParser.cs b/WpaPluginEtlSourceParser.cs deleted file mode 100644 index 1547cdf..0000000 --- a/WpaPluginEtlSourceParser.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Microsoft.Diagnostics.Tracing.Parsers; -using Microsoft.Diagnostics.Tracing; -using Microsoft.Performance.SDK; -using Microsoft.Performance.SDK.Extensibility.SourceParsing; -using Microsoft.Performance.SDK.Processing; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using wpa_plugin_etl.Tables; - -namespace wpa_plugin_etl -{ - public class WpaPluginEtlSourceParser : ISourceParser - { - private readonly string[] filePaths; - - public DataSourceInfo DataSourceInfo { get; private set; } - - public string Id = nameof(WpaPluginEtlSourceParser); - - public Type DataElementType => typeof(ReadGPCEvent); - - public Type DataContextType => typeof(WpaPluginEtlSourceParser); - - public Type DataKeyType => typeof(string); - - public int MaxSourceParseCount => 1; - - string ISourceParserDescriptor.Id => nameof(WpaPluginEtlSourceParser); - - public void PrepareForProcessing(bool allEventsConsumed, IReadOnlyCollection requestedDataKeys) {} - - public WpaPluginEtlSourceParser(string[] filePaths) - { - this.filePaths = filePaths; - } - - public void ProcessSource(ISourceDataProcessor dataProcessor, ILogger logger, IProgress progress, CancellationToken cancellationToken) - { - if(filePaths.Length == 0) { return; } - - Timestamp startTime = Timestamp.MaxValue; - Timestamp endTime = Timestamp.MinValue; - DateTime firstEvent = DateTime.MinValue; - - foreach (var path in this.filePaths) - { - using (var source = new ETWTraceEventSource(path)) - { - var parser = new DynamicTraceEventParser(source); - parser.All += delegate (TraceEvent data) - { - DateTime time = data.TimeStamp; - Timestamp stamp = Timestamp.FromNanoseconds(time.Ticks * 100); - - if (stamp < startTime) - { - startTime = stamp; - firstEvent = time; - } - if (stamp > endTime) - { - endTime = stamp; - } - - if (data.ProviderName.IndexOf("WindowsPerf Driver") != -1) - { - ReadGPCEvent ev = new ReadGPCEvent - { - Key = data.ProviderName, - Core = (ulong)(long)data.PayloadValue(0), - Event = String.Format("{0:X8}", (uint)(int)data.PayloadValue(1)), - EventIdx = (uint)(int)data.PayloadValue(1), - EventNote = "", - GPCIdx = (uint)(int)data.PayloadValue(2), - Time = Timestamp.FromNanoseconds(stamp.ToNanoseconds - startTime.ToNanoseconds), - Value = (ulong)(long)data.PayloadValue(3), - }; - - _ = dataProcessor.ProcessDataElement(ev, this, cancellationToken); - } - else if (data.ProviderName.IndexOf("WindowsPerf App") != -1) - { - ReadGPCEvent ev = new ReadGPCEvent - { - Key = data.ProviderName, - Core = (ulong)(long)data.PayloadValue(0), - Event = (String)data.PayloadValue(1), - EventIdx = (uint)(int)data.PayloadValue(2), - EventNote = (String)data.PayloadValue(3), - GPCIdx = 0, - Time = Timestamp.FromNanoseconds(stamp.ToNanoseconds - startTime.ToNanoseconds), - Value = (ulong)(long)data.PayloadValue(4), - }; - - _ = dataProcessor.ProcessDataElement(ev, this, cancellationToken); - } - }; - source.Process(); - } - } - - DataSourceInfo = new DataSourceInfo(0, (endTime - startTime).ToNanoseconds, firstEvent.ToUniversalTime()); - - progress.Report(100); - } - } -} diff --git a/app.config b/app.config deleted file mode 100644 index 1696df6..0000000 --- a/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/packages.config b/packages.config deleted file mode 100644 index 4f1a70c..0000000 --- a/packages.config +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wpa-plugin-etl.csproj b/wpa-plugin-etl.csproj deleted file mode 100644 index c593f5f..0000000 --- a/wpa-plugin-etl.csproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - Debug - AnyCPU - {B7C4374E-0236-4C7C-9565-9A142858F381} - Library - Properties - wpa_plugin_etl - wpa-plugin-etl - v4.8.1 - 512 - true - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.9\lib\netstandard2.0\Dia2Lib.dll - True - - - packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.9\lib\netstandard2.0\Microsoft.Diagnostics.FastSerialization.dll - - - packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.9\lib\netstandard2.0\Microsoft.Diagnostics.Tracing.TraceEvent.dll - - - packages\Microsoft.Performance.SDK.1.1.24\lib\netstandard2.0\Microsoft.Performance.SDK.dll - - - packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll - - - packages\NuGet.Versioning.5.11.5\lib\net472\NuGet.Versioning.dll - - - - packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - packages\System.Collections.Immutable.8.0.0\lib\net462\System.Collections.Immutable.dll - - - - - packages\System.Diagnostics.Process.4.3.0\lib\net461\System.Diagnostics.Process.dll - True - True - - - packages\System.Diagnostics.TraceSource.4.3.0\lib\net46\System.Diagnostics.TraceSource.dll - True - True - - - packages\System.IO.4.3.0\lib\net462\System.IO.dll - True - True - - - packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll - True - True - - - packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll - True - True - - - packages\System.IO.UnmanagedMemoryStream.4.3.0\lib\net46\System.IO.UnmanagedMemoryStream.dll - True - True - - - packages\System.Memory.4.5.5\lib\net461\System.Memory.dll - - - packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll - True - True - - - - packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - packages\System.Reflection.Metadata.8.0.0\lib\net462\System.Reflection.Metadata.dll - - - packages\System.Reflection.TypeExtensions.4.7.0\lib\net461\System.Reflection.TypeExtensions.dll - - - packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll - True - True - - - packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll - - - packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll - True - True - - - packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - True - True - - - packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - True - True - - - packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll - - - packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll - True - True - - - - - - - - - packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.9\lib\netstandard2.0\TraceReloggerLib.dll - True - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/wpa-plugin-etl.csproj.user b/wpa-plugin-etl.csproj.user deleted file mode 100644 index e17c5cc..0000000 --- a/wpa-plugin-etl.csproj.user +++ /dev/null @@ -1,9 +0,0 @@ - - - - Program - C:\Program Files %28x86%29\Windows Kits\10\Windows Performance Toolkit\wpa.exe - -nodefault -addsearchdir "C:\Users\tcwg\source\repos\wpa-plugin-etl\bin\Debug" - false - - \ No newline at end of file diff --git a/wpa-plugin-etl.sln b/wpa-plugin-etl.sln index b965d4a..10b10ab 100644 --- a/wpa-plugin-etl.sln +++ b/wpa-plugin-etl.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34622.214 diff --git a/wpa-plugin-etl/wpa-plugin-etl.csproj.user b/wpa-plugin-etl/wpa-plugin-etl.csproj.user new file mode 100644 index 0000000..4b61006 --- /dev/null +++ b/wpa-plugin-etl/wpa-plugin-etl.csproj.user @@ -0,0 +1,12 @@ + + + + ProjectDebugger + + + Debug + + + ProjectDebugger + + \ No newline at end of file