Expand description
SessionDb schema DDL.
Every minor version can break schema. Old DBs that don’t match
SCHEMA_VERSION fail to load with a clear “re-collect” message.
There is no migration path — the raw native files under
.dbg/sessions/<label>/raw/ are the durable artifact and dbg profile-*
can always regenerate an index from them.
Constants§
- CORE_
DDL - Shared meta tables — always created regardless of track or target class.
- CPU_DDL
- CPU-unified profile tables — sampling + EAV counters. Used by native-cpu, managed-dotnet, jvm, python, js/node target classes.
- CROSSTRACK_
DDL - Cross-track shared tables — joinable from either debug or profile
tracks via
symbol_id. Populated by on-demand collectors. - DEBUG_
DDL - Debug track tables — created for every session regardless of kind. A profile session simply never writes to them.
- GPU_DDL
- GPU domain tables (CUDA launches, ncu metrics, memcpy transfers,
framework ops). From gdbg’s current schema, with
session_idadded. - MANAGED_
DDL - Managed-runtime tables (.NET, JVM).
- NODE_
DDL - Node/JS-specific tables (event-loop lag).
- PYTHON_
DDL - Python-specific tables (GIL contention).
- SCHEMA_
VERSION - Bump this on every schema-breaking change. No migrations.
Functions§
- apply
- Apply the shared meta + debug + cross-track DDL plus the per-class
domain tables. Safe to call on a fresh or existing DB; uses
CREATE TABLE IF NOT EXISTSeverywhere. Schema-version enforcement happens inSessionDb::open, not here.