This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TaskStateCommand : ExtensionCommandBase | |
{ | |
[Argument(Help = "The Task instance address.")] | |
public string Address { get; set; } | |
public override void Invoke() | |
{ | |
if (string.IsNullOrEmpty(Address) && !Value.HasValue) | |
{ | |
WriteLine("Missing Task reference address or state value..." + Environment.NewLine); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected bool TryParseAddress(string addressInHexa, out ulong address) | |
{ | |
// skip 0x or leading 0000 if needed | |
if (addressInHexa.StartsWith("0x")) | |
addressInHexa = addressInHexa.Substring(2); | |
addressInHexa = addressInHexa.TrimStart('0'); | |
return ulong.TryParse(addressInHexa, System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out address); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TaskStateCommand : ExtensionCommandBase | |
{ | |
[Option(Name = "--value", Help = "<value> is the value of a Task m_stateFlags field.")] | |
[OptionAlias(Name = "-v")] | |
public ulong? Value { get; set; } | |
… | |
// access the Task state field if the flag is not given as a parameter | |
if (!Value.HasValue) | |
{ | |
… |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ParallelStacksCommand : ExtensionCommandBase | |
{ | |
[Option(Name = "--allThreads", Help = "Displays all threads per group instead of at most 4 by default.")] | |
[OptionAlias(Name = "-a")] | |
public bool AllThreads { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var timer in Helper.EnumerateTimers().OrderBy(t => t.Period)) | |
{ ... } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClrMDHelper | |
{ | |
private readonly ClrRuntime _clr; | |
private readonly ClrHeap _heap; | |
public ClrMDHelper(ServiceProvider provider) | |
{ | |
_clr = provider.GetService<ClrRuntime>(); | |
_heap = _clr.Heap; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_serviceProvider.AddServiceFactory(typeof(ClrRuntime), () => CreateRuntime(target)); | |
// ClrMD helper for extended commands | |
_serviceProvider.AddServiceFactory(typeof(ClrMDHelper), () => | |
new ClrMDHelper(_serviceProvider) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command(Name = "parallelstacks", Help = "Display merged threads stack a la Visual Studio 'Parallel Stacks' panel.")] | |
[CommandAlias(Name = "pstacks")] | |
public class ParallelStacksCommand : ExtensionCommandBase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Licensed to the .NET Foundation under one or more agreements. | |
// The .NET Foundation licenses this file to you under the MIT license. | |
// See the LICENSE file in the project root for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git add/gui | |
git commit | |
git remote add upstream https://github.com/criteo-forks/diagnostics | |
git push upstream PR_dotnet-dump_pstacks |