Skip to content

Commit

Permalink
Perfetto - Upgrade to latest Perfetto v38 and Protobuf 3.25.0 /w .pdb (
Browse files Browse the repository at this point in the history
…#115)

* Perfetto - Upgrade to latest Perfetto v38 and Protobuf 3.25.0 /w .pdb
  • Loading branch information
ivberg authored Nov 7, 2023
1 parent 80dc175 commit 3170e29
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
5 changes: 3 additions & 2 deletions PerfettoCds/PerfettoCds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.21.11">
<PackageReference Include="Google.Protobuf" Version="3.25.0">
<GeneratePathProperty>true</GeneratePathProperty>
</PackageReference>
<PackageReference Include="Microsoft.Performance.SDK" Version="1.0.16" />
Expand All @@ -30,7 +30,7 @@
<Target Name="DownloadTraceProcessorShell">
<!-- Keep in sync with other DownloadTraceProcessorShell Targets -->
<!-- Download the trace_processor.exe from Perfetto's GitHub release and copy it to the output directory-->
<DownloadFile SourceUrl="https://github.com/google/perfetto/releases/download/v24.2/windows-amd64.zip" DestinationFolder="$(TargetDir)" />
<DownloadFile SourceUrl="https://github.com/google/perfetto/releases/download/v38.0/windows-amd64.zip" DestinationFolder="$(TargetDir)" />
<Unzip SourceFiles="$(TargetDir)\windows-amd64.zip" DestinationFolder="$(TargetDir)" />
<Copy SourceFiles="$(TargetDir)\windows-amd64\trace_processor_shell.exe" DestinationFolder="$(TargetDir)" />
<RemoveDir Directories="$(TargetDir)\windows-amd64" />
Expand Down Expand Up @@ -58,6 +58,7 @@

<Target Name="CopyRulesToTarget" AfterTargets="Build">
<Copy SourceFiles="$(PkgGoogle_Protobuf)\lib\netstandard2.0\Google.Protobuf.dll" DestinationFolder="$(TargetDir)" />
<Copy SourceFiles="$(PkgGoogle_Protobuf)\lib\netstandard2.0\Google.Protobuf.pdb" DestinationFolder="$(TargetDir)" />
<!-- Download trace_processor_shell to the output directory if it doesn't exist -->
<CallTarget Condition="!Exists('$(TargetDir)\trace_processor_shell.exe')" Targets="DownloadTraceProcessorShell" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion PerfettoCds/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": "Microsoft.Performance.Toolkit.Plugins.PerfettoPlugin",
"version": "1.5.4"
"version": "1.5.5"
},
"displayName": "Perfetto for Android and Chromium logs",
"description": "Perfetto Android & Chromium (CPU Scheduling, CPU Sampling, CPU Frequency, FTrace, Android Logs, Generic Events / Default Tracks, GPU Counters, Jank Detection, Processes, Android Packages) - https://perfetto.dev/",
Expand Down
4 changes: 2 additions & 2 deletions PerfettoProcessor/PerfettoProcessor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>1.5.1</Version>
<Version>1.5.5</Version>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Authors>Microsoft</Authors>
<Company>Microsoft Corp.</Company>
Expand All @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.21.11">
<PackageReference Include="Google.Protobuf" Version="3.25.0">
<GeneratePathProperty>true</GeneratePathProperty>
</PackageReference>
</ItemGroup>
Expand Down
15 changes: 8 additions & 7 deletions PerfettoUnitTest/PerfettoUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void TestAndroidTrace()
Assert.IsTrue(cpuSchedEventData[0].ThreadName == "kworker/u17:9 (834)");
Assert.IsTrue(cpuSchedEventData[1].EndState == "Task Dead");
Assert.IsTrue(cpuSchedEventData[0].ProcessName == string.Empty);
Assert.IsTrue(cpuSchedEventData[5801].EndState == "Runnable");
Assert.IsTrue(cpuSchedEventData[5801].EndState == "Runnable (Preempted)");
Assert.IsTrue(cpuSchedEventData[5801].ThreadName == "TraceLogApiTest (20855)");
Assert.IsTrue(cpuSchedEventData[5801].ProcessName == "TraceLogApiTest (20855)");

Expand Down Expand Up @@ -203,21 +203,22 @@ public void TestAndroid12Trace()
PerfettoPluginConstants.ProcessEventCookerPath,
nameof(PerfettoProcessEventCooker.ProcessEvents)));

Assert.IsTrue(processEventData.Count == 121);
Assert.IsTrue(processEventData.Count == 266);
Assert.IsTrue(processEventData[1].AndroidAppId == 10135);
Assert.IsTrue(processEventData[1].Uid == 10135);
Assert.IsTrue(processEventData[1].CmdLine == "com.android.systemui");
Assert.IsTrue(processEventData[1].ParentUpid == 25);
Assert.IsTrue(processEventData[1].ParentUpid == 158);
Assert.IsTrue(processEventData[1].ParentProcess != null && processEventData[1].ParentProcess.Name == "zygote64");
Assert.IsTrue(processEventData[1].Pid == 980);
Assert.IsTrue(processEventData[1].Upid == 1);
Assert.IsTrue(processEventData[1].StartTimestamp == Timestamp.Zero); // NULL should be at trace start
Assert.IsTrue(processEventData[1].EndTimestamp == new Timestamp(39446647558)); // NULL should be at trace stop

Assert.IsTrue(processEventData[119].StartTimestamp == new Timestamp(33970357558));
Assert.IsTrue(processEventData[119].EndTimestamp == new Timestamp(34203203358));
Assert.IsTrue(processEventData[119].ParentProcess != null && processEventData[119].ParentProcess.Name == "/apex/com.android.adbd/bin/adbd");
UnitTest.TestTableBuild(RuntimeExecutionResults, PerfettoProcessTable.TableDescriptor, 121);
Assert.IsTrue(processEventData[264].StartTimestamp == new Timestamp(33970357558));
Assert.IsTrue(processEventData[264].EndTimestamp == new Timestamp(34203203358));
Assert.IsTrue(processEventData[264].ParentProcess != null && processEventData[264].ParentProcess.Name == "/apex/com.android.adbd/bin/adbd");
Assert.IsTrue(processEventData[264].CmdLine == "/system/bin/sh -c cat /proc/10628/cmdline");
UnitTest.TestTableBuild(RuntimeExecutionResults, PerfettoProcessTable.TableDescriptor, 266);

// Packages
var packagesList = RuntimeExecutionResults.QueryOutput<ProcessedEventData<PerfettoPackageListEvent>>(
Expand Down
2 changes: 1 addition & 1 deletion PerfettoUnitTest/PerfettoUnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<Target Name="DownloadTraceProcessorShell">
<!-- Keep in sync with other DownloadTraceProcessorShell Targets -->
<!-- Download the trace_processor.exe from Perfetto's GitHub release and copy it to the output directory-->
<DownloadFile SourceUrl="https://github.com/google/perfetto/releases/download/v24.2/windows-amd64.zip" DestinationFolder="$(TargetDir)" />
<DownloadFile SourceUrl="https://github.com/google/perfetto/releases/download/v38.0/windows-amd64.zip" DestinationFolder="$(TargetDir)" />
<Unzip SourceFiles="$(TargetDir)\windows-amd64.zip" DestinationFolder="$(TargetDir)" />
<Copy SourceFiles="$(TargetDir)\windows-amd64\trace_processor_shell.exe" DestinationFolder="$(TargetDir)" />
<RemoveDir Directories="$(TargetDir)\windows-amd64" />
Expand Down

0 comments on commit 3170e29

Please sign in to comment.