Skip to content

Commit 6ad4b07

Browse files
authored
Merge pull request #65 from microsoft/feature/sdkRc1
Use SDK v1.0.9-rc1
2 parents 90ed4a5 + 49a80df commit 6ad4b07

File tree

92 files changed

+601
-633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+601
-633
lines changed

CtfPlayback/CtfPlayback.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</ItemGroup>
4040

4141
<ItemGroup>
42-
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.9.2" GeneratePathProperty="true"/>
42+
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.9.2" GeneratePathProperty="true" />
4343
</ItemGroup>
4444

4545
<ItemGroup>

LTTngCds/LTTngCds.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<PackageReference Include="Microsoft.Performance.SDK" Version="0.109.24" />
32+
<PackageReference Include="Microsoft.Performance.SDK" Version="1.0.9-rc1" />
3333
</ItemGroup>
3434

3535
<ItemGroup>

LTTngCds/LTTngDataProcessor.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,28 @@
22
// Licensed under the MIT License.
33

44
using System;
5-
using System.Collections.Generic;
65
using LTTngCds.CookerData;
76
using LTTngCds.MetadataTables;
8-
using Microsoft.Performance.SDK.Extensibility;
97
using Microsoft.Performance.SDK.Extensibility.SourceParsing;
108
using Microsoft.Performance.SDK.Processing;
119

1210
namespace LTTngCds
1311
{
1412
internal sealed class LTTngDataProcessor
15-
: CustomDataProcessorBaseWithSourceParser<LTTngEvent, LTTngContext, string>,
13+
: CustomDataProcessorWithSourceParser<LTTngEvent, LTTngContext, string>,
1614
IDisposable
1715
{
1816
public LTTngDataProcessor(
19-
ISourceParser<LTTngEvent, LTTngContext, string> sourceParser,
20-
ProcessorOptions options,
21-
IApplicationEnvironment applicationEnvironment,
22-
IProcessorEnvironment processorEnvironment,
23-
IReadOnlyDictionary<TableDescriptor, Action<ITableBuilder, IDataExtensionRetrieval>> allTablesMapping,
24-
IEnumerable<TableDescriptor> metadataTables)
25-
: base(sourceParser, options, applicationEnvironment, processorEnvironment, allTablesMapping, metadataTables)
17+
ISourceParser<LTTngEvent, LTTngContext, string> sourceParser,
18+
ProcessorOptions options,
19+
IApplicationEnvironment applicationEnvironment,
20+
IProcessorEnvironment processorEnvironment)
21+
: base(sourceParser, options, applicationEnvironment, processorEnvironment)
2622
{
2723
}
2824

2925
protected override void BuildTableCore(
30-
TableDescriptor tableDescriptor,
31-
Action<ITableBuilder, IDataExtensionRetrieval> createTable,
26+
TableDescriptor tableDescriptor,
3227
ITableBuilder tableBuilder)
3328
{
3429
if (tableDescriptor.IsMetadataTable)
@@ -38,14 +33,14 @@ protected override void BuildTableCore(
3833
}
3934

4035
private void BuildMetadataTable(
41-
TableDescriptor tableDescriptor,
36+
TableDescriptor tableDescriptor,
4237
ITableBuilder tableBuilder)
4338
{
4439
if (tableDescriptor.Guid == TraceStatsTable.TableDescriptor.Guid)
4540
{
4641
TraceStatsTable.BuildMetadataTable(
47-
tableBuilder,
48-
this.SourceParser as LTTngSourceParser,
42+
tableBuilder,
43+
this.SourceParser as LTTngSourceParser,
4944
this.ApplicationEnvironment.Serializer);
5045
}
5146
}

LTTngCds/LTTngDataSource.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ protected override ICustomDataProcessor CreateProcessorCore(
8989
sourceParser,
9090
options,
9191
this.applicationEnvironment,
92-
processorEnvironment,
93-
this.AllTables,
94-
this.MetadataTables);
92+
processorEnvironment);
9593
}
9694
}
9795
}

LTTngCds/LTTngSourceParser.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace LTTngCds
2121
{
2222
internal sealed class LTTngSourceParser
23-
: SourceParserBase<LTTngEvent, LTTngContext, string>,
23+
: SourceParser<LTTngEvent, LTTngContext, string>,
2424
IDisposable
2525
{
2626
private ICtfInput ctfInput;
@@ -61,7 +61,7 @@ public void SetFolderInput(string folderPath)
6161

6262
public Timestamp LastEventTimestamp { get; private set; }
6363

64-
public DateTime FirstEventWallClock { get; private set;}
64+
public DateTime FirstEventWallClock { get; private set; }
6565

6666
public ulong ProcessingTimeInMilliseconds { get; private set; }
6767

@@ -70,8 +70,8 @@ public void SetFolderInput(string folderPath)
7070
internal Dictionary<string, TraceStatsData> TraceStats = new Dictionary<string, TraceStatsData>(StringComparer.Ordinal);
7171

7272
public override void ProcessSource(
73-
ISourceDataProcessor<LTTngEvent, LTTngContext, string> dataProcessor,
74-
ILogger logger,
73+
ISourceDataProcessor<LTTngEvent, LTTngContext, string> dataProcessor,
74+
ILogger logger,
7575
IProgress<int> progress,
7676
CancellationToken cancellationToken)
7777
{
@@ -111,10 +111,10 @@ void EventCallback(LTTngEvent lttngEvent, LTTngContext lttngContext)
111111
lttngCustomization.RegisterEventCallback(EventCallback);
112112

113113
var playback = new CtfPlayback.CtfPlayback(lttngCustomization, cancellationToken);
114-
playback.Playback(this.ctfInput, new CtfPlaybackOptions {ReadAhead = true}, progressReport);
114+
playback.Playback(this.ctfInput, new CtfPlaybackOptions { ReadAhead = true }, progressReport);
115115

116116
sw.Stop();
117-
this.ProcessingTimeInMilliseconds = (ulong) sw.ElapsedMilliseconds;
117+
this.ProcessingTimeInMilliseconds = (ulong)sw.ElapsedMilliseconds;
118118
}
119119

120120
{

LTTngCds/MetadataTables/TraceStatsTable.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System;
55
using System.Collections.Generic;
66
using System.Linq;
7-
using Microsoft.Performance.SDK.Extensibility;
87
using Microsoft.Performance.SDK.Processing;
98

109
namespace LTTngCds.MetadataTables
@@ -32,7 +31,7 @@ public class TraceStatsTable
3231
new ColumnMetadata(new Guid("{A804856F-698E-4BE6-8408-36B538D46813}"), "Total Payload Size"),
3332
new UIHints { Width = 80, TextAlignment = TextAlignment.Left, });
3433

35-
internal static void BuildMetadataTable(ITableBuilder tableBuilder, LTTngSourceParser sourceParser, ISerializer serializer)
34+
internal static void BuildMetadataTable(ITableBuilder tableBuilder, LTTngSourceParser sourceParser, ITableConfigurationsSerializer serializer)
3635
{
3736
ITableBuilderWithRowCount table = tableBuilder.SetRowCount(sourceParser.TraceStats.Count);
3837

@@ -44,23 +43,23 @@ internal static void BuildMetadataTable(ITableBuilder tableBuilder, LTTngSourceP
4443
var payloadBitCountProjection = traceStatsProjection.Compose(traceStats => (double)traceStats.PayloadBitCount / 8);
4544

4645
table.AddColumn(
47-
new BaseDataColumn<string>(
46+
new DataColumn<string>(
4847
EventNameConfiguration,
4948
eventNameProjection));
5049

5150
table.AddColumn(
52-
new BaseDataColumn<ulong>(
51+
new DataColumn<ulong>(
5352
CountConfiguration,
5453
eventCountProjection));
5554

5655
table.AddColumn(
57-
new BaseDataColumn<double>(
56+
new DataColumn<double>(
5857
TotalPayloadSizeConfiguration,
5958
payloadBitCountProjection));
6059

6160
var configurations = TableConfigurations.GetPrebuiltTableConfigurations(
62-
typeof(TraceStatsTable),
63-
TableDescriptor.Guid,
61+
typeof(TraceStatsTable),
62+
TableDescriptor.Guid,
6463
serializer);
6564

6665
foreach (var configuration in configurations)

LTTngDataExtUnitTest/LTTngDataExtUnitTest.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
@@ -8,9 +8,9 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
11-
<PackageReference Include="Microsoft.Performance.SDK" Version="0.109.24" />
12-
<PackageReference Include="Microsoft.Performance.SDK.Runtime" Version="0.109.24" />
13-
<PackageReference Include="Microsoft.Performance.Toolkit.Engine" Version="0.109.24" />
11+
<PackageReference Include="Microsoft.Performance.SDK" Version="1.0.9-rc1" />
12+
<PackageReference Include="Microsoft.Performance.SDK.Runtime" Version="1.0.9-rc1" />
13+
<PackageReference Include="Microsoft.Performance.Toolkit.Engine" Version="1.0.9-rc1" />
1414
<PackageReference Include="Moq" Version="4.16.1" />
1515
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
1616
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />

LTTngDataExtUnitTest/LTTngUnitTest.cs

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44
using System;
55
using System.Collections.Generic;
66
using System.IO;
7-
using LTTngDataExtensions.SourceDataCookers;
7+
using System.IO.Compression;
8+
using System.Linq;
89
using LTTngDataExtensions.DataOutputTypes;
10+
using LTTngDataExtensions.SourceDataCookers;
11+
using LTTngDataExtensions.SourceDataCookers.Diagnostic_Messages;
12+
using LTTngDataExtensions.SourceDataCookers.Disk;
13+
using LTTngDataExtensions.SourceDataCookers.Module;
914
using LTTngDataExtensions.SourceDataCookers.Syscall;
1015
using LTTngDataExtensions.SourceDataCookers.Thread;
1116
using Microsoft.Performance.SDK.Extensibility;
1217
using Microsoft.Performance.SDK.Processing;
1318
using Microsoft.Performance.Toolkit.Engine;
1419
using Microsoft.VisualStudio.TestTools.UnitTesting;
15-
using UnitTestCommon;
16-
using LTTngDataExtensions.SourceDataCookers.Diagnostic_Messages;
17-
using LTTngDataExtensions.SourceDataCookers.Module;
18-
using LTTngDataExtensions.SourceDataCookers.Disk;
19-
using System.IO.Compression;
20-
using System.Linq;
2120

2221
namespace LTTngDataExtUnitTest
2322
{
@@ -48,41 +47,39 @@ public static void ProcessTrace()
4847
Assert.IsTrue(lttngDataPath.Exists);
4948

5049
// Approach #1 - Engine - Doesn't test tables UI but tests processing
51-
var runtime = Engine.Create();
52-
53-
runtime.AddFile(lttngDataPath.FullName);
54-
55-
// Enable our various types of data
56-
var lttngGenericEventDataCooker = new LTTngGenericEventDataCooker();
57-
LTTngGenericEventDataCookerPath = lttngGenericEventDataCooker.Path;
58-
runtime.EnableCooker(LTTngGenericEventDataCookerPath);
59-
60-
var lttngSyscallDataCooker = new LTTngSyscallDataCooker();
61-
LTTngSyscallDataCookerPath = lttngSyscallDataCooker.Path;
62-
runtime.EnableCooker(LTTngSyscallDataCookerPath);
63-
64-
var lttngThreadDataCooker = new LTTngThreadDataCooker();
65-
LTTngThreadDataCookerPath = lttngThreadDataCooker.Path;
66-
runtime.EnableCooker(LTTngThreadDataCookerPath);
67-
68-
var lttngDmesgDataCooker = new LTTngDmesgDataCooker();
69-
LTTngDmesgDataCookerPath = lttngDmesgDataCooker.Path;
70-
runtime.EnableCooker(LTTngDmesgDataCookerPath);
71-
72-
var lttngModuleDataCooker = new LTTngModuleDataCooker();
73-
LTTngModuleDataCookerPath = lttngModuleDataCooker.Path;
74-
runtime.EnableCooker(LTTngModuleDataCookerPath);
75-
76-
var lttngDiskDataCooker = new LTTngDiskDataCooker();
77-
LTTngDiskDataCookerPath = lttngDiskDataCooker.Path;
78-
runtime.EnableCooker(LTTngDiskDataCookerPath);
79-
80-
//
81-
// Process our data.
82-
//
83-
84-
RuntimeExecutionResults = runtime.Process();
85-
50+
var runtime = Engine.Create(new FileDataSource(lttngDataPath.FullName));
51+
52+
// Enable our various types of data
53+
var lttngGenericEventDataCooker = new LTTngGenericEventDataCooker();
54+
LTTngGenericEventDataCookerPath = lttngGenericEventDataCooker.Path;
55+
runtime.EnableCooker(LTTngGenericEventDataCookerPath);
56+
57+
var lttngSyscallDataCooker = new LTTngSyscallDataCooker();
58+
LTTngSyscallDataCookerPath = lttngSyscallDataCooker.Path;
59+
runtime.EnableCooker(LTTngSyscallDataCookerPath);
60+
61+
var lttngThreadDataCooker = new LTTngThreadDataCooker();
62+
LTTngThreadDataCookerPath = lttngThreadDataCooker.Path;
63+
runtime.EnableCooker(LTTngThreadDataCookerPath);
64+
65+
var lttngDmesgDataCooker = new LTTngDmesgDataCooker();
66+
LTTngDmesgDataCookerPath = lttngDmesgDataCooker.Path;
67+
runtime.EnableCooker(LTTngDmesgDataCookerPath);
68+
69+
var lttngModuleDataCooker = new LTTngModuleDataCooker();
70+
LTTngModuleDataCookerPath = lttngModuleDataCooker.Path;
71+
runtime.EnableCooker(LTTngModuleDataCookerPath);
72+
73+
var lttngDiskDataCooker = new LTTngDiskDataCooker();
74+
LTTngDiskDataCookerPath = lttngDiskDataCooker.Path;
75+
runtime.EnableCooker(LTTngDiskDataCookerPath);
76+
77+
//
78+
// Process our data.
79+
//
80+
81+
RuntimeExecutionResults = runtime.Process();
82+
8683
IsTraceProcessed = true;
8784
}
8885
}
@@ -96,18 +93,29 @@ public void ProcessTraceAsFolder()
9693

9794
string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
9895

99-
ZipFile.ExtractToDirectory(lttngData[0], tempDirectory);
100-
101-
// Approach #1 - Engine - Doesn't test tables UI but tests processing
102-
var runtime = Engine.Create();
103-
104-
var ds = new DirectoryDataSource(tempDirectory);
105-
runtime.AddDataSource(ds);
106-
107-
Assert.IsTrue(ds.IsDirectory());
108-
Assert.IsTrue(runtime.SourceDataCookers.Count() >= 1);
109-
Assert.IsTrue(runtime.AvailableTables.Count() >= 1);
110-
96+
using (var zipFile = ZipFile.OpenRead(lttngData[0]))
97+
{
98+
zipFile.ExtractToDirectory(tempDirectory);
99+
}
100+
101+
using (var dataSourceSet = DataSourceSet.Create())
102+
{
103+
var ds = new DirectoryDataSource(tempDirectory);
104+
dataSourceSet.AddDataSource(ds);
105+
106+
// Approach #1 - Engine - Doesn't test tables UI but tests processing
107+
using (var runtime = Engine.Create(new EngineCreateInfo(dataSourceSet.AsReadOnly())))
108+
{
109+
//
110+
// We do not assert that any cookers are enabled since we did not explicitly enable cookers here
111+
//
112+
113+
Assert.IsTrue(ds.IsDirectory());
114+
Assert.IsTrue(runtime.AvailableTables.Count() >= 1);
115+
}
116+
}
117+
118+
111119
Directory.Delete(tempDirectory, true);
112120
}
113121

LTTngDataExtensions/LTTngDataExtensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</ItemGroup>
6565

6666
<ItemGroup>
67-
<PackageReference Include="Microsoft.Performance.SDK" Version="0.109.24" />
67+
<PackageReference Include="Microsoft.Performance.SDK" Version="1.0.9-rc1" />
6868
</ItemGroup>
6969

7070
<ItemGroup>

0 commit comments

Comments
 (0)