#[repr(i32)]pub enum Counter {
Show 21 variants
UnknownCounter = 0,
SwCpuClock = 1,
SwPageFaults = 2,
SwTaskClock = 3,
SwContextSwitches = 4,
SwCpuMigrations = 5,
SwPageFaultsMin = 6,
SwPageFaultsMaj = 7,
SwAlignmentFaults = 8,
SwEmulationFaults = 9,
SwDummy = 20,
HwCpuCycles = 10,
HwInstructions = 11,
HwCacheReferences = 12,
HwCacheMisses = 13,
HwBranchInstructions = 14,
HwBranchMisses = 15,
HwBusCycles = 16,
HwStalledCyclesFrontend = 17,
HwStalledCyclesBackend = 18,
HwRefCpuCycles = 19,
}
Expand description
Builtin counter names from the uapi header. Commented with their perf tool aliases. TODO(rsavitski): consider generating enums for cache events (should be finite), and generally make this list as extensive as possible. Excluding things like dynamic PMUs since those don’t fit into a static enum. Next id: 21
Variants§
UnknownCounter = 0
SwCpuClock = 1
cpu-clock
SwPageFaults = 2
page-faults, faults
SwTaskClock = 3
task-clock
SwContextSwitches = 4
context-switches, cs
SwCpuMigrations = 5
cpu-migrations, migrations
SwPageFaultsMin = 6
minor-faults
SwPageFaultsMaj = 7
major-faults
SwAlignmentFaults = 8
alignment-faults
SwEmulationFaults = 9
emulation-faults
SwDummy = 20
dummy
HwCpuCycles = 10
cpu-cycles, cycles
HwInstructions = 11
instructions
HwCacheReferences = 12
cache-references
HwCacheMisses = 13
cache-misses
HwBranchInstructions = 14
branch-instructions, branches
HwBranchMisses = 15
branch-misses
HwBusCycles = 16
bus-cycles
HwStalledCyclesFrontend = 17
stalled-cycles-frontend, idle-cycles-frontend
HwStalledCyclesBackend = 18
stalled-cycles-backend, idle-cycles-backend
HwRefCpuCycles = 19
ref-cycles
Implementations§
Source§impl Counter
impl Counter
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.