#[repr(i32)]pub enum Scope {
Unspecified = 0,
Global = 1,
Cpu = 2,
}Expand description
The scope of a counter instance: which stream of values the per-sample weights belong to. Counter instances accumulate independently, so values from different instances must never be merged into one stream. Trace processor keeps sampling streams separate and materializes one counter track per instance within each stream: SCOPE_GLOBAL yields one track per sampling stream and SCOPE_CPU one track per (sampling stream, cpu).
If your profiler needs a scope that is not listed here, please file a bug at https://github.com/google/perfetto/issues explaining what you are trying to record and which scope you would like added. Append-only: never renumber or repurpose an existing value.
Variants§
Unspecified = 0
Treated as SCOPE_GLOBAL.
Global = 1
A single counter instance, not split by cpu, thread or anything else.
Cpu = 2
One counter instance per cpu. Each sample’s weight belongs to the instance of the cpu in its ExecutionContext; samples without a cpu cannot be attributed and their weights for this counter are dropped.
Implementations§
Source§impl Scope
impl Scope
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.