Support CM time_metric (NS/MS/SEC/US) across reader and viz#99
Open
rayandrew wants to merge 8 commits into
Open
Support CM time_metric (NS/MS/SEC/US) across reader and viz#99rayandrew wants to merge 8 commits into
rayandrew wants to merge 8 commits into
Conversation
hariharan-devarajan
approved these changes
Jul 20, 2026
rayandrew
force-pushed
the
feat/server-query-improv
branch
from
July 20, 2026 23:25
d8667e5 to
a5f62e2
Compare
…4/aarch64 segfault)
rayandrew
force-pushed
the
feat/server-query-improv
branch
from
July 20, 2026 23:34
a5f62e2 to
ee805ad
Compare
fold_summary's column-discovery block iterated `ar.get_object().value_unsafe()` directly in a range-for. The simdjson_result temporary is destroyed at the end of the statement, so the bound dom::object's tape pointer dangles and object::end() reads freed memory. Crashed the scan thread on the first event with args, leaving /viz/breaks and /viz/events empty. Only reproduced on Linux/aarch64 at -O2 (same class as the bloom_visitor fix). Bind the object to a named local before iterating.
Route cores to /tmp/cores (overriding apport/systemd-coredump), enable `ulimit -c unlimited` for the test/coverage/python steps, and on failure run `gdb thread apply all bt full` over each core and upload the cores plus backtraces as an artifact. Catches crashes in a spawned subprocess (e.g. dftracer_server) that surface only as an empty response in the test binary. The tests preset is already RelWithDebInfo with DEBUG=ON, so symbols are present.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Traces can declare their time unit via the
CMtime_metricmetadata event (NS,MS,SEC, orUS; absent meansUS).Until now everything assumed microseconds, so an
NStrace showed timestamps and durations 1000x too large and mislabeled.This adds first-class handling so every consumer sees correct time.
Reader (Python / Arrow / C++)
Adds an opt-in
normalize_timeoption that scalests/durinto a target unit; the default is native, with no scaling and no cost.The Python API takes a
TimeUnitenum (NS/US/MS/SEC) or the equivalent string, forwarded through bothread_arrow/iter_arrowandread_json/iter_json.The file's unit is resolved once from a cheap header probe that is independent of any query filter, so scaling stays correct even when a query drops the
CMline.Scaling is fused into the existing row-build pass and short-circuits for
UStraces, so it adds no measurable cost.Query predicates (
ts >= ...) continue to match the native index and are unaffected.Server / viz
The server now presents all timestamps and durations in microseconds regardless of the trace's native unit.
TraceIndexresolves one unit per trace and converts at its boundary: requestbegin/endmap microseconds-to-native for the scan, and/infobounds plus every response value (eventts/dur, density blocks, stats, histogram, calltree, counters, breaks, proctree) map native-to-microseconds.Every conversion is identity for
UStraces, so existing behavior is unchanged.Tests and docs
Adds a
time_metricunit test, a Pythonnormalize_timesuite (including enum, query-filtered, and gzip cases), and a server integration test that verifies anNStrace is served in microseconds.Existing reader and server suites pass unchanged.
Documents
normalize_time/TimeUnitin the quickstart and adds a "Time units" note to the server API docs.