Skip to main content

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 unsupported schema_version values fail deserialization.
  • CLI vs. JSON naming: CLI --match uses kebab-case (first-after, stack-nested, stream-order), whereas JSON match_policy uses snake_case (first_after, stack_nested, stream_order).

Input Spec Interfaces (--spec)​

1. MeasurementSpec (single-edge, schema_version: "2.0")​

FieldTypeRequiredNotes
schema_version"2.0"✅Protocol version
targetTargetIdentity✅{ pid: u32, process_start_time?: u64 }
start_selectorstring✅Start event selector
end_selectorstring✅End event selector
match_policyMatchPolicy✅exact | first_after | nearest | stack_nested | stream_order
timeout_msinteger✅Foreground timeout (ms)
measurement_mode"exact" | "aggregate"—Defaults to exact
samplesinteger | null—Matched pair target (set samples or duration_ms)
duration_msinteger | null—Capture window duration (ms)
max_eventsinteger | null—Event cap
max_groupsinteger | null—Max distinct groups in aggregate mode
namestring | null—Optional measurement name

2. MeasurementGraphSpec (1–8 edges, schema_version: "3.0")​

FieldTypeRequiredNotes
schema_version"3.0"✅Protocol version
targetGraphTarget✅{ pid: u32, process_start_time?: u64 }
endpointsRecord<string, string>✅1–8 named endpoints mapped to selector strings
edgesGraphEdgeSpec[]✅1–8 edges: { name, from, to, match_policy, samples? }
timeout_msinteger✅Foreground timeout (ms)
duration_msinteger | null—Graph duration; either every edge sets samples or graph sets duration_ms
max_eventsinteger | null—Total event capacity cap
namestring | null—Optional graph name

3. CpuSamplingSpec & SyscallAggregateSpec (schema_version: "2.0")​

  • CpuSamplingSpec required: 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.
  • SyscallAggregateSpec required: schema_version ("2.0"), target, duration_ms, timeout_ms, max_groups, max_inflight; optional: name.

Command Output Interfaces (stdout JSON)​

doctor (capability.schema.json)​

FieldTypeRequiredNotes
schema_version"2.0"✅Protocol version
okboolean✅Diagnostics completed (not all collectors enabled)
capabilitiesCapabilities✅Collector capability booleans
environmentEnvironment✅Kernel, OS, NVIDIA driver, CUDA/CUPTI paths, namespaces
checksSystemChecks✅Per-check status (available | restricted | unavailable | unknown)
warningsWarning[]—Diagnostic warnings

discover (discover.schema.json)​

FieldTypeRequiredNotes
schema_version"2.0"✅Protocol version
okboolean✅Query succeeded
rootTargetIdentity✅Root process identity
limitinteger✅Requested limit
total_candidatesinteger✅Total matched processes
truncatedboolean✅Whether output hit limit
candidatesCudaProcessCandidate[]✅Confirmed CUDA context holders (PID, start_time, PPID, exe, cmdline, GPU UUIDs)
warningsWarning[]—E.g. NVML_PROCESS_UNAVAILABLE, NVML_PID_NAMESPACE_MISMATCH

validate (validate.schema.json / measurement-graph-validate.schema.json)​

Field (single-edge 2.0)TypeRequiredNotes
schema_version"2.0"✅"3.0" for graph validation
ok / validboolean✅Command succeeded / configuration valid
targetTargetIdentity✅Target identity
start / endValidatedEndpoint✅Endpoint resolution (endpoints & edges for graphs)
match_policyMatchPolicy✅Requested policy
policy_recommendationPolicyRecommendation✅Strongest compatible policy, reason, alternatives
requirementsValidationRequirements✅agent_activation, target_mutation, required capabilities
issues / warningsValidationIssue[] / Warning[]—Validation issues and warnings

measure Output Top-Level Fields by Mode​

Mode / SchemaVersionRequired Top-Level FieldsOptional Fields
Single-edge (measurement-result)3.0schema_version, ok, session_id, status, measurement, quality, correlation, clock, collection, evidencewarnings
Measurement graph (measurement-graph-result)3.0schema_version, ok, session_id, status, target, edges, collectionartifact, name, warnings
Ring trigger (trigger-result)3.0schema_version, ok, session_id, status, target, trigger, observed, windows, collection, warnings—
Python sample (python-sample-result)3.0schema_version, ok, session_id, status, target, inventory, collectionartifact, warnings
GPU aggregate (aggregate-inventory-result)3.0schema_version, ok, session_id, status, inventory, collectionwarnings
Triage (triage-result)3.0schema_version, ok, session_id, status, target, window_ms, findings, threads, cpu_hotspots, python_hotspots, syscalls, gpu_devices, gpu_activity, sources, not_coveredcgroup, cuda_devices, gil_released_proportion, warnings
CPU sample (cpu-sample-inventory-result)2.0schema_version, ok, session_id, status, target, inventory, collection, symbolizationwarnings
Syscall aggregate (syscall-aggregate-result)2.0schema_version, ok, session_id, status, target, inventory, collectionwarnings
Error (error)2.0schema_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
  • 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
  • Python Sample JSONL (python-sample-record.schema.json, 3.0):
    • Required: timestamp_ns, pid, gil, truncated, frames
    • Optional: native, tid

For concrete JSONL line samples, pairing keys, and scripting recipes, see Data Format, Clocks & Scripting.


Core Shared Enums​

EnumValid Values
SessionStatuscompleted | timed_out | cancelled | failed
QualityVerdictgood | caution
CheckStatusavailable | restricted | unavailable | unknown
AgentActivationnot_required | already_loaded | injection_required | startup_required
ClockDomainhost_monotonic | cupti | cupti_normalized_to_host_monotonic
EventSourceebpf | 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
CorrelationConfidenceexact | high | heuristic | ambiguous
CoverageSourcelive | unverified | manifest | unverified_merge
MemcpyKindHtoD | DtoH | DtoD | HtoH | PtoP | unknown
MemoryKindunknown | pageable | pinned | device | array | managed | device_static | managed_static
TriggerKindgap | idle | duration | latency
TriageSourceKindthread_time | cgroup | cpu_sample | syscall_aggregate | gpu_health | gpu_activity | python_sample
PythonSymbolizationStatusnot_detected | inactive | active | unsupported
PythonTidSourcenative | pthread | unmapped
ExportFormatjsonl | 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/.

VersionSchemaPurpose
3.0measurement-result.schema.jsonSingle-edge measure result
3.0measurement-graph-spec.schema.json1–8 edge measurement graph spec
3.0measurement-graph-validate.schema.jsonMeasurement graph validation
3.0measurement-graph-result.schema.jsonMeasurement graph result
3.0aggregate-inventory-result.schema.jsonGPU --aggregate inventory
3.0python-sample-result.schema.json--python-sample stdout summary
3.0python-sample-record.schema.json--python-sample JSONL line
3.0triage-result.schema.json--triage same-window snapshot
3.0trigger-result.schema.json--trigger-* ring capture result
2.0capability.schema.jsondoctor capability report
2.0discover.schema.jsondiscover CUDA process discovery
2.0validate.schema.jsonSingle-edge validate result
2.0measurement-spec.schema.jsonSingle-edge measure --spec input
2.0event.schema.jsonEvent JSONL line
2.0error.schema.jsonStructured error response
2.0cpu-sampling-spec.schema.json--cpu-sample input spec
2.0cpu-sampling-validate.schema.json--cpu-sample validation
2.0cpu-sample-inventory-result.schema.json--cpu-sample hotspot inventory
2.0syscall-aggregate-spec.schema.json--syscall-aggregate input spec
2.0syscall-aggregate-validate.schema.json--syscall-aggregate validation
2.0syscall-aggregate-result.schema.json--syscall-aggregate inventory
2.0host-capture.schema.jsonOffline host-capture input
2.0inspect.schema.jsonTarget metadata inspection
2.0resolve.schema.jsonProbe symbol resolution
2.0trace-export.schema.jsonTrace export metadata
1.0capture-manifest.schema.jsonCompanion Event JSONL manifest