Repository navigation
Conversation
An introspecting guest runs vmi's telem-capture from boot: it fills the export ring the kernel offers at /dev/telem, and is the source of every rich event the host sidecar sees. So far only urunc's legacy BusyBox /init started it, which is why brig-standalone-linux-priv still builds that layout instead of the single-binary initrd hull-assets ships. Both early-init roles now start it, right after /dev, /proc and /sys are mounted and before the root, when /dev/telem exists. It comes from one of two places: the bytes a build with TELEM_CAPTURE=<path> embeds in urunit (.incbin into .rodata between two symbols init.c declares weak, so a build without them leaves the symbols null and nothing else changes), run from a memfd; or /vmi-telem-capture in the initrd. Either way it is fexecve'd as a child of PID 1 while this initramfs is still the root, so switch_root deleting the file does not matter, and the reaping loop collects it like the agent. tracefs is mounted first, since the producer lays its probes out from the tracepoint format files. The producer is given --ready-fd on a pipe and the init waits up to three seconds for its readiness byte, so the workload starts under capture; a producer that exits first (end of file) or stalls (timeout) is logged and the boot goes on without the rich channel. A kernel without /dev/telem boots as before, so one initrd serves a stock and an introspecting kernel. Tested on an x86_64 KVM host with the hull-assets introspection kernel (6.18.60, ring built in) under cloud-hypervisor-vmi: the producer is ready 50 ms after fork, embedded, and the sidecar drains the workload's exec and syscall records with no drops. Unit tests cover the readiness wait: byte, end of file, timeout. Signed-off-by: Anastassios Nanos <ananos@nofire.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Both early-init roles start the in-guest telemetry producer (vmi's
telem-capture) before the root is mounted, when the kernel offers/dev/telem, and wait for it to report ready. The producer can be embedded in urunit, so an introspecting initrd stays one file.So far only urunc's legacy BusyBox
/initstarted the producer, which is why brig-standalone-linux-priv still builds that layout instead of the single-binary initrd hull-assets ships.How
make static TELEM_CAPTURE=<path>embeds a prebuilt static producer for the target architecture:.incbininto.rodatabetweenurunit_telem_capture_bloband_end, assembled with--noexecstack. init.c declares the symbols weak, so a build withoutTELEM_CAPTUREleaves them null and nothing else changes; the init then falls back to/vmi-telem-capturein the initrd, and does nothing when neither exists.memfd(embedded) or the initrd file throughfexecve, as a child of PID 1 while the initramfs is still the root, soswitch_rootdeleting the file does not matter. The reaping loop collects it like the agent. Its output goes to/dev/kmsg.--ready-fdon a pipe (NOFireAI/vmi#295) and the init waits up to 3 s for the byte: ready, exited first (EOF) or stalled (timeout) are each logged; the boot goes on in every case./dev/telem, so the same initrd serves a stock and an introspecting kernel.Verification
make static checkwith glibc (Ubuntu, nofire) and musl (Alpine 3.21): PASS. New unit testtest_capture_wait_readycovers byte, end of file and timeout.End to end on nofire (x86_64, KVM): hull-assets introspection kernel 6.18.60 (NOFireAI/hull-assets#35 CI artifact,
CONFIG_TELEM=y, modules off), cloud-hypervisor-vmi at the fork commit vmi 2594a64 pins, sidecar and producer from vmi-binaries at 2594a64. Initrd: urunit with the producer embedded, three links, mount-point dirs, 1.7 MB. Console:Sidecar: attached to the telemetry region,
records=1845 drops=0 seq_gaps=0; 117nofire.vmi.process.execrecords naming the workload'sls,cat,sync,sleepand/bin/sh /work.sh.Base
Stacked on
stack/10-acpi-power-button, the branch hull-assets pins (48a61bd);mainis 20 commits behind it.Follow-ups
TELEM_CAPTUREfrom vmi-binaries at the pinnedVMI_REFfor the introspection bundle variant.🤖 Generated with Claude Code
https://claude.ai/code/session_01HEbPad1TPYJvLXQDpypFKT