summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@oracle.com>2018-10-29 14:14:41 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2018-11-07 22:34:54 +0100
commitbce6a14996f991e570d973179b5ff57544efaa9a (patch)
treebbfcc421a8e29d61836078eb65572344dd98f062 /samples
parent8302b9bd31d29f29dd24dd6b1e1e5682c302c11c (diff)
downloadlinux-bce6a14996f991e570d973179b5ff57544efaa9a.tar.gz
linux-bce6a14996f991e570d973179b5ff57544efaa9a.tar.bz2
linux-bce6a14996f991e570d973179b5ff57544efaa9a.zip
bpf_load: add map name to load_maps error message
To help when debugging bpf/xdp load issues, have the load_map() error message include the number and name of the map that failed. Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'samples')
-rw-r--r--samples/bpf/bpf_load.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index e6d7e0fe155b..5c052b9ea63f 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -284,8 +284,8 @@ static int load_maps(struct bpf_map_data *maps, int nr_maps,
numa_node);
}
if (map_fd[i] < 0) {
- printf("failed to create a map: %d %s\n",
- errno, strerror(errno));
+ printf("failed to create map %d (%s): %d %s\n",
+ i, maps[i].name, errno, strerror(errno));
return 1;
}
maps[i].fd = map_fd[i];