This merges a simple transport layer design which uses
perf_events to send each printf as a series of messages,
freeing stapbpf from the deliberately-oppressive constraints
of the trace_printk() mechanism.
e.g. printf("%8d %8d %6s\n", x, y, foo) is sent as
- STP_PRINTF_START(3)
- STP_PRINTF_FORMAT(#1) -> index into a table of format strings
- STP_PRINTF_ARG_LONG(x)
- STP_PRINTF_ARG_LONG(y)
- STP_PRINTF_ARG_STR(foo) -> requires an strcpy() to compose the message
- STP_PRINTF_END()
Which involves six calls to BPF_perf_event_output from
the kernel-side BPF program. Each CPU has its own perf_events
buffer to avoid entangling parallel printfs().
For now, use separate messages to avoid putting pressure on the
very limited stack and avoid complicated packing code. Further
down the line, we could combine small (LONG) arguments into
a several-argument message, or merge STP_PRINTF_START and STP_PRINTF_FORMAT.
This page took 0.027545 seconds and 5 git commands to generate.