Commit c669257c authored by Teng Qin's avatar Teng Qin

Do not print to stderr if user specified log buffer

parent bf1a54c9
......@@ -474,10 +474,12 @@ int bpf_prog_load(enum bpf_prog_type prog_type, const char *name,
}
}
// If log_level is not 0, either speficied by user or set due to error,
// print the log message.
// Check if we should print the log message if log_level is not 0,
// either specified by user or set due to error.
if (attr.log_level > 0) {
if (log_buf)
// Don't print if user enabled logging and provided log buffer,
// but there is no error.
if (log_buf && ret < 0)
bpf_print_hints(ret, log_buf);
else if (tmp_log_buf)
bpf_print_hints(ret, tmp_log_buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment