From: Alexei Starovoitov Date: Tue, 8 Mar 2016 05:57:18 +0000 (-0800) Subject: samples/bpf: make map creation more verbose X-Git-Tag: v4.6-rc1~91^2~108^2~3 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;ds=sidebyside;h=618ec9a7b1fda46f8dd4a630ded983aeb51218f3;p=cascardo%2Flinux.git samples/bpf: make map creation more verbose map creation is typically the first one to fail when rlimits are too low, not enough memory, etc Make this failure scenario more verbose Signed-off-by: Alexei Starovoitov Signed-off-by: David S. Miller --- diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c index da86a8e0a95a..816bca5760a0 100644 --- a/samples/bpf/bpf_load.c +++ b/samples/bpf/bpf_load.c @@ -158,8 +158,11 @@ static int load_maps(struct bpf_map_def *maps, int len) maps[i].key_size, maps[i].value_size, maps[i].max_entries); - if (map_fd[i] < 0) + if (map_fd[i] < 0) { + printf("failed to create a map: %d %s\n", + errno, strerror(errno)); return 1; + } if (maps[i].type == BPF_MAP_TYPE_PROG_ARRAY) prog_array_fd = map_fd[i];