Skip to content

Instantly share code, notes, and snippets.

@raphaelsc
Last active September 12, 2025 16:48
Show Gist options
  • Select an option

  • Save raphaelsc/00bc08843a7cbe7cee9a59b6255257b2 to your computer and use it in GitHub Desktop.

Select an option

Save raphaelsc/00bc08843a7cbe7cee9a59b6255257b2 to your computer and use it in GitHub Desktop.
io_uring_slowpath.bt
#!/usr/bin/env bpftrace
BEGIN
{
printf("tracing io_uring fast vs slow path...\n");
}
tracepoint:io_uring:io_uring_submit_req
{
@submitted[comm] = count();
}
tracepoint:io_uring:io_uring_queue_async_work
{
@slow_path[comm] = count();
}
interval:s:5
{
printf("\n-- io_uring stats (last 5s) --\n");
for ($kv : @submitted) {
$submitted_sqe = @submitted[$kv.0];
$slow = @slow_path[$kv.0];
$fast = $submitted_sqe - $slow;
printf("%s: total=%d, fast=%d, slow=%d\n", $kv.0, $submitted_sqe, $fast, $slow);
}
clear(@submitted);
clear(@slow_path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment