unsigned int iterations;
bool timestamp;
char *funcname;
+ bool verbose;
} env = {
.interval = 99999999,
.iterations = 99999999,
{ "interval", 'i', "INTERVAL", 0, "Summary interval in seconds"},
{ "duration", 'd', "DURATION", 0, "Duration to trace"},
{ "timestamp", 'T', NULL, 0, "Print timestamp"},
+ { "verbose", 'v', NULL, 0, "Verbose debug output" },
{ NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help"},
{},
};
case 'T':
env->timestamp = true;
break;
+ case 'v':
+ env->verbose = true;
+ break;
case 'h':
argp_state_help(state, stderr, ARGP_HELP_STD_HELP);
break;
return 0;
}
+static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va_list args)
+{
+ if (level == LIBBPF_DEBUG && !env.verbose)
+ return 0;
+ return vfprintf(stderr, format, args);
+}
+
static const char *unit_str(void)
{
switch (env.units) {
sigaction(SIGINT, &sigact, 0);
libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
+ libbpf_set_print(libbpf_print_fn);
obj = funclatency_bpf__open();
if (!obj) {