Skip to content

Commit 84d15cd

Browse files
committed
Merge branch 'master' of https://github.com/microsoft/perfview into addProcessorStacks
2 parents 40d84bd + 1b48b02 commit 84d15cd

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

src/PerfView/CommandLineArgs.cs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,21 @@ private CommandLineArgs(int maxLineWidth, out string helpString)
227227
SetupCommandLine(parser);
228228
helpString = parser.GetHelp(maxLineWidth, null);
229229
}
230+
231+
/// <summary>
232+
/// Shared logic to configure CommandLineArgs for GCCollectOnly mode
233+
/// </summary>
234+
/// <param name="commandLineArgs"></param>
235+
internal static void ConfigureForGCCollectOnly(CommandLineArgs commandLineArgs)
236+
{
237+
// The process events are so we get process names. The ImageLoad events are so that we get version information about the DLLs.
238+
commandLineArgs.KernelEvents = KernelTraceEventParser.Keywords.Process | KernelTraceEventParser.Keywords.ImageLoad;
239+
commandLineArgs.ClrEvents = ClrTraceEventParser.Keywords.GC;
240+
commandLineArgs.ClrEventLevel = TraceEventLevel.Informational;
241+
commandLineArgs.TplEvents = TplEtwProviderTraceEventParser.Keywords.None;
242+
commandLineArgs.NoRundown = true;
243+
}
244+
230245
private void SetupCommandLine(CommandLineParser parser)
231246
{
232247
// #CommandLineDefinitions
@@ -353,7 +368,7 @@ private void SetupCommandLine(CommandLineParser parser)
353368
"On the unzip command. See 'Working with WPA' in the help for more.");
354369
parser.DefineOptionalQualifier("LowPriority", ref LowPriority, "Do merging and ZIPing at low priority to minimize impact to system.");
355370
parser.DefineOptionalQualifier("NoRundown", ref NoRundown, "Don't collect rundown events. Use only if you know the process of interest has exited.");
356-
parser.DefineOptionalQualifier("FocusProcess", ref FocusProcess, "Either a decimal process ID or a process name (exe name without path but WITH extension) to focus ETW commands." +
371+
parser.DefineOptionalQualifier("FocusProcess", ref FocusProcess, "Either a decimal process ID or a process name (exe name without path but WITH extension) to focus ETW commands." +
357372
"All NON-KERNEL providers are only send to this process (and rundown is only done on this process) which can cut overhead significantly in some cases.");
358373

359374
parser.DefineOptionalQualifier("NoNGenPdbs", ref NoNGenPdbs, "Don't generate NGEN Pdbs");
@@ -460,13 +475,7 @@ private void SetupCommandLine(CommandLineParser parser)
460475
parser.DefineOptionalQualifier("GCCollectOnly", ref GCCollectOnly, "Turns on GC collections (no allocation sampling).");
461476
if (GCCollectOnly)
462477
{
463-
// TODO this logic is cloned. We need it in only one place. If you update it do the other location as well
464-
// The process events are so we get process names. The ImageLoad events are so that we get version information about the DLLs
465-
KernelEvents = KernelTraceEventParser.Keywords.Process | KernelTraceEventParser.Keywords.ImageLoad;
466-
ClrEvents = ClrTraceEventParser.Keywords.GC | ClrTraceEventParser.Keywords.Exception;
467-
ClrEventLevel = TraceEventLevel.Informational;
468-
TplEvents = TplEtwProviderTraceEventParser.Keywords.None;
469-
NoRundown = true;
478+
ConfigureForGCCollectOnly(this);
470479
CommandProcessor.s_UserModeSessionName = "PerfViewGCSession";
471480
DataFile = "PerfViewGCCollectOnly.etl";
472481
}

src/PerfView/Dialogs/RunCommandDialog.xaml.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,8 @@ private void OKButtonClick(object sender, RoutedEventArgs e)
696696
{
697697
m_args.GCCollectOnly = true;
698698

699-
// The process events are so we get process names. The ImageLoad events are so that we get version information about the DLLs
700-
m_args.KernelEvents = KernelTraceEventParser.Keywords.Process | KernelTraceEventParser.Keywords.ImageLoad;
701-
m_args.ClrEvents = ClrTraceEventParser.Keywords.GC | ClrTraceEventParser.Keywords.Exception;
702-
m_args.ClrEventLevel = TraceEventLevel.Informational;
703-
m_args.NoRundown = true;
699+
CommandLineArgs.ConfigureForGCCollectOnly(m_args);
700+
704701
if (!m_args.Merge.HasValue)
705702
{
706703
m_args.Merge = false;

src/TraceEvent/TraceEventSession.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,16 +2318,16 @@ public void AddArgument(string key, string value)
23182318
/// </summary>
23192319
public byte[] RawArguments { get; set; }
23202320
/// <summary>
2321-
/// Setting StackEnabled to true will cause all events in the provider to collect stacks when event are fired.
2321+
/// Setting StackEnabled to true will cause all events in the provider to collect stacks when events are fired.
23222322
/// </summary>
23232323
public bool StacksEnabled { get; set; }
23242324
/// <summary>
2325-
/// Setting ProcessIDFilter will limit the providers that receive the EnableCommand to those that match on of
2325+
/// Setting ProcessIDFilter will limit the providers that receive the EnableCommand to those that match one of
23262326
/// the given Process IDs.
23272327
/// </summary>
23282328
public IList<int> ProcessIDFilter { get; set; }
23292329
/// <summary>
2330-
/// Setting ProcessNameFilter will limit the providers that receive the EnableCommand to those that match on of
2330+
/// Setting ProcessNameFilter will limit the providers that receive the EnableCommand to those that match one of
23312331
/// the given Process names (a process name is the name of the EXE without the PATH but WITH the extension).
23322332
/// </summary>
23332333
public IList<string> ProcessNameFilter { get; set; }
@@ -2337,7 +2337,7 @@ public void AddArgument(string key, string value)
23372337
/// </summary>
23382338
public IList<int> EventIDsToEnable { get; set; }
23392339
/// <summary>
2340-
/// Setting EventIDs to Enable will enable the collection of stacks for a event of a provider by EventID
2340+
/// Setting EventIDs to Enable will enable the collection of stacks for an event of a provider by EventID
23412341
/// (Has no effect if StacksEnabled is also set since that enable stacks for all events IDs)
23422342
/// </summary>
23432343
public IList<int> EventIDStacksToEnable { get; set; }
@@ -2347,7 +2347,7 @@ public void AddArgument(string key, string value)
23472347
/// </summary>
23482348
public IList<int> EventIDsToDisable { get; set; }
23492349
/// <summary>
2350-
/// Setting EventIDs to Enable will disable the collection of stacks for a event of a provider by EventID
2350+
/// Setting EventIDs to Enable will disable the collection of stacks for an event of a provider by EventID
23512351
/// Has no effect unless StacksEnabled is also set (since otherwise stack collection is off).
23522352
/// </summary>
23532353
public IList<int> EventIDStacksToDisable { get; set; }

0 commit comments

Comments
 (0)