Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

SessionDb lifecycle: create, open (with strict schema-version check), save-to, prune, session groups, raw-file paths.

Structs§

CreateOptions
Parameters for SessionDb::create.
SessionDb
An open SessionDb — either in-memory (fresh) or backed by a file.

Enums§

PrunePolicy
Whether prune deletes only auto-created sessions or everything over age.

Functions§

auto_label
"{basename}-{yyyymmdd-hhmmss}" in the local-ish (system time) zone, computed from SystemTime::now() without pulling in chrono.
compute_target_hash
Cheap target fingerprint: "<size>:<mtime_ns>". Good enough to detect “target has been rebuilt since last session”. Not a cryptographic hash.
group_key
Deterministic session-group id derived from (cwd, target_hash). Two sessions share a group iff they were launched against the same target from the same working directory.
prune
Walk sessions_dir, delete .db files for auto sessions whose mtime is older than older_than. Returns the list of deleted paths. User-promoted sessions are never touched under PrunePolicy::AutoOnly.
raw_dir
<cwd>/.dbg/sessions/<label>/raw/ — where raw captures (perf.data, nsys-rep, .nettrace, etc.) are preserved verbatim. Per principle 5 (adaptation layer), these files are the durable artifact.
sessions_dir
<cwd>/.dbg/sessions/ — where saved session DBs live.