Skip to main content

Module schema

Module schema 

Source
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_id added.
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 EXISTS everywhere. Schema-version enforcement happens in SessionDb::open, not here.