tiny.memtrace.Event
Defined in event.
API (30)
Actions
Public operations.
Fields and members
Public fields and members.
addressalignmentallocation_idallocator_idgenerationkindlabel_idlayerlenlifecycle_dispositionlifecycle_instrumentedlifecycle_reasonlive_bytesobservation_prefix_completeold_addressold_lenoperation_idowner_cookieparent_operation_idproducerproducer_idrecording_failuresretains_freed_memoryreturn_addressscope_idseqstack_idsucceededtracked
Source
Source: lib/memtrace/src/event.zig:132
zig
pub const Event = struct { seq: u64 = 0, kind: Kind, allocator_id: u32 = 0, allocation_id: u64 = 0, scope_id: u32 = 0, label_id: u32 = 0, address: usize = 0, old_address: usize = 0, len: usize = 0, old_len: usize = 0, alignment: u32 = 0, return_address: usize = 0, stack_id: u32 = 0, succeeded: bool = true, tracked: bool = true, live_bytes: usize = 0, recording_failures: u64 = 0, retains_freed_memory: bool = false, layer: Layer = .backing_boundary, operation_id: u64 = 0, parent_operation_id: u64 = 0, producer_id: u64 = 0, producer: observe.Producer = .boundary, generation: u64 = 0, owner_cookie: usize = 0, lifecycle_disposition: observe.LifecycleDisposition = .none, lifecycle_reason: observe.LifecycleReason = .none, lifecycle_instrumented: bool = false, observation_prefix_complete: bool = true, pub fn writeJsonLine( self: Event, writer: *std.Io.Writer, label_text: ?[]const u8, scope_text: ?[]const u8, ) !void { var stream = pretty_json.Writer.init(writer, .minified); const object = try stream.object(); try object.field("v", format_version); try object.field("seq", self.seq); try object.field("kind", self.kind.tag()); if (self.allocator_id != 0) try object.field("allocator_id", self.allocator_id); if (self.allocation_id != 0) try object.field("allocation_id", self.allocation_id); if (self.scope_id != 0) try object.field("scope_id", self.scope_id); if (self.address != 0) try object.field("address", self.address); if (self.old_address != 0 and self.old_address != self.address) { try object.field("old_address", self.old_address); } if (self.len != 0) try object.field("len", self.len); if (self.old_len != 0) try object.field("old_len", self.old_len); if (self.alignment != 0) try object.field("alignment", self.alignment); if (self.return_address != 0) try object.field("return_address", self.return_address); if (self.stack_id != 0) try object.field("stack_id", self.stack_id); if (!self.succeeded) try object.field("succeeded", false); if (!self.tracked) try object.field("tracked", false); if (self.recording_failures != 0) { try object.field("recording_failures", self.recording_failures); } if (self.retains_freed_memory) try object.field("retains_freed_memory", true); if (self.layer != .backing_boundary) try object.field("layer", self.layer.tag()); if (self.operation_id != 0) try object.field("operation_id", self.operation_id); if (self.parent_operation_id != 0) { try object.field("parent_operation_id", self.parent_operation_id); } if (self.producer_id != 0) try object.field("producer_id", self.producer_id); if (self.producer != .boundary) try object.field("producer", @tagName(self.producer)); if (self.generation != 0) try object.field("generation", self.generation); if (self.owner_cookie != 0) try object.field("owner_cookie", self.owner_cookie); if (self.lifecycle_disposition != .none) { try object.field( "lifecycle_disposition", @tagName(self.lifecycle_disposition), ); } if (self.lifecycle_reason != .none) { try object.field("lifecycle_reason", @tagName(self.lifecycle_reason)); } if (self.lifecycle_instrumented) { try object.field("lifecycle_instrumented", true); } if (!self.observation_prefix_complete) { try object.field("observation_prefix_complete", false); } if (label_text) |text| try object.field("label", text); if (scope_text) |text| try object.field("scope", text); try object.endLine(); }};Source: lib/memtrace/src/root.zig:81
zig
pub const Event = event_mod.Event;Audit
| Definitions | 2 |
|---|---|
| Public names | 4 |
| Members | 29 |
| Version | 26.7.0 |
| Revision | daab053ee433 |