VIEWALYZER · HEADLESS CLI
Documentation
VIEWALYZER · CLI & AUTOMATION

The .vadb file

One SQLite file per recording, the same schema the app, the CLI queries and the Python SDK read. When a query does not shape the data the way you need, open the file: query sql runs one read-only statement, the SDK's Recording.connect() hands you a read-only connection, and any SQLite client works.

Tables

TABLE COLUMNS HOLDS
metakey, valueformat, version, capture_source, capture_utc, va_cpu_hz, va_os, recorder_version, and the hardware-trace keys below
va_objectsid, ns, va_id, name, extraEverything that has a name: tasks and ISRs, sync objects, user channels and events, DWT comparators, ITM ports. ns is the namespace (task, isr, user_trace, dwt, itm, ...), va_id the firmware's id inside it
va_eventsid, t_cycles, t_atoms, frame_pos, kind, start_end, obj, obj2, value_i, value_f, text, pre_syncEvery event. t_cycles is CPU cycles; seconds = t_cycles / va_cpu_hz. kind is the event kind (task_switch, isr, user_trace, user_event, string, mutex, queue, dwt_pc, ...). start_end depends on kind: execution spans use 1 for entry and 0 for exit; mutex/queue/semaphore events use 1 for give/send/release and 0 for take/receive/acquire. obj is the object id. text is event payload text, not the object's name
healthstage, countersstage = 'recorder': synced-recording corrupt_bytes, corrupt_runs, lost_events, seq_gaps; acquisition-only pre_sync_corrupt_bytes, pre_sync_corrupt_runs, pre_sync_lost_events, pre_sync_seq_gaps; and main_trace_bytes
raw_logsection, dataThe byte-log (section = 'va_file'), so a recording can be re-parsed by a newer engine
va_summary, va_task_stats, va_trace_stats, va_timer_stats, va_work_stats, va_comm_paths, va_comm_resourcesDerived statistics the app shows on open, recomputed by load
va_signal_blocksFull-rate waveforms from an external instrument, present only when a file has any

Queries by hand

va_summary CPU and task totals include policy-hidden lanes. va_task_stats contains visible lanes; hidden_lanes and hidden_cpu_percent explain the remaining share (including idle). Raw event rows remain complete. va_cpu_hz is the source timestamp tick rate and must be finite and positive; loaders do not guess a missing rate. Waveform sample bounds extend the recording duration without extending a task's final observed execution span.

Derived task and trace rows key on actor_id, which joins va_objects.id. Communications resources key on (kind, resource_id); paths have a file-local flow_id plus resource_id, producer_id and consumer_id (unknown endpoints are null). Display names and path strings are labels, not unique keys. Work rows key on handler_addr. Distinct objects with the same label retain separate statistics when saved.

va_task_stats.inversion_count counts confirmed waits on a lower-base-priority holder. inversion_undetermined_count counts waits whose priority comparison is unavailable. Zephyr threads first discovered after creation may have an inherited current priority, so their base remains unknown. The CPU percentage fields in va_summary are SQL NULL when execution was not observed.

Names live once in va_objects; they are not duplicated into va_events.text. Join va_events.obj (and obj2 when it denotes another object) to va_objects.id whenever an event row needs its name.

-- what is in the file
select kind, count(*) as n from va_events group by kind order by n desc;

-- a user channel's samples in seconds (integer channels fill value_i, float channels value_f)
select e.t_cycles * 1.0 / (select value from meta where key = 'va_cpu_hz') as t_s, coalesce(e.value_f, e.value_i) as value
from va_events e join va_objects o on o.id = e.obj
where o.ns = 'user_trace' and o.name = 'Sine Wave' order by e.t_cycles;

-- ISR run times in microseconds (start/end pairs on the same object)
with s as (
  select obj, t_cycles as t0, lead(t_cycles) over (partition by obj order by t_cycles) as t1, start_end
  from va_events where kind = 'isr')
select o.name, count(*) as runs, avg(t1 - t0) * 1e6 / 170e6 as mean_us, max(t1 - t0) * 1e6 / 170e6 as max_us
from s join va_objects o on o.id = s.obj where s.start_end = 1 group by o.name;
$ viewalyzer-cli query sql --recording run.vadb --sql "select kind, count(*) as n from va_events group by kind order by n desc limit 5"
{"schema_version":3,"query":"sql","columns":["kind","n"],"rows":[["user_event",19136],["isr",10222],["user_trace",7176],["user_toggle",75],["string",5]],"row_count":5,"truncated":false}
from viewalyzer_sdk import ViewAlyzer
rec = ViewAlyzer().open("run.vadb")
with rec.connect() as db:                       # read-only sqlite3 connection
    rows = db.execute("select name from va_objects where ns = 'task'").fetchall()

Hardware trace in the file

Schema 2 stores hardware observations in va_hw_observations(id, observation). Each JSON observation contains kind, payload, native_time, recording_time (nullable), and a timing qualification in reason. Unknown recorder alignment never creates a synthetic RTOS event.

Host polls retain unsigned nanosecond read-start/read-end intervals. ITM packets retain the clock segment, previous/following raw counters, timestamp-control bits, framing status, and nullable source/prescale/cycle bounds. Raw counter ticks must not be treated as CPU cycles without those qualifications.

Kinds include pc_sample, pc_unavailable, exception, data_trace, data_trace_pc, counter, itm_text, mem_poll, and raw_dwt. PCSR unavailable reads are not sleep samples. DWT counter payloads contain wrap flags, not exact elapsed-cycle totals.

query hardware pages the observations. query native-signals provides probe-value summaries and exact read intervals; --channel-id N --offset N pages samples. load --export native-signals --format csv exports intervals, values, availability and non-finite status without inventing point timestamps.

Coverage reports retained counts, unknown framing, and the global retention drop count. A memory limit retains a prefix; it cannot establish a representative workload distribution. Missing health metadata is unknown, not zero.

Meta keys include hardware_trace, pc_sample_source, va_itmhw_bytes, va_itmhw_overflows, va_hw_observations_dropped, va_itm_timestamp_retention_limited, and va_itm_local_timestamps_when_disabled_in_plan.

Byte-logs and raw dumps

load accepts a .vadb, a .va byte-log (the recorder's bytes with a small container header, written while a capture runs) and a raw wire dump with no header at all; all decode to the same recording, and load x.va --output x.vadb converts. A .vadb also keeps its byte-log in raw_log, so a recording can always be re-parsed by a newer engine.