Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
douglas-raillard-arm committed Jan 4, 2024
1 parent 3c7cf8f commit 09be0fb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/analysis/trace-tools/src/lib/parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,13 @@ enum ReadStateVariant<'scope> {
fmt_fmt: FieldFmt,
buf_fmt: FieldFmt,
generic: TableState<'scope>,
// We have a table indexed by the address of the format string since that is what we get
// from the bprint event.
meta_events_by_addr: BTreeMap<Address, MetaEventEntry<'scope>>,
// However, we don't want to accidentally create 2 identical meta events if 2 or more
// independent format strings have the exact same format (e.g. the user copy-pasted some
// calls to trace_printk() in various places). For this purpose, we also maintain a map
// indexed by the format string content, which is used to populate the by-address map.
meta_events_by_fmt: BTreeMap<PrintFmtStr, MetaEventEntry<'scope>>,
},
}
Expand Down Expand Up @@ -764,10 +770,10 @@ where
// Find an already-created meta event that would have the same
// print format string, therefore the same schema.
match meta_events_by_fmt.entry(print_fmt) {
Entry::Occupied(entry) => entry.get().clone(),
Entry::Occupied(entry) => Rc::clone(entry.get()),
Entry::Vacant(entry) => {
let new = Rc::new(make_schema(entry.key().clone()));
entry.insert(new.clone());
entry.insert(Rc::clone(&new));
new
},
}
Expand Down

0 comments on commit 09be0fb

Please sign in to comment.