Skip to content

Commit bce6a14

Browse files
Shannon Nelsonborkmann
authored andcommitted
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 <[email protected]> Acked-by: John Fastabend <[email protected]> Acked-by: Song Liu <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 8302b9b commit bce6a14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/bpf/bpf_load.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ static int load_maps(struct bpf_map_data *maps, int nr_maps,
284284
numa_node);
285285
}
286286
if (map_fd[i] < 0) {
287-
printf("failed to create a map: %d %s\n",
288-
errno, strerror(errno));
287+
printf("failed to create map %d (%s): %d %s\n",
288+
i, maps[i].name, errno, strerror(errno));
289289
return 1;
290290
}
291291
maps[i].fd = map_fd[i];

0 commit comments

Comments
 (0)