private static PreciseMachineCounter FromCounter(HardwareCounter counter) { var profileSource = TraceEventProfileSources.GetInfo()[EtwTranslations[counter]]; // it can't fail, diagnoser validates that first return(new PreciseMachineCounter(profileSource.ID, profileSource.Name, counter, profileSource.MinInterval)); // we want the smallest interval to have best possible precision }
private PreciseMachineCounter(int profileSourceId, string name, HardwareCounter counter, int interval) { ProfileSourceId = profileSourceId; Name = name; Counter = counter; Interval = interval; }
internal PreciseMachineCounter(int profileSourceId, string name, HardwareCounter counter, int interval) { ProfileSourceId = profileSourceId; Name = name; Counter = counter; Interval = interval; PerInstructionPointer = new Dictionary <ulong, ulong>(capacity: 10000); }
public static string ToShortName(this HardwareCounter hardwareCounter) { switch (hardwareCounter) { case HardwareCounter.Timer: return("timer"); case HardwareCounter.TotalIssues: return("issues"); case HardwareCounter.BranchInstructions: return("branch"); case HardwareCounter.CacheMisses: return("miss"); case HardwareCounter.BranchMispredictions: return("mispred"); case HardwareCounter.TotalCycles: return("cycles"); case HardwareCounter.UnhaltedCoreCycles: return("unCoreCycles"); case HardwareCounter.InstructionRetired: return("retired"); case HardwareCounter.UnhaltedReferenceCycles: return("unRefCycles"); case HardwareCounter.LlcReference: return("llcRef"); case HardwareCounter.LlcMisses: return("llcMiss"); case HardwareCounter.BranchInstructionRetired: return("branchInst"); case HardwareCounter.BranchMispredictsRetired: return("branchMisp"); default: throw new NotSupportedException($"{hardwareCounter} has no short name mapping"); } }
public static bool TheGreaterTheBetter(this HardwareCounter hardwareCounter) { // this method could be just a return false as of today but we want to make sure that when we add new counter it's added here on purpose! switch (hardwareCounter) { case HardwareCounter.Timer: case HardwareCounter.TotalIssues: case HardwareCounter.BranchInstructions: case HardwareCounter.CacheMisses: case HardwareCounter.BranchMispredictions: case HardwareCounter.TotalCycles: case HardwareCounter.UnhaltedCoreCycles: case HardwareCounter.InstructionRetired: case HardwareCounter.UnhaltedReferenceCycles: case HardwareCounter.LlcReference: case HardwareCounter.LlcMisses: case HardwareCounter.BranchInstructionRetired: case HardwareCounter.BranchMispredictsRetired: return(false); default: throw new NotSupportedException($"{hardwareCounter} has no TheGreaterTheBetter mapping"); } }
internal static PreciseMachineCounter FromCounter(HardwareCounter counter, Func <ProfileSourceInfo, int> intervalSelector) { var profileSource = TraceEventProfileSources.GetInfo()[EtwTranslations[counter]]; // it can't fail, diagnoser validates that first return(new PreciseMachineCounter(profileSource.ID, profileSource.Name, counter, intervalSelector(profileSource))); }
public PmcColumn(Dictionary <BenchmarkCase, PmcStats> results, HardwareCounter hardwareCounter) { Results = results; Counter = hardwareCounter; ColumnName = $"{hardwareCounter}/Op"; }