Commit 2dc7c1fe authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

tools: bpftool: use more common tag format

Program tag is usually displayed as string of bytes without
any separators (e.g. as "aa5520b1090cfeb6" vs MAC addr-like
format bpftool uses currently: "aa:55:20:b1:09:0c:fe:b6").
Make bptfool use the more common format both for displaying
the tag and selecting the program by tag.

This was pointed out in review but I misunderstood the comment.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2af55f46
...@@ -55,7 +55,7 @@ EXAMPLES ...@@ -55,7 +55,7 @@ EXAMPLES
**# bpftool prog show** **# bpftool prog show**
:: ::
10: xdp name some_prog tag 00:5a:3d:21:23:62:0c:8b 10: xdp name some_prog tag 005a3d2123620c8b
loaded_at Sep 29/20:11 uid 0 loaded_at Sep 29/20:11 uid 0
xlated 528B jited 370B memlock 4096B map_ids 10 xlated 528B jited 370B memlock 4096B map_ids 10
......
...@@ -53,8 +53,7 @@ ...@@ -53,8 +53,7 @@
#define NEXT_ARGP() ({ (*argc)--; (*argv)++; if (*argc < 0) usage(); }) #define NEXT_ARGP() ({ (*argc)--; (*argv)++; if (*argc < 0) usage(); })
#define BAD_ARG() ({ err("what is '%s'?\n", *argv); -1; }) #define BAD_ARG() ({ err("what is '%s'?\n", *argv); -1; })
#define BPF_TAG_FMT "%02hhx:%02hhx:%02hhx:%02hhx:" \ #define BPF_TAG_FMT "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
"%02hhx:%02hhx:%02hhx:%02hhx"
#define HELP_SPEC_PROGRAM \ #define HELP_SPEC_PROGRAM \
"PROG := { id PROG_ID | pinned FILE | tag PROG_TAG }" "PROG := { id PROG_ID | pinned FILE | tag PROG_TAG }"
......
...@@ -224,7 +224,7 @@ static int show_prog(int fd) ...@@ -224,7 +224,7 @@ static int show_prog(int fd)
printf("name %s ", info.name); printf("name %s ", info.name);
printf("tag "); printf("tag ");
print_hex(info.tag, BPF_TAG_SIZE, ":"); print_hex(info.tag, BPF_TAG_SIZE, "");
printf("\n"); printf("\n");
if (info.load_time) { if (info.load_time) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment