diff options
author | Alexei Starovoitov <ast@kernel.org> | 2021-05-14 03:36:22 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-05-19 01:42:08 +0300 |
commit | eb0f1e0c7f103e262308d3f12a27a8331af3011a (patch) | |
tree | e178cfcd4a98a582fc74e1efdd356c22e99f6e3b /tools/testing/selftests/bpf/progs | |
parent | 0a9306629983d0be384d4f2557c8c7e2ed086164 (diff) | |
download | linux-eb0f1e0c7f103e262308d3f12a27a8331af3011a.tar.xz |
selftests/bpf: Convert test printk to use rodata.
Convert test trace_printk to more aggressively validate and use rodata.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210514003623.28033-21-alexei.starovoitov@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs')
-rw-r--r-- | tools/testing/selftests/bpf/progs/trace_printk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/progs/trace_printk.c b/tools/testing/selftests/bpf/progs/trace_printk.c index 8ca7f399b670..119582aa105a 100644 --- a/tools/testing/selftests/bpf/progs/trace_printk.c +++ b/tools/testing/selftests/bpf/progs/trace_printk.c @@ -10,11 +10,11 @@ char _license[] SEC("license") = "GPL"; int trace_printk_ret = 0; int trace_printk_ran = 0; -SEC("tp/raw_syscalls/sys_enter") +const char fmt[] = "Testing,testing %d\n"; + +SEC("fentry/__x64_sys_nanosleep") int sys_enter(void *ctx) { - static const char fmt[] = "testing,testing %d\n"; - trace_printk_ret = bpf_trace_printk(fmt, sizeof(fmt), ++trace_printk_ran); return 0; |