Thread (16 messages) 16 messages, 2 authors, 2021-09-02

Re: [PATCH v4 bpf-next 8/9] selftests/bpf: add trace_vprintk test prog

From: Andrii Nakryiko <hidden>
Date: 2021-09-02 23:13:26
Also in: netdev

On Thu, Sep 2, 2021 at 10:23 AM Dave Marchevsky [off-list ref] wrote:
This commit adds a test prog for vprintk which confirms that:
  * bpf_trace_vprintk is writing to dmesg
But it doesn't write to dmesg, does it? It's writing to
/sys/kernel/debug/tracing/trace_pipe, which is a different thing
entirely, right?
  * __bpf_vprintk macro works as expected
  * >3 args are printed

Approach and code are borrowed from trace_printk test.

Signed-off-by: Dave Marchevsky <redacted>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/testing/selftests/bpf/Makefile          |  3 +-
 .../selftests/bpf/prog_tests/trace_vprintk.c  | 65 +++++++++++++++++++
 .../selftests/bpf/progs/trace_vprintk.c       | 25 +++++++
 3 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/trace_vprintk.c
 create mode 100644 tools/testing/selftests/bpf/progs/trace_vprintk.c
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help