Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 5a1ce59

Browse files
feat: WPERF-954 wpa plugin config
See merge request Linaro/WindowsPerf/vs-extension!110 === ChangeLog === * chore: fix build * chore: remove extra $ in path settings * WPERF-997 Spe hardcode filters See merge request Linaro/WindowsPerf/vs-extension!109 === ChangeLog === * add default SPE filters in case wperf list doesn't support it * chore: remove slopy extra empty line * feat: update SPE filters groupbox header and placeholder texts * feat: update spe sample displayed name to use the Feature name * fix: update typo when unchecking SPE checkbox * chore: make config check happen on each setting dialog call * feat: disable SPE button on if SPE is unavailable * feat: fix overhead percent in SPE output * fix: line highlighter errors * fix: lower case all filepaths * feat: added memory to the form * fix: add handleSPESamplingFinished call to the end of the sampling run * fix: trailing character on spe filter list * fix: remove default frequency on SPE * fix: update highlighter file paths to be case insensitive * feat: add SPE output handling * feat: start handling SPE sampling display * feat: add spe sampling settings feat: add default slelected directory in picker feat: add wpa plugins path default when checkbox is checked
1 parent 2396abf commit 5a1ce59

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

WindowsPerfGUI/Options/WPAOptions.xaml.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
using System.Windows.Controls;
3232
using System.Windows.Forms;
33+
using WindowsPerfGUI.Utils;
3334
using UserControl = System.Windows.Controls.UserControl;
3435

3536
namespace WindowsPerfGUI.Options
@@ -48,23 +49,19 @@ public WPAOptions()
4849

4950
public void Initialize()
5051
{
51-
string defaultSearchDir = Environment.GetEnvironmentVariable(
52-
"WPA_ADDITIONAL_SEARCH_DIRECTORIES"
53-
);
54-
5552
string checkboxLabel = "Use default search directory";
56-
if (!string.IsNullOrEmpty(defaultSearchDir))
53+
if (!string.IsNullOrEmpty(WperfDefaults.DefaultWPASearchDir))
5754
{
58-
checkboxLabel += $": {defaultSearchDir}";
55+
checkboxLabel += $": {WperfDefaults.DefaultWPASearchDir}";
5956
}
6057

6158
UseDefaultSearchLocation.Content = checkboxLabel;
6259

63-
if (!string.IsNullOrEmpty(defaultSearchDir))
60+
if (!string.IsNullOrEmpty(WperfDefaults.DefaultWPASearchDir))
6461
{
6562
EnvironmentVariableNotice.Visibility = System.Windows.Visibility.Visible;
6663
EnvironmentVariableNotice.Text =
67-
$"WPA_ADDITIONAL_SEARCH_DIRECTORIES=\"{defaultSearchDir}\"";
64+
$"WPA_ADDITIONAL_SEARCH_DIRECTORIES=\"{WperfDefaults.DefaultWPASearchDir}\"";
6865
}
6966
UseDefaultSearchLocation.IsChecked = WPerfOptions.Instance.UseDefaultSearchDirectory;
7067
CustomSearchDir.IsEnabled = !WPerfOptions.Instance.UseDefaultSearchDirectory;
@@ -78,6 +75,10 @@ private void UseDefaultSearchLocation_Click(object sender, System.Windows.Routed
7875
CustomSearchDir.IsEnabled = !newValue;
7976
SelectDirectoryButton.IsEnabled = !newValue;
8077
UseDefaultSearchLocation.IsChecked = newValue;
78+
if (newValue)
79+
{
80+
CustomSearchDir.Text = WperfDefaults.DefaultWPASearchDir;
81+
}
8182
WPerfOptions.Instance.UseDefaultSearchDirectory = newValue;
8283
WPerfOptions.Instance.Save();
8384
}

WindowsPerfGUI/Options/WPerfPath.xaml.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private void SetWperfVersion(WperfVersion wperfVersion, bool shouldForce = false
131131

132132
TextBlock componentLabel = TextBlockFactory(component, offset);
133133
TextBlock componentVersionLabel = TextBlockFactory(
134-
$"{componentVersion} ({gitVersion}) -- ${featureString}",
134+
$"{componentVersion} ({gitVersion}) -- {featureString}",
135135
offset,
136136
true
137137
);
@@ -144,7 +144,6 @@ private void SetWperfVersion(WperfVersion wperfVersion, bool shouldForce = false
144144
{
145145
return;
146146
}
147-
148147
}
149148

150149
private void SetPredefinedEventsAndMetrics(WperfList wperfList, bool shouldForce = false)
@@ -155,8 +154,6 @@ private void SetPredefinedEventsAndMetrics(WperfList wperfList, bool shouldForce
155154
{
156155
return;
157156
}
158-
159-
160157
}
161158

162159
public static TextBlock TextBlockFactory(string text, int offset, bool isRight = false)

WindowsPerfGUI/Utils/WperfDefaults.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ static class WperfDefaults
3838
#nullable enable
3939
public static string? Frequency;
4040
public static int? TotalGPCNum;
41+
42+
public static string DefaultWPASearchDir = Environment.GetEnvironmentVariable(
43+
"WPA_ADDITIONAL_SEARCH_DIRECTORIES"
44+
);
4145
#nullable disable
4246
}
4347
}

0 commit comments

Comments
 (0)