bpftool: Respect the -d option in struct_ops cmd
Subsystems (4)
PATCH 1/1 bpftool: Respect the -d option in struct_ops cmd
In the prog cmd, the "-d" option turns on the verifier log. This is missed in the "struct_ops" cmd and this patch fixes it.
Fixes 65c93628599d ("bpftool: Add struct_ops support")
Signed-off-by Martin KaFai Lau <[email protected]>
--- tools/bpf/bpftool/struct_ops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tools/bpf/bpftool/struct_ops.c +7 -1
@@ -479,6 +479,7 @@ static int do_unregister(int argc, char **argv)static int do_register (int argc,char **argv) { +struct bpf_object_load_attr load_attr = {};const struct bpf_map_def *def;struct bpf_map_info info = {};__u32 info_len =sizeof (info);
@@ -499,7 +500,12 @@ static int do_register(int argc, char **argv)set_max_rlimit (); -if (bpf_object__load (obj)) { + load_attr.obj = obj; +if (verifier_logs) +/* log_level1 + log_level2 + stats, but not stable UAPI */ + load_attr.log_level =1 +2 +4 ; + +if (bpf_object__load_xattr (&load_attr)) {bpf_object__close (obj);return -1 ; }
Signature · 1 line
2.24.1
2020-04-24 11:29 UTC-0700 ~ Martin KaFai Lau <[email protected]>
Quoted 5 lines
In the prog cmd, the "-d" option turns on the verifier log. This is missed in the "
struct_ops" cmd and this patch fixes it.Fixes 65c93628599d ("bpftool: Add struct_ops support")Signed-off-by Martin KaFai Lau <[email protected]>
Looks good to me, thanks!
Reviewed-by Quentin Monnet <[email protected]>
Alexei Starovoitov
AppliedQuoted 10 lines · Quentin Monnet
2020-04-24 11:29 UTC-0700 ~ Martin KaFai Lau <[email protected]>
Quoted 5 lines
In the prog cmd, the "-d" option turns on the verifier log. This is missed in the "
struct_ops" cmd and this patch fixes it.Fixes 65c93628599d ("bpftool: Add struct_ops support")Signed-off-by Martin KaFai Lau <[email protected]>Looks good to me, thanks!
Reviewed-by Quentin Monnet <[email protected]>
Applied. Thanks