projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d6e6286
)
veristat: add -d debug mode option to see debug libbpf log
author
Andrii Nakryiko
<andrii@kernel.org>
Mon, 27 Mar 2023 18:52:01 +0000
(11:52 -0700)
committer
Alexei Starovoitov
<ast@kernel.org>
Thu, 30 Mar 2023 00:22:01 +0000
(17:22 -0700)
Add -d option to allow requesting libbpf debug logs from veristat.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link:
https://lore.kernel.org/r/20230327185202.1929145-3-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/veristat.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/bpf/veristat.c
b/tools/testing/selftests/bpf/veristat.c
index
8323145
..
263df32
100644
(file)
--- a/
tools/testing/selftests/bpf/veristat.c
+++ b/
tools/testing/selftests/bpf/veristat.c
@@
-135,6
+135,7
@@
static struct env {
char **filenames;
int filename_cnt;
bool verbose;
char **filenames;
int filename_cnt;
bool verbose;
+ bool debug;
bool quiet;
int log_level;
enum resfmt out_fmt;
bool quiet;
int log_level;
enum resfmt out_fmt;
@@
-169,7
+170,7
@@
static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va
{
if (!env.verbose)
return 0;
{
if (!env.verbose)
return 0;
- if (level == LIBBPF_DEBUG
/* && !env.verbose */
)
+ if (level == LIBBPF_DEBUG
&& !env.debug
)
return 0;
return vfprintf(stderr, format, args);
}
return 0;
return vfprintf(stderr, format, args);
}
@@
-186,6
+187,7
@@
static const struct argp_option opts[] = {
{ NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help" },
{ "verbose", 'v', NULL, 0, "Verbose mode" },
{ "log-level", 'l', "LEVEL", 0, "Verifier log level (default 0 for normal mode, 1 for verbose mode)" },
{ NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help" },
{ "verbose", 'v', NULL, 0, "Verbose mode" },
{ "log-level", 'l', "LEVEL", 0, "Verifier log level (default 0 for normal mode, 1 for verbose mode)" },
+ { "debug", 'd', NULL, 0, "Debug mode (turns on libbpf debug logging)" },
{ "quiet", 'q', NULL, 0, "Quiet mode" },
{ "emit", 'e', "SPEC", 0, "Specify stats to be emitted" },
{ "sort", 's', "SPEC", 0, "Specify sort order" },
{ "quiet", 'q', NULL, 0, "Quiet mode" },
{ "emit", 'e', "SPEC", 0, "Specify stats to be emitted" },
{ "sort", 's', "SPEC", 0, "Specify sort order" },
@@
-212,6
+214,10
@@
static error_t parse_arg(int key, char *arg, struct argp_state *state)
case 'v':
env.verbose = true;
break;
case 'v':
env.verbose = true;
break;
+ case 'd':
+ env.debug = true;
+ env.verbose = true;
+ break;
case 'q':
env.quiet = true;
break;
case 'q':
env.quiet = true;
break;