forked from microsoft/perfview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
318 lines (314 loc) · 24.7 KB
/
MainWindow.xaml
File metadata and controls
318 lines (314 loc) · 24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<Window x:Class="PerfView.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:PerfView"
xmlns:WPFToolKit="http://schemas.microsoft.com/wpf/2008/toolkit"
xmlns:controls="clr-namespace:Controls"
Closed="Window_Closed"
Title="PerfView" Height="535" Width="1000">
<Window.Resources>
<BitmapImage x:Key="FileBitmapImage" UriSource="images/VSProject_genericfile.png"/>
<BitmapImage x:Key="HeapFileBitmapImage" UriSource="images/VSProject_schema.png"/>
<BitmapImage x:Key="StackSourceBitmapImage" UriSource="images/VSProject_form.png"/>
<BitmapImage x:Key="EventSourceBitmapImage" UriSource="images/VSProject_cab.png"/>
<BitmapImage x:Key="FolderOpenBitmapImage" UriSource="images/VSFolder_open.png"/>
<BitmapImage x:Key="HtmlReportBitmapImage" UriSource="images/VSProject_html.png"/>
<BitmapImage x:Key="ChartBitmapImage" UriSource="images/Chart.png"/>
</Window.Resources>
<Window.CommandBindings>
<CommandBinding Command="{x:Static src:MainWindow.ItemHelpCommand}" Executed="DoItemHelp" CanExecute="CanDoItemHelp"/>
<CommandBinding Command="{x:Static src:MainWindow.OpenInBrowserCommand}" Executed="OpenInBrowser" CanExecute="CanOpenInBrowser"/>
<CommandBinding Command="{x:Static src:MainWindow.RunCommand}" Executed="DoRun"/>
<CommandBinding Command="{x:Static src:MainWindow.CollectCommand}" Executed="DoCollect"/>
<CommandBinding Command="{x:Static src:MainWindow.AbortCommand}" Executed="DoAbort"/>
<CommandBinding Command="{x:Static src:MainWindow.MergeCommand}" Executed="DoMerge"/>
<CommandBinding Command="{x:Static src:MainWindow.ZipCommand}" Executed="DoZip"/>
<CommandBinding Command="{x:Static src:MainWindow.UnZipCommand}" Executed="DoUnZip"/>
<CommandBinding Command="{x:Static src:MainWindow.HideCommand}" Executed="DoHide"/>
<CommandBinding Command="{x:Static src:MainWindow.UserCommand}" Executed="DoUserCommand"/>
<CommandBinding Command="{x:Static src:MainWindow.RefreshDirCommand}" Executed="DoRefreshDir"/>
<CommandBinding Command="{x:Static src:MainWindow.OpenCommand}" Executed="DoOpen"/>
<CommandBinding Command="{x:Static src:MainWindow.DeleteCommand}" Executed="DoDelete"/>
<CommandBinding Command="{x:Static src:MainWindow.RenameCommand}" Executed="DoRename"/>
<CommandBinding Command="{x:Static src:MainWindow.MakeLocalSymbolDirCommand}" Executed="DoMakeLocalSymbolDir"/>
<CommandBinding Command="{x:Static src:MainWindow.CloseCommand}" Executed="DoClose"/>
<CommandBinding Command="{x:Static src:MainWindow.CancelCommand}" Executed="DoCancel"/>
<CommandBinding Command="{x:Static src:MainWindow.UsersGuideCommand}" Executed="DoHyperlinkHelp"/>
<CommandBinding Command="{x:Static src:MainWindow.HeapSnapshotCommand}" Executed="DoTakeHeapSnapshot"/>
<CommandBinding Command="{x:Static src:MainWindow.DirectorySizeCommand}" Executed="DoDirectorySize"/>
<CommandBinding Command="{x:Static src:MainWindow.ImageSizeCommand}" Executed="DoImageSize"/>
<CommandBinding Command="{x:Static src:MainWindow.ILSizeCommand}" Executed="DoILSize"/>
<CommandBinding Command="{x:Static src:MainWindow.HeapSnapshotFromDumpCommand}" Executed="DoTakeHeapShapshotFromProcessDump"/>
<CommandBinding Command="Help" Executed="DoHyperlinkHelp"/>
<CommandBinding Command="{x:Static src:MainWindow.FocusDirectoryCommand}" Executed="DoFocusDirectory"/>
</Window.CommandBindings>
<Window.InputBindings>
<KeyBinding Gesture="CTRL+L" Command="{x:Static src:MainWindow.FocusDirectoryCommand}" />
</Window.InputBindings>
<DockPanel>
<Grid DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Menu Grid.Column="0" Background="#FFD1D1D1">
<MenuItem Header="_File">
<Separator/>
<MenuItem Header="_Hide" Command="{x:Static src:MainWindow.HideCommand}" ToolTip="Hides the current window (can reopen using windows explorer)"/>
<MenuItem Header="_Clear Temp Files" Click="DoClearTempFiles" ToolTip="Some operations create temporary files. This command clears all of these."/>
<MenuItem Header="Clear User Config" Click="DoClearUserConfig" ToolTip="Reset all user preferences back to their defaults when PerfView was first installed."/>
<MenuItem Header="Set Symbol _Path" Click="DoSetSymbolPath" ToolTip="Sets the locations to look for symbolic information (PDB files)."/>
<MenuItem Header="_User Command" Command="{x:Static src:MainWindow.UserCommand}" ToolTip="Run a User Defined Command."/>
<MenuItem Header="Go to Directory" Command="{x:Static src:MainWindow.FocusDirectoryCommand}" ToolTip="Focus and select the directory textbox."/>
<MenuItem Header="_Exit" Click="DoExit"/>
</MenuItem>
<MenuItem Header="_Collect">
<MenuItem Header="_Run" Command="{x:Static src:MainWindow.RunCommand}" ToolTip="Launch a program and collect data during its run. "/>
<MenuItem Header="_Collect" Command="{x:Static src:MainWindow.CollectCommand}" ToolTip="Collect data machine wide with explicit start and stop."/>
<MenuItem Header="_Abort" Command="{x:Static src:MainWindow.AbortCommand}" ToolTip="Abort any collection in progress."/>
<MenuItem Header="_Merge" Command="{x:Static src:MainWindow.MergeCommand}" ToolTip="Prepare files for analysis on another computer."/>
<MenuItem Header="Merge and Zip All" Click="DoMergeAndZipAll" ToolTip="Merge and zip all unmerged traces in the current folder."/>
</MenuItem>
<MenuItem Header="_Memory">
<MenuItem Header="_Take Heap Snapshot" Command="{x:Static src:MainWindow.HeapSnapshotCommand}" ToolTip="Take a snapshot of of the CLR GC Heap."/>
<MenuItem Header="Take Heap Snapshot From Dump" Command="{x:Static src:MainWindow.HeapSnapshotFromDumpCommand}" ToolTip="Take a snapshot of of the CLR GC Heap from a process Dump."/>
</MenuItem>
<MenuItem Header="Si_ze">
<MenuItem Header="_DirectorySize" Command="{x:Static src:MainWindow.DirectorySizeCommand}" ToolTip="Computes the disk usage (recursively) for a directory.">
<MenuItem.Icon>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"><Hyperlink Command="Help" CommandParameter="DirectorySize">?</Hyperlink></TextBlock>
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="ImageSizeMenuItem" Visibility="Collapsed" Header="_ImageSize" Command="{x:Static src:MainWindow.ImageSizeCommand}" ToolTip="Displays the breakdown of what is in a DLL or EXE by symbol. (needs PDB for DLL or EXE).">
<MenuItem.Icon>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"><Hyperlink Command="Help" CommandParameter="ImageSize">?</Hyperlink></TextBlock>
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="ILSizeMenuItem" Visibility="Collapsed" Header="ILSize" Command="{x:Static src:MainWindow.ILSizeCommand}" ToolTip="Displays the breakdown of what is in a DLL or EXE by symbol. (needs PDB for DLL or EXE).">
<MenuItem.Icon>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"><Hyperlink Command="Help" CommandParameter="ILSize">?</Hyperlink></TextBlock>
</MenuItem.Icon>
</MenuItem>
</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"/>
<MenuItem Name ="VideoMenuEntry" Header="Getting started _Videos" Click="DoVideoClick"/>
<MenuItem Header="Get the _Latest Version" Command="{x:Static src:MainWindow.UsersGuideCommand}" CommandParameter="LatestVersion"/>
<MenuItem Header="Give _Feedback or Ask a question" Click="DoFeedbackClick"/>
<MenuItem Header="_Reference Guide" Click="DoReferenceGuide"/>
<MenuItem Header="_Command Line Help" Click="DoCommandLineHelp"/>
<MenuItem Header="User Command Help" Click="DoUserCommandHelp"/>
<MenuItem Header="Multi-Scenarios Analysis" Command="{x:Static src:MainWindow.UsersGuideCommand}" CommandParameter="MultiScenarioAnalysis"/>
<MenuItem Header="_Extending Perfview" Command="{x:Static src:MainWindow.UsersGuideCommand}" CommandParameter="PerfViewExtensions"/>
<MenuItem Header="Viewing Linux Data" Command="{x:Static src:MainWindow.UsersGuideCommand}" CommandParameter="ViewingLinuxData"/>
<MenuItem Header="Viewing External Data" Command="{x:Static src:MainWindow.UsersGuideCommand}" CommandParameter="ViewingExternalData"/>
<MenuItem Header="Using EventSources" Command="{x:Static src:MainWindow.UsersGuideCommand}" CommandParameter="UsingEventSources"/>
<MenuItem Header="_Release Notes" Click="DoReleaseNotes"/>
<MenuItem Header="_About" Click="DoAbout"/>
</MenuItem>
</Menu>
<Rectangle Grid.Column="1" Grid.ColumnSpan="11" Fill="#FFD1D1D1"/>
<TextBlock Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3,0">
<Hyperlink Command="Help" CommandParameter="MainViewerQuickStart">Main View Help (F1)</Hyperlink>
</TextBlock>
<TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3,0,0,0">
<Hyperlink Command="Help" CommandParameter="Tutorial">Tutorial</Hyperlink>
</TextBlock>
<TextBlock Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3,0">
<Hyperlink Command="Help" CommandParameter="MainViewerTroubleshooting">Troubleshooting</Hyperlink>
</TextBlock>
<TextBlock Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3,0">
<Hyperlink Command="Help" CommandParameter="FAQ">FAQ</Hyperlink>
</TextBlock>
<TextBlock Grid.Column="5" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="3,0">
<Hyperlink Command="Help" CommandParameter="MainViewerTips">Tips</Hyperlink>
</TextBlock>
<TextBlock Grid.Column="6" Name="VideoLink" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10,0">
<Hyperlink Click="DoVideoClick">Videos</Hyperlink>
</TextBlock>
<Button Name="WikiButton" Grid.Column="7" Margin="5,1,10,1" Content="Wiki" FontSize="9"
ToolTip="Goto the PerfView Wiki." Click="DoWikiClick"/>
<Button Name="FeedbackButton" Grid.Column="8" Margin="5,1,10,1" Content="Feedback" FontSize="9"
ToolTip="Send feedback to the maintainers of PerfView." Click="DoFeedbackClick"/>
</Grid>
<src:StatusBar x:Name="StatusBar" DockPanel.Dock="Bottom"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="619*"/>
</Grid.ColumnDefinitions>
<DockPanel Background="Gray" Grid.Column="0">
<controls:HistoryComboBox x:Name="Directory" Margin="4,2,4,2" DockPanel.Dock="Top"
ToolTip="This is the directory to search for performance data files." TextEntered="DoTextEnteredInDirectoryTextBox" />
<Grid DockPanel.Dock="Top" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="100*"/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Grid.ColumnSpan="3" Fill="#FFD1D1D1"/>
<TextBlock Grid.Column="0" VerticalAlignment="Center" Margin="5,0,0,0" ToolTip="Only files that match this RegEx filter pattern are displayed.">
<Hyperlink Command="Help" CommandParameter="FileFilterTextBox">Filter:</Hyperlink>
</TextBlock>
<TextBox Name="FileFilterTextBox" TextChanged="FilterTextChanged" KeyDown="FilterKeyDown" Grid.Column="1" Margin="5,2,2,2" />
</Grid>
<TreeView x:Name="TreeView" Grid.Column="0" MouseDoubleClick="DoMouseDoubleClickInTreeView" KeyDown="KeyDownInTreeView" SelectedItemChanged="SelectedItemChangedInTreeView" PreviewMouseRightButtonDown="TreeView_PreviewMouseRightButtonDown"
ToolTip="Double Click to open. Right click contains additional help and additional options."
IsEnabled="{Binding ElementName=StatusBar, Path=IsNotWorking}" AllowDrop="True" Drop="DoDrop">
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
</Style>
</TreeView.ItemContainerStyle>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal">
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Command="{x:Static src:MainWindow.ItemHelpCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.OpenInBrowserCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.RefreshDirCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.OpenCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.CloseCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.DeleteCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.RenameCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.MergeCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.MakeLocalSymbolDirCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.ZipCommand}"/>
<MenuItem Command="{x:Static src:MainWindow.UnZipCommand}"/>
</ContextMenu>
</StackPanel.ContextMenu>
<Image Margin="0,0,5,0" Source="{Binding Icon}"/>
<TextBlock Text="{Binding Name}" />
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</DockPanel>
<GridSplitter Grid.Column="1" Width="3" HorizontalAlignment="Center" VerticalAlignment="Stretch"/>
<RichTextBox Name="Body" Grid.Column="2" Background="White" IsReadOnly="True" IsDocumentEnabled="True"
IsEnabled="{Binding ElementName=StatusBar, Path=IsNotWorking}" VerticalScrollBarVisibility="auto" Margin="4.667,0,-5,0.07">
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="Margin" Value="0"/>
</Style>
</RichTextBox.Resources>
<RichTextBox.Document>
<FlowDocument>
<Paragraph FontSize="14" FontWeight="Bold">
Welcome to PerfView!
</Paragraph>
<Paragraph Margin="0,2,0,0">PerfView is an application designed to simplify the collection and analysis of performance data.
</Paragraph>
<Paragraph Margin="0,4,0,0">Pressing the
<Bold>F1</Bold> key will give you help for current view.
Any blue hyperlinks in the UI also take you to help.
For an overview of PerfView see the
<Hyperlink Command="Help" CommandParameter="UsersGuide">User's Guide</Hyperlink> .
If you wish to ask a question that the documentation did not answer or if you have feedback or a bug report,
see the
<Hyperlink Command="Help" CommandParameter="Feedback">feedback instructions</Hyperlink> in the documentation.
</Paragraph>
<Paragraph Margin="0,4,0,0">
<Bold>If you are new to PerfView</Bold> , we strongly recommend reading the
<Hyperlink Command="Help" CommandParameter="Tutorial">tutorial</Hyperlink>
or watch the tutorial
<Hyperlink Click="DoVideoClick">videos</Hyperlink> .
It should only take 10-20 minutes to walk through. Also recommend is reading
<Hyperlink Command="Help" CommandParameter="WhatPerfViewCanDoForYou">what perfView can do for you</Hyperlink> .
</Paragraph>
<Paragraph Margin="0,8,0,0" FontWeight="Bold">Optimizing Time, or Unmanaged Memory: Collecting ETW Profile Data</Paragraph>
<Paragraph>PerfView can collect a time based ETW trace for investigating
<Bold>
<Hyperlink Command="Help" CommandParameter="CpuInvestigation">CPU</Hyperlink>
</Bold> and
<Bold>
<Hyperlink Command="Help" CommandParameter="MakingServerInvestigationEasy">Server Response Time</Hyperlink>
</Bold>, as well as
<Hyperlink Command="Help" CommandParameter="BlockedTimeInvestigation">Wall Clock / Blocked Time</Hyperlink> ,
<Hyperlink Command="Help" CommandParameter="UnmanagedMemoryAnalysis">Unmanaged memory</Hyperlink> or
<Hyperlink Command="Help" CommandParameter="GCHeapNetMemStacks">Managed memory</Hyperlink> .
For these cases PerfView has two ways of
<Hyperlink Command="Help" CommandParameter="CollectingData">collecting ETW trace data</Hyperlink> :
</Paragraph>
<List Margin="0,2,0,0">
<ListItem>
<Paragraph>
<Hyperlink Click="DoRun" >
<Bold>Run a command</Bold>
</Hyperlink> and collect data while the command is running. Collect->Run (Alt-R)
</Paragraph>
</ListItem>
<ListItem>
<Paragraph>
<Hyperlink Click="DoCollect">
<Bold>Collect data machine wide</Bold>
</Hyperlink> by starting and stopping collection manually. Collect->Collect (Alt-C)
</Paragraph>
</ListItem>
</List>
<Paragraph Margin="0,8,0,0" FontWeight="Bold">Optimizing Managed Memory: Collecting .NET Runtime Heap Data</Paragraph>
<Paragraph>PerfView can also collect data about the GC heap of a .NET Runtime process. See
<Hyperlink Command="Help" CommandParameter="MainViewerQuickStartGCHeap">GC Heap Quick Start</Hyperlink>
for more details.
</Paragraph>
<List Margin="0,2,0,0">
<ListItem>
<Paragraph>
<Hyperlink Click="DoTakeHeapSnapshot" >
<Bold>Take a heap snapshot</Bold>
</Hyperlink> of an existing process Memory->Take Heap Snapshot (Alt-S)
</Paragraph>
<Paragraph>
<Hyperlink Click="DoTakeHeapShapshotFromProcessDump" >
<Bold>To Take a heap snapshot from a Process Dump</Bold>
</Hyperlink> simply double click on the .DMP file in the file view to the left.
</Paragraph>
</ListItem>
</List>
<Paragraph/>
<Paragraph FontWeight="Bold">Viewing Existing Profile Data</Paragraph>
<Paragraph Margin="0,4,0,0">The result of data collection is data stored in data files of varying extensions.
The left pane is a list of file names in the current directory that PerfView knows how to open.
Simply double click on the file of interest to view the data. You can change the current directory
by either double clicking on a subdirectory or typing the name in the textbox in the upper left.
</Paragraph>
<Paragraph Margin="0,4,0,0">If the file contains more than one view of the data then double clicking on the object
populates children nodes in the treeview. Double clicking on one of the children will open the viewer for that
view.
<Bold>Right clicking and selecting 'Help on Item'</Bold> will take you to the help for that particular entry in the viewer.
There are two main viewers of profile data:
</Paragraph>
<List Margin="0,2,0,0">
<ListItem>
<Paragraph>A stack viewer which allows aggregation and filtering of events with associated stack traces.</Paragraph>
</ListItem>
<ListItem>
<Paragraph>An event viewer which allows filtering of time based events.</Paragraph>
</ListItem>
</List>
<Paragraph/>
<Paragraph FontWeight="Bold">Diffing Profile Data</Paragraph>
<Paragraph Margin="0,4,0,0">PerfView has the ability to determine the difference between two traces,
which is very useful in doing regression analysis. To use the Diff functionality first
view both traces in separate stack view windows and (if necessary) filter out all but the region
that represents an equivalent amount of work in each view.
Then use the Diff menu on the stack view window of the 'regressed' trace and to select the other
window as its baseline. See
<Hyperlink Command="Help" CommandParameter="Diff">Diff Help</Hyperlink> for more.
</Paragraph>
</FlowDocument>
</RichTextBox.Document>
</RichTextBox>
</Grid>
</DockPanel>
</Window>