]> sourceware.org Git - systemtap.git/commit
Merge branch 'stapbpf/pr22330': generate printf via event tuples, userspace formattin...
authorSerhei Makarov <smakarov@redhat.com>
Tue, 19 Mar 2019 15:29:25 +0000 (11:29 -0400)
committerSerhei Makarov <smakarov@redhat.com>
Tue, 19 Mar 2019 15:29:25 +0000 (11:29 -0400)
commitab7f8b7ea07aebcc70c484f0ec6d50287ca5b127
treeca7b5117414bc46ccfa01c4d35851f4c9f5c7a7d
parentc7232ec26dd0e702706a1f3a3bd0df3c9a85dc72
parent3b3f97489424f7f0a4e19aff6ed077bf62567ffb
Merge branch 'stapbpf/pr22330': generate printf via event tuples, userspace formatting postprocessing

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.