Thread (23 messages) 23 messages, 3 authors, 2026-02-06

Re: [PATCH bpf-next v9 9/9] selftests/bpf: Add tests to verify map create failure log

From: Alexei Starovoitov <hidden>
Date: 2026-02-05 23:18:14
Also in: bpf, linux-kselftest, lkml

On Wed, Feb 4, 2026 at 7:54 PM Leon Hwang [off-list ref] wrote:


On 5/2/26 04:14, Alexei Starovoitov wrote:
quoted
On Mon, Feb 2, 2026 at 6:43 AM Leon Hwang [off-list ref] wrote:
quoted
+
+#define BPF_LOG_FIXED  8
+
+static void test_map_create(enum bpf_map_type map_type, const char *map_name,
+                           struct bpf_map_create_opts *opts, const char *exp_msg)
+{
+       const int key_size = 4, value_size = 4, max_entries = 1;
+       char log_buf[128];
+       int fd;
+       LIBBPF_OPTS(bpf_log_opts, log_opts);
+
+       log_buf[0] = '\0';
+       log_opts.log_buf = log_buf;
+       log_opts.log_size = sizeof(log_buf);
+       log_opts.log_level = BPF_LOG_FIXED;
Why? Which part of the test needs the log with this flag?
BPF_LOG_FIXED looks odd here.

This test sets 'log_level = BPF_LOG_FIXED' to match the behavior of
bpf_vlog_init() as initialized by bpf_log_attr_create_vlog() in
patch #7. BPF_LOG_FIXED is intended to be the default log_level
there.
I don't think you answered my question.
bpf_vlog_init() is using whatever log_level user space provided.
Why do you pass BPF_LOG_FIXED ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help