Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime_tracing"
version = "0.9.0"
version = "0.10.0"
edition = "2021"
authors = ["Metacraft Labs Ltd"]
description = "A library for the schema and tracing helpers for the CodeTracer db trace format"
Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ mod tests {
let reference_type = TypeRecord {
kind: TypeKind::Pointer,
lang_type: "MyReference<Int>".to_string(),
specific_info: TypeSpecificInfo::Pointer {
dereference_type_id: tracer.ensure_type_id(TypeKind::Int, "Int")
}
specific_info: TypeSpecificInfo::Pointer {
dereference_type_id: tracer.ensure_type_id(TypeKind::Int, "Int"),
},
};
let reference_type_id = tracer.ensure_raw_type_id(reference_type);
let _reference_value = ValueRecord::Reference {
dereferenced: Box::new(int_value_1.clone()),
address: 0,
mutable: false,
type_id: reference_type_id,
};
Expand Down
2 changes: 2 additions & 0 deletions src/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ impl Tracer {
self.events.push(TraceLowLevelEvent::Return(ReturnRecord { return_value }));
}

// TODO: add metadata arg
pub fn register_special_event(&mut self, kind: EventLogKind, content: &str) {
self.events.push(TraceLowLevelEvent::Event(RecordEvent {
kind,
metadata: "".to_string(),
content: content.to_string(),
}));
}
Expand Down
4 changes: 4 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ pub enum TypeSpecificInfo {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RecordEvent {
pub kind: EventLogKind,
pub metadata: String,
pub content: String,
}

Expand Down Expand Up @@ -361,6 +362,7 @@ pub enum ValueRecord {
// or more fields (address?)
Reference {
dereferenced: Box<ValueRecord>,
address: u64,
mutable: bool,
type_id: TypeId,
},
Expand Down Expand Up @@ -444,8 +446,10 @@ pub enum EventLogKind {
#[default]
Write,
WriteFile,
WriteOther,
Read,
ReadFile,
ReadOther,
// not used for now
ReadDir,
OpenDir,
Expand Down