Skip to content

Commit

Permalink
samples: bpf: Update outdated error message
Browse files Browse the repository at this point in the history
Currently, under samples, several methods are being used to load bpf
program.

Since using libbpf is preferred solution, lots of previously used
'load_bpf_file' from bpf_load are replaced with 'bpf_prog_load_xattr'
from libbpf.

But some of the error messages still show up as 'load_bpf_file' instead
of 'bpf_prog_load_xattr'.

This commit fixes outdated errror messages under samples and fixes some
code style issues.

Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20191107005153.31541-2-danieltimlee@gmail.com
  • Loading branch information
Daniel T. Lee authored and Alexei Starovoitov committed Nov 9, 2019
1 parent ed5941a commit afbe3c2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion samples/bpf/hbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static int prog_load(char *prog)
}

if (ret) {
printf("ERROR: load_bpf_file failed for: %s\n", prog);
printf("ERROR: bpf_prog_load_xattr failed for: %s\n", prog);
printf(" Output from verifier:\n%s\n------\n", bpf_log_buf);
ret = -1;
} else {
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp1_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ int main(int argc, char **argv)
map_fd = bpf_map__fd(map);

if (!prog_fd) {
printf("load_bpf_file: %s\n", strerror(errno));
printf("bpf_prog_load_xattr: %s\n", strerror(errno));
return 1;
}

Expand Down
6 changes: 3 additions & 3 deletions samples/bpf/xdp_rxq_info_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ static const struct option long_options[] = {
{"sec", required_argument, NULL, 's' },
{"no-separators", no_argument, NULL, 'z' },
{"action", required_argument, NULL, 'a' },
{"readmem", no_argument, NULL, 'r' },
{"swapmac", no_argument, NULL, 'm' },
{"readmem", no_argument, NULL, 'r' },
{"swapmac", no_argument, NULL, 'm' },
{"force", no_argument, NULL, 'F' },
{0, 0, NULL, 0 }
};
Expand Down Expand Up @@ -499,7 +499,7 @@ int main(int argc, char **argv)
map_fd = bpf_map__fd(map);

if (!prog_fd) {
fprintf(stderr, "ERR: load_bpf_file: %s\n", strerror(errno));
fprintf(stderr, "ERR: bpf_prog_load_xattr: %s\n", strerror(errno));
return EXIT_FAIL;
}

Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_sample_pkts_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main(int argc, char **argv)
return 1;

if (!prog_fd) {
printf("load_bpf_file: %s\n", strerror(errno));
printf("bpf_prog_load_xattr: %s\n", strerror(errno));
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/xdp_tx_iptunnel_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ int main(int argc, char **argv)
return 1;

if (!prog_fd) {
printf("load_bpf_file: %s\n", strerror(errno));
printf("bpf_prog_load_xattr: %s\n", strerror(errno));
return 1;
}

Expand Down

0 comments on commit afbe3c2

Please sign in to comment.