Trace Event Format summary CLI
0

Configure Feed

Select the types of activity you want to include in your feed.

catapult: capture the probe fixture trace via observe.capture

The fixture embeds capture in-process (rather than letting obs run own it) so the cram test is one deterministic invocation; the capture config now comes from observe.capture, started before emit and stopped after.

+19 -4
+1 -1
test/cram/helpers/dune
··· 1 1 (executable 2 2 (name probe_workload) 3 - (libraries observe probe cmdliner unix)) 3 + (libraries observe observe.capture probe cmdliner unix))
+18 -3
test/cram/helpers/probe_workload.ml
··· 67 67 alloc_some_words words; 68 68 Unix.sleepf 0.001 69 69 70 - let run _config = 70 + let workload () = 71 71 Probe.with_span workload_span () @@ fun () -> 72 72 Probe.record queue_counter 0; 73 73 Probe.emit io_event ("tx", 1200); ··· 78 78 noalloc_path (); 79 79 large_alloc_path (); 80 80 Probe.record queue_counter 1; 81 - Probe.emit result_event (200, 42); 81 + Probe.emit result_event (200, 42) 82 + 83 + (* [--probe FILE] capture lives in observe.capture, not Observe.setup: normal 84 + CLIs let [obs run -- CMD] own capture, but this fixture embeds it in-process 85 + so the cram test is a single deterministic invocation. Start the capture 86 + before emitting, and stop it (flushing the trace) after. *) 87 + let run () probe_config = 88 + let stop = 89 + match probe_config with 90 + | Some cfg -> Observe_capture.probe_capture_config cfg 91 + | None -> fun () -> () 92 + in 93 + Fun.protect ~finally:stop workload; 82 94 print_endline "fixture workload complete" 83 95 84 96 let cmd = 85 97 let doc = "Emit a deterministic probe workload for catapult tests" in 86 98 Cmd.v 87 99 (Cmd.info "probe-workload" ~doc) 88 - Term.(const run $ Observe.setup "catapult-fixture") 100 + Term.( 101 + const run 102 + $ Observe.setup "catapult-fixture" 103 + $ Observe_capture.probe_config) 89 104 90 105 let () = exit (Cmd.eval cmd)