Skip to content

Commit

Permalink
bpf_load: add map name to load_maps error message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shannon Nelson authored and Daniel Borkmann committed Nov 7, 2018
1 parent 8302b9b commit bce6a14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/bpf/bpf_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit bce6a14

Please sign in to comment.