JSON Interfaces & Schemas
Extracted directly from xprobe/protocol and the 26 v0.7.0 JSON Schemas under schemas/. Use this page as a field-level reference when authoring --spec files or parsing stdout/artifact JSON.
Strict Deserialization & Naming
- All public JSON types use
#[serde(deny_unknown_fields)]: unknown fields or unsupportedschema_versionvalues fail deserialization. - CLI vs. JSON naming: CLI
--matchuses kebab-case (first-after,stack-nested,stream-order), whereas JSONmatch_policyuses snake_case (first_after,stack_nested,stream_order).
Input Spec Interfaces (--spec)
1. MeasurementSpec (single-edge, schema_version: "2.0")
| Field | Type | Required | Notes |
|---|---|---|---|
schema_version | "2.0" | ✅ | Protocol version |
target | TargetIdentity | ✅ | { pid: u32, process_start_time?: u64 } |
start_selector | string | ✅ | Start event selector |
end_selector | string | ✅ | End event selector |
match_policy | MatchPolicy | ✅ | exact | first_after | nearest | stack_nested | stream_order |
timeout_ms | integer | ✅ | Foreground timeout (ms) |
measurement_mode | "exact" | "aggregate" | — | Defaults to exact |
samples | integer | null | — | Matched pair target (set samples or duration_ms) |
duration_ms | integer | null | — | Capture window duration (ms) |
max_events | integer | null | — | Event cap |
max_groups | integer | null | — | Max distinct groups in aggregate mode |
name | string | null | — | Optional measurement name |
2. MeasurementGraphSpec (1–8 edges, schema_version: "3.0")
| Field | Type | Required | Notes |
|---|---|---|---|
schema_version | "3.0" | ✅ | Protocol version |
target | GraphTarget | ✅ | { pid: u32, process_start_time?: u64 } |
endpoints | Record<string, string> | ✅ | 1–8 named endpoints mapped to selector strings |
edges | GraphEdgeSpec[] | ✅ | 1–8 edges: { name, from, to, match_policy, samples? } |
timeout_ms | integer | ✅ | Foreground timeout (ms) |
duration_ms | integer | null | — | Graph duration; either every edge sets samples or graph sets duration_ms |
max_events | integer | null | — | Total event capacity cap |
name | string | null | — | Optional graph name |
3. CpuSamplingSpec & SyscallAggregateSpec (schema_version: "2.0")
CpuSamplingSpecrequired:schema_version("2.0"),target,sample_event("cpu_clock"),frequency_hz,duration_ms,timeout_ms,max_samples,max_groups,stack_depth,max_threads; optional:name.SyscallAggregateSpecrequired:schema_version("2.0"),target,duration_ms,timeout_ms,max_groups,max_inflight; optional:name.
Command Output Interfaces (stdout JSON)
doctor (capability.schema.json)
| Field | Type | Required | Notes |
|---|---|---|---|
schema_version | "2.0" | ✅ | Protocol version |
ok | boolean | ✅ | Diagnostics completed (not all collectors enabled) |
capabilities | Capabilities | ✅ | Collector capability booleans |
environment | Environment | ✅ | Kernel, OS, NVIDIA driver, CUDA/CUPTI paths, namespaces |
checks | SystemChecks | ✅ | Per-check status (available | restricted | unavailable | unknown) |
warnings | Warning[] | — | Diagnostic warnings |
discover (discover.schema.json)
| Field | Type | Required | Notes |
|---|---|---|---|
schema_version | "2.0" | ✅ | Protocol version |
ok | boolean | ✅ | Query succeeded |
root | TargetIdentity | ✅ | Root process identity |
limit | integer | ✅ | Requested limit |
total_candidates | integer | ✅ | Total matched processes |
truncated | boolean | ✅ | Whether output hit limit |
candidates | CudaProcessCandidate[] | ✅ | Confirmed CUDA context holders (PID, start_time, PPID, exe, cmdline, GPU UUIDs) |
warnings | Warning[] | — | E.g. NVML_PROCESS_UNAVAILABLE, NVML_PID_NAMESPACE_MISMATCH |
validate (validate.schema.json / measurement-graph-validate.schema.json)
Field (single-edge 2.0) | Type | Required | Notes |
|---|---|---|---|
schema_version | "2.0" | ✅ | "3.0" for graph validation |
ok / valid | boolean | ✅ | Command succeeded / configuration valid |
target | TargetIdentity | ✅ | Target identity |
start / end | ValidatedEndpoint | ✅ | Endpoint resolution (endpoints & edges for graphs) |
match_policy | MatchPolicy | ✅ | Requested policy |
policy_recommendation | PolicyRecommendation | ✅ | Strongest compatible policy, reason, alternatives |
requirements | ValidationRequirements | ✅ | agent_activation, target_mutation, required capabilities |
issues / warnings | ValidationIssue[] / Warning[] | — | Validation issues and warnings |
measure Output Top-Level Fields by Mode
| Mode / Schema | Version | Required Top-Level Fields | Optional Fields |
|---|---|---|---|
Single-edge (measurement-result) | 3.0 | schema_version, ok, session_id, status, measurement, quality, correlation, clock, collection, evidence | warnings |
Measurement graph (measurement-graph-result) | 3.0 | schema_version, ok, session_id, status, target, edges, collection | artifact, name, warnings |
Ring trigger (trigger-result) | 3.0 | schema_version, ok, session_id, status, target, trigger, observed, windows, collection, warnings | — |
Python sample (python-sample-result) | 3.0 | schema_version, ok, session_id, status, target, inventory, collection | artifact, warnings |
GPU aggregate (aggregate-inventory-result) | 3.0 | schema_version, ok, session_id, status, inventory, collection | warnings |
Triage (triage-result) | 3.0 | schema_version, ok, session_id, status, target, window_ms, findings, threads, cpu_hotspots, python_hotspots, syscalls, gpu_devices, gpu_activity, sources, not_covered | cgroup, cuda_devices, gil_released_proportion, warnings |
CPU sample (cpu-sample-inventory-result) | 2.0 | schema_version, ok, session_id, status, target, inventory, collection, symbolization | warnings |
Syscall aggregate (syscall-aggregate-result) | 2.0 | schema_version, ok, session_id, status, target, inventory, collection | warnings |
Error (error) | 2.0 | schema_version, ok (false), error ({ code, message, recoverable, details, hints }) | — |
Artifact File Interfaces (JSONL & Manifest)
- Event JSONL (
event.schema.json,2.0):- Required:
schema_version,session_id,event_id,sequence,source,event_type,pid,tid,timestamp_raw,timestamp_ns,clock_domain - Optional:
attributes,cpu,cuda,host,nvtx,process_start_time,timestamp_error_ns
- Required:
- Capture Manifest (
capture-manifest.schema.json,1.0):- Required:
schema_version,artifact,target,window,selectors,all_gpu_activity,peer_copies,dropped_records,unknown_records,capture_failed - Optional:
cuda_devices,record_limit_reached,wall_clock
- Required:
- Python Sample JSONL (
python-sample-record.schema.json,3.0):- Required:
timestamp_ns,pid,gil,truncated,frames - Optional:
native,tid
- Required:
For concrete JSONL line samples, pairing keys, and scripting recipes, see Data Format, Clocks & Scripting.
Core Shared Enums
| Enum | Valid Values |
|---|---|
SessionStatus | completed | timed_out | cancelled | failed |
QualityVerdict | good | caution |
CheckStatus | available | restricted | unavailable | unknown |
AgentActivation | not_required | already_loaded | injection_required | startup_required |
ClockDomain | host_monotonic | cupti | cupti_normalized_to_host_monotonic |
EventSource | ebpf | cupti_callback | cupti_activity | marker |
EventType (20) | host_function_entry | host_function_exit | kernel_function_entry | kernel_function_exit | tracepoint | syscall_entry | syscall_exit | cuda_api_entry | cuda_api_exit | gpu_kernel_start | gpu_kernel_end | gpu_memcpy_start | gpu_memcpy_end | gpu_memset_start | gpu_memset_end | nvtx_range_start | nvtx_range_end | python_gc_start | python_gc_end | marker |
MatchPolicy (JSON) | exact | first_after | nearest | stack_nested | stream_order |
CorrelationConfidence | exact | high | heuristic | ambiguous |
CoverageSource | live | unverified | manifest | unverified_merge |
MemcpyKind | HtoD | DtoH | DtoD | HtoH | PtoP | unknown |
MemoryKind | unknown | pageable | pinned | device | array | managed | device_static | managed_static |
TriggerKind | gap | idle | duration | latency |
TriageSourceKind | thread_time | cgroup | cpu_sample | syscall_aggregate | gpu_health | gpu_activity | python_sample |
PythonSymbolizationStatus | not_detected | inactive | active | unsupported |
PythonTidSource | native | pthread | unmapped |
ExportFormat | jsonl | chrome |
Complete JSON Schemas Index (26 Schemas)
All schemas are generated from xprobe/protocol via Rust schemars and shipped under schemas/ and share/xprobe/schemas/.
| Version | Schema | Purpose |
|---|---|---|
3.0 | measurement-result.schema.json | Single-edge measure result |
3.0 | measurement-graph-spec.schema.json | 1–8 edge measurement graph spec |
3.0 | measurement-graph-validate.schema.json | Measurement graph validation |
3.0 | measurement-graph-result.schema.json | Measurement graph result |
3.0 | aggregate-inventory-result.schema.json | GPU --aggregate inventory |
3.0 | python-sample-result.schema.json | --python-sample stdout summary |
3.0 | python-sample-record.schema.json | --python-sample JSONL line |
3.0 | triage-result.schema.json | --triage same-window snapshot |
3.0 | trigger-result.schema.json | --trigger-* ring capture result |
2.0 | capability.schema.json | doctor capability report |
2.0 | discover.schema.json | discover CUDA process discovery |
2.0 | validate.schema.json | Single-edge validate result |
2.0 | measurement-spec.schema.json | Single-edge measure --spec input |
2.0 | event.schema.json | Event JSONL line |
2.0 | error.schema.json | Structured error response |
2.0 | cpu-sampling-spec.schema.json | --cpu-sample input spec |
2.0 | cpu-sampling-validate.schema.json | --cpu-sample validation |
2.0 | cpu-sample-inventory-result.schema.json | --cpu-sample hotspot inventory |
2.0 | syscall-aggregate-spec.schema.json | --syscall-aggregate input spec |
2.0 | syscall-aggregate-validate.schema.json | --syscall-aggregate validation |
2.0 | syscall-aggregate-result.schema.json | --syscall-aggregate inventory |
2.0 | host-capture.schema.json | Offline host-capture input |
2.0 | inspect.schema.json | Target metadata inspection |
2.0 | resolve.schema.json | Probe symbol resolution |
2.0 | trace-export.schema.json | Trace export metadata |
1.0 | capture-manifest.schema.json | Companion Event JSONL manifest |