pub struct Opcode(/* private fields */);Expand description
Values for EventHeader::opcode indicating special semantics to be used by
the event decoder for grouping and organizing events, e.g. for activities.
Most events set opcode = Info (0). Other opcode values add special semantics to
an event that help the event analysis tool with grouping related events. The
most frequently-used special semantics are ActivityStart and ActivityStop.
To record an activity:
- Generate a new activity id. An activity id is a 128-bit value that must be unique within the trace. This can be a UUID or it can be generated by any other id-generation system that is unlikely to create the same value for any other activity id in the same trace.
- Write an event with opcode =
ActivityStart, with the activity id specified, and if the activity is nesting within a parent activity, the related id specified as the id of the parent activity. - As appropriate, write any number of normal events (events with opcode set to
something other than
ActivityStartorActivityStop, e.g. opcode =Info). To indicate that the events are part of the activity, each of these events should have their activity id specified as the id of the activity. - When the activity ends, write an event with opcode =
ActivityStop, with the activity id specified.
Implementations§
Source§impl Opcode
impl Opcode
Sourcepub const Info: Opcode
pub const Info: Opcode
Normal event. The event may set activity_id if it is part of an activity.
Sourcepub const ActivityStart: Opcode
pub const ActivityStart: Opcode
Event indicates the beginning of an activity. The event should set related_id to the id of the parent activity and should set activity_id to the id of the newly-started activity. All subsequent events that use the new activity_id will be considered as part of this activity, up to the corresponding ActivityStop event.
Sourcepub const ActivityStop: Opcode
pub const ActivityStop: Opcode
Event indicates the end of an activity. The event should set activity_id to the id of the activity that is ending and should use the same level and keyword as were used for the corresponding ActivityStart event.
Sourcepub const CollectionStart: Opcode
pub const CollectionStart: Opcode
Data Collection Start event
Sourcepub const CollectionStop: Opcode
pub const CollectionStop: Opcode
Data Collection Stop event
Sourcepub const ReservedOpcode241: Opcode
pub const ReservedOpcode241: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode242: Opcode
pub const ReservedOpcode242: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode243: Opcode
pub const ReservedOpcode243: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode244: Opcode
pub const ReservedOpcode244: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode245: Opcode
pub const ReservedOpcode245: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode246: Opcode
pub const ReservedOpcode246: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode247: Opcode
pub const ReservedOpcode247: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode248: Opcode
pub const ReservedOpcode248: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode249: Opcode
pub const ReservedOpcode249: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode250: Opcode
pub const ReservedOpcode250: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode251: Opcode
pub const ReservedOpcode251: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode252: Opcode
pub const ReservedOpcode252: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode253: Opcode
pub const ReservedOpcode253: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode254: Opcode
pub const ReservedOpcode254: Opcode
Reserved for future definition by Microsoft
Sourcepub const ReservedOpcode255: Opcode
pub const ReservedOpcode255: Opcode
Reserved for future definition by Microsoft