use user-provided log_level in bpf_prog_load
For the case where user provided a log buffer, the
user provided log_level is already been used.
For the case where user provided a log_level and bcc
needs to allocate buffer, the log_level is fixed to 1.
Use user provided log level instead.
@@ -448,6 +448,7 @@ int bpf_prog_load(enum bpf_prog_type prog_type, const char *name,
if (tmp_log_buf)
free(tmp_log_buf);
tmp_log_buf_size = LOG_BUF_SIZE;
+ if (attr.log_level == 0)
attr.log_level = 1;
for (;;) {
tmp_log_buf = malloc(tmp_log_buf_size);
