Which View reads return dftracer metadata records
FactVerified 27 Sep 2026Holds project: dftracer-utils
Fact. A statement and the evidence for it.
Statement#
For a dftracer trace with ph="M" metadata records (such as process_name):
collect()returns data events only. Withphase(Phase::Any)it still leaves metadata out, becausecollect_eventsdropsMETADATAandUNKNOWNphases after decoding.phase(Phase::Metadata)returns the metadata records as rows.sink_jsonwrites the metadata records by default: an export keeps them, so a trace viewer can name threads and processes.- A
ViewSessionfold without a predicate sees what the scan emits.ViewSession::fold(f, combine)(no predicate) applies the view's own query and phase througheffective_query, so it matchescollect().
Compare a new read path with collect() for data rows, not with sink_json: the two differ on metadata by design.
Evidence#
- Stage 9a test
tests/trace/views/test_typed_rows.cpp, case "dftracer metadata records are left out unless selected", on a trace of 1process_namerecord and 20 events:rows<T>gave 20 for the default view, 1 forphase(Metadata), and equal tocollect().num_rows()(20) forphase(Any), whilesink_json(...).events_matchedgave 21 for both the default view andphase(Any).