kvio × Perfetto see every KV object and every NVMe command on one timeline ========================================================================== .. note:: A styled standalone version of this page (identical content, dark theme) is served at `/showcase/kvio-perfetto.html `__ and via htmlpreview from the repository's ``docs/kvio-perfetto.html``. Convert kvio's cross-layer traces — LMCache semantic object ops, eBPF NVMe passthrough commands with device completions, and serving-layer request spans — into a Perfetto trace you drag onto `ui.perfetto.dev `__ (processing is local to your browser), plus a one-command SQL metrics report. Why a converter is the only way in ---------------------------------- kvio IO is ``io_uring_cmd`` NVMe passthrough on ``/dev/ng*``, which bypasses the block layer — Perfetto's stock ftrace/block ingestion (and ``iostat``) see none of it. The kernel's nvme driver tracepoints do fire for passthrough, but carry no ``user_data`` — so they cannot be joined to KV objects. The eBPF tracer ``nvme_uring_cmd_monitor`` is **the only source that carries trace_id** (``user_data >> 32``, planted by LMCache's raw_block engine), and ``kvio2perfetto.py`` is the bridge from it to a semantically-joined timeline. **found visually** The QD~1 load bug (83 µs submission gaps, worth 4–15× TTFT) is one lonely command slice at a time instead of a dense band. **flows** Arrows tie each KV object span to its first and last device command — click an object, see its IO. **real durations** The tracer's device-completion probe (fentry on ``nvme_uring_cmd_end_io`` — immune to CQ overflow) gives every command its true latency; queue depth becomes visible as slice overlap. Quickstart ---------- :: capture → convert → view# 1. capture: eBPF device stream (+ completions) and the LMCache semantic trace sudo ./nvme_uring_cmd_monitor --jsonl ebpf.jsonl --lba-size 4096 & LMCACHE_KVIO_TRACE=sem.jsonl # 2. convert (pip install perfetto) python3 examples/lmcache/kvio2perfetto.py --sem sem.jsonl --ebpf ebpf.jsonl -o kv.pftrace # 3. view: drag kv.pftrace onto https://ui.perfetto.dev (local-only WASM) # 4. metrics report python3 examples/lmcache/kvio_tp_report.py kv.pftrace **A/B overlays** ``--merge stock=sem1,ebpf1 --merge batched=sem2,ebpf2`` renders arms as separate process groups, each rebased to t=0 — stock-vs-batched or real-vs-replay side by side. A third component per arm (``label=sem,ebpf,serving.jsonl``) adds serving-layer request spans (e.g. recompute-vs-load TTFT) above the device activity. **wedged runs** The converter tolerates a truncated final line and converts still-growing files — converting the live JSONL is the supported way to look inside a hung run. What the timeline shows ----------------------- +--------------------+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | process | tracks | content | +====================+===============================+=======================================================================================================================================================================+ | Serving