Skip to content

Commit

Permalink
Merge pull request #1615 from brianrob/merge-feature-perfview-3.0
Browse files Browse the repository at this point in the history
Merge feature/perfview-3.0 into main
  • Loading branch information
brianrob authored Apr 19, 2022
2 parents b386758 + a69673d commit afba4ef
Show file tree
Hide file tree
Showing 46 changed files with 133 additions and 256 deletions.
2 changes: 0 additions & 2 deletions PerfView.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CtfTracing.Tests", "src\Tra
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TraceEvent.Tests", "src\TraceEvent\TraceEvent.Tests\TraceEvent.Tests.csproj", "{19281902-FBC4-48C0-962B-9FDADAF5C783}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfView64", "src\PerfView64\PerfView64.csproj", "{F7419073-A62B-42E0-9B8C-4C2C4CE243A3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfView.Tests", "src\PerfView.Tests\PerfView.Tests.csproj", "{A0248EF2-8C39-478A-951E-324DDF4FF3EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfView.TestUtilities", "src\PerfView.TestUtilities\PerfView.TestUtilities.csproj", "{FE5CC86D-E87E-4560-8004-8852F3DE6794}"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ PerfView is developed in Visual Studio 2019 using features through C# 6.

You will want to deploy the 'Release' rather than the 'Debug' version of PerfView. Thus, first set your build configuration
to 'Release' (Text window in the top toolbar, or right click on the .SLN file -> Configuration Manager -> Active Solution Configuration).
Next build (Build -> Build Solution (Ctrl-Shift-B)). The result will be that in the src\perfView\bin\net45\Release directory there will be
Next build (Build -> Build Solution (Ctrl-Shift-B)). The result will be that in the src\perfView\bin\net462\Release directory there will be
among other things a PerfView.exe. This one file is all you need to deploy. Simply copy it to where you wish to deploy the app.

### Information for build troubleshooting.
Expand Down
2 changes: 1 addition & 1 deletion src/CSVReader/CSVReader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net462</TargetFramework>

<Description>CSVReader</Description>
<Company>Microsoft</Company>
Expand Down
8 changes: 4 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

<PropertyGroup>
<!-- These are the versions of the things we are CREATING in this repository -->
<PerfViewVersion>2.0.77</PerfViewVersion>
<TraceEventVersion>2.0.77</TraceEventVersion>
<PerfViewVersion>3.0.0</PerfViewVersion>
<TraceEventVersion>3.0.0</TraceEventVersion>
</PropertyGroup>

<!-- versions of dependencies that more than one project use -->
Expand All @@ -32,8 +32,8 @@
<MicrosoftDiagnosticsTracingTraceEventSupportFilesVersion>1.0.23</MicrosoftDiagnosticsTracingTraceEventSupportFilesVersion>
<MicrosoftDiagnosticsTracingTraceEventAutomatedAnalysisAnalyzersVersion>0.1.1</MicrosoftDiagnosticsTracingTraceEventAutomatedAnalysisAnalyzersVersion>
<MicrosoftDiagnosticsRuntimeVersion>1.1.37504</MicrosoftDiagnosticsRuntimeVersion>
<XunitVersion>2.3.0</XunitVersion>
<XunitRunnerVisualstudioVersion>2.3.0</XunitRunnerVisualstudioVersion>
<XunitVersion>2.4.0</XunitVersion>
<XunitRunnerVisualstudioVersion>2.4.0</XunitRunnerVisualstudioVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/EtwClrProfilerSigning/EtwClrProfilerSigning.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<PropertyGroup>
<OutputType>library</OutputType>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net462</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/EtwHeapDump/EtwHeapDump.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
<RootNamespace>Microsoft.Diagnostics.EtwHeapDump</RootNamespace>
<AssemblyName>Microsoft.Diagnostics.EtwHeapDump</AssemblyName>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/FastSerialization/FastSerialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ enum StreamReaderAlignment : int
#endif
sealed class SerializationConfiguration
{
public StreamLabelWidth StreamLabelWidth { get; set; }
public StreamLabelWidth StreamLabelWidth { get; set; } = StreamLabelWidth.EightBytes;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/FastSerialization/FastSerialization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net462;netstandard1.3</TargetFrameworks>
<RootNamespace>Microsoft.Diagnostics.FastSerialization</RootNamespace>
<AssemblyName>Microsoft.Diagnostics.FastSerialization</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
6 changes: 3 additions & 3 deletions src/HeapDump/GCHeapDump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
public class GCHeapDump : IFastSerializable, IFastSerializableVersion
{
public GCHeapDump(string inputFileName) :
this(new Deserializer(inputFileName))
this(new Deserializer(inputFileName, new SerializationConfiguration() { StreamLabelWidth = StreamLabelWidth.FourBytes }))
{ }

public GCHeapDump(Stream inputStream, string streamName) :
this(new Deserializer(inputStream, streamName))
this(new Deserializer(inputStream, streamName, new SerializationConfiguration() { StreamLabelWidth = StreamLabelWidth.FourBytes }))
{ }

/// <summary>
Expand Down Expand Up @@ -192,7 +192,7 @@ public static Dictionary<int, ProcessInfo> GetProcessesWithGCHeaps()
private void Write(string outputFileName)
{
Debug.Assert(MemoryGraph != null);
var serializer = new Serializer(outputFileName, this);
var serializer = new Serializer(new IOStreamStreamWriter(outputFileName, config: new SerializationConfiguration() { StreamLabelWidth = StreamLabelWidth.FourBytes }), this);
serializer.Close();
}

Expand Down
4 changes: 2 additions & 2 deletions src/HeapDump/GCHeapDumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ private void WriteData(bool logLiveStats)
if (m_outputFileName != null)
{
m_log.WriteLine("{0,5:f1}s: Started Writing to file.", m_sw.Elapsed.TotalSeconds);
var serializer = new Serializer(m_outputFileName, m_gcHeapDump);
var serializer = new Serializer(new IOStreamStreamWriter(m_outputFileName, config: new SerializationConfiguration() { StreamLabelWidth = StreamLabelWidth.FourBytes }), m_gcHeapDump);
serializer.Close();

m_log.WriteLine("Actual file size = {0:f3}MB", new FileInfo(m_outputFileName).Length / 1000000.0);
Expand All @@ -1531,7 +1531,7 @@ private void WriteData(bool logLiveStats)
if (m_outputStream != null)
{
m_log.WriteLine("{0,5:f1}s: Started Writing to stream.", m_sw.Elapsed.TotalSeconds);
var serializer = new Serializer(m_outputStream, m_gcHeapDump);
var serializer = new Serializer(new IOStreamStreamWriter(m_outputStream, config: new SerializationConfiguration() { StreamLabelWidth = StreamLabelWidth.FourBytes }), m_gcHeapDump);
serializer.Close();
}

Expand Down
2 changes: 1 addition & 1 deletion src/HeapDump/HeapDump.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
<Platforms>AnyCPU;x64</Platforms>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion src/HeapDumpDLL/HeapDumpDLL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
<RootNamespace>Microsoft.Diagnostics.HeapDump</RootNamespace>
<AssemblyName>Microsoft.Diagnostics.HeapDump</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion src/LinuxEvent.Tests/LinuxTracing.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net46</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Description>Unit tests.</Description>
<Copyright>Copyright © Microsoft 2016</Copyright>
Expand Down
2 changes: 1 addition & 1 deletion src/MemoryGraph/MemoryGraph.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<RootNamespace>Microsoft.Diagnostics.MemoryGraph</RootNamespace>
<AssemblyName>Microsoft.Diagnostics.MemoryGraph</AssemblyName>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/PerfView.TestUtilities/PerfView.TestUtilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net462</TargetFramework>
<Description>Unit test utility library.</Description>
<Copyright>Copyright © Microsoft 2017</Copyright>

Expand Down
2 changes: 1 addition & 1 deletion src/PerfView.Tests/PerfView.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net46</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
<RootNamespace>PerfViewTests</RootNamespace>
<AssemblyName>PerfViewTests</AssemblyName>
<Description>Unit tests for PerfView.</Description>
Expand Down
2 changes: 1 addition & 1 deletion src/PerfView/CommandLineArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static string GetHelpString(int maxLineWidth)
public string FocusProcess; // The target process for CLR Rundown.
public bool NoRundown;
public bool NoNGenPdbs;
public bool NoNGenRundown;
public bool NoNGenRundown = true;
public bool NoClrRundown;
public bool NoV2Rundown;
public bool LowPriority;
Expand Down
3 changes: 3 additions & 0 deletions src/PerfView/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="_Options">
<MenuItem Header="Navigate to last used directory on launch." x:Name="Option_OpenToLastUsedDirectory" IsCheckable="true" Click="ToggleOpenToLastUsedDirectory" ToolTip="When launching PerfView, navigate to the last opened directory instead of the current working directory."/>
</MenuItem>
<MenuItem Header="_Help">
<MenuItem Header="_Help on Main View" Command="Help" CommandParameter="MainViewerQuickStart" />
<MenuItem Header="_Users Guide" Command="{x:Static src:MainWindow.UsersGuideCommand}" CommandParameter="UsersGuide"/>
Expand Down
29 changes: 27 additions & 2 deletions src/PerfView/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows;
Expand Down Expand Up @@ -1123,13 +1124,37 @@ public MainWindow()
AppLog.LogUsage("Exiting");
};

// Initialize configuration options.
InitializeOpenToLastUsedDirectory();

InitializeFeedback();
}
public PerfViewDirectory CurrentDirectory { get { return m_CurrentDirectory; } }

public void InitializeOpenToLastUsedDirectory()
{
bool currentValue;
bool.TryParse(App.UserConfigData["OpenToLastUsedDirectory"], out currentValue);
Option_OpenToLastUsedDirectory.IsChecked = currentValue;
}

public void ToggleOpenToLastUsedDirectory(object sender, RoutedEventArgs e)
{
bool currentValue;
bool.TryParse(App.UserConfigData["OpenToLastUsedDirectory"], out currentValue);
bool newValue = !currentValue;
App.UserConfigData["OpenToLastUsedDirectory"] = newValue.ToString();
Option_OpenToLastUsedDirectory.IsChecked = newValue;
}

public void OpenPreviouslyOpened()
{
OpenPath(App.UserConfigData["Directory"] ?? ".");
string path = ".";
if (bool.TryParse(App.UserConfigData["OpenToLastUsedDirectory"], out bool openToLastUsedDirectory) && openToLastUsedDirectory)
{
path = App.UserConfigData["Directory"] ?? ".";
}
OpenPath(path);
}

/// <summary>
Expand Down Expand Up @@ -1173,7 +1198,7 @@ public void OpenPath(string path, bool force = false)
m_CurrentDirectory = new PerfViewDirectory(fullPath);
UpdateFileFilter();

string appName = Environment.Is64BitProcess ? "PerfView64" : "PerfView";
string appName = "PerfView";
string elevatedSuffix = (TraceEventSession.IsElevated() ?? false) ? " (Administrator)" : "";
Title = appName + " " + CurrentDirectory.FilePath + elevatedSuffix;
}
Expand Down
12 changes: 6 additions & 6 deletions src/PerfView/PerfView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net462</TargetFramework>
<OutputType>WinExe</OutputType>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Prefer32Bit>True</Prefer32Bit>
<StartupObject>PerfView.App</StartupObject>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<ExtrasEnableWpfProjectSetup>true</ExtrasEnableWpfProjectSetup>
Expand Down Expand Up @@ -40,6 +39,7 @@

<PropertyGroup>
<ApplicationIcon>performance.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -241,14 +241,14 @@
<Link>amd64\vcruntime140_1.dll</Link>
<Visible>False</Visible>
</EmbeddedResource>
<EmbeddedResource Include="..\HeapDump\bin\x64\$(Configuration)\net45\HeapDump.exe">
<EmbeddedResource Include="..\HeapDump\bin\x64\$(Configuration)\net462\HeapDump.exe">
<Type>Non-Resx</Type>
<WithCulture>false</WithCulture>
<LogicalName>.\amd64\HeapDump.exe</LogicalName>
<Link>amd64\HeapDump.exe</Link>
<Visible>False</Visible>
</EmbeddedResource>
<EmbeddedResource Include="..\HeapDump\bin\x64\$(Configuration)\net45\HeapDump.exe.config">
<EmbeddedResource Include="..\HeapDump\bin\x64\$(Configuration)\net462\HeapDump.exe.config">
<Type>Non-Resx</Type>
<WithCulture>false</WithCulture>
<LogicalName>.\amd64\HeapDump.exe.config</LogicalName>
Expand All @@ -263,14 +263,14 @@
<Visible>False</Visible>
</EmbeddedResource>
<!-- For Forcing GC and per-object allocation stats -->
<EmbeddedResource Include="..\EtwClrProfilerSigning\bin\$(Configuration)\net45\x86\EtwClrProfiler.dll">
<EmbeddedResource Include="..\EtwClrProfilerSigning\bin\$(Configuration)\net462\x86\EtwClrProfiler.dll">
<Type>Non-Resx</Type>
<WithCulture>false</WithCulture>
<LogicalName>.\x86\EtwClrProfiler.dll</LogicalName>
<Link>x86\EtwClrProfiler.dll</Link>
<Visible>False</Visible>
</EmbeddedResource>
<EmbeddedResource Include="..\EtwClrProfilerSigning\bin\$(Configuration)\net45\amd64\EtwClrProfiler.dll">
<EmbeddedResource Include="..\EtwClrProfilerSigning\bin\$(Configuration)\net462\amd64\EtwClrProfiler.dll">
<Type>Non-Resx</Type>
<WithCulture>false</WithCulture>
<LogicalName>.\amd64\EtwClrProfiler.dll</LogicalName>
Expand Down
Loading

0 comments on commit afba4ef

Please sign in to comment.