diff options
author | Jiri Olsa <jolsa@kernel.org> | 2018-04-26 04:18:01 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-04-26 16:39:22 -0400 |
commit | 9b984a20ca84337af81cdab92d1e8ae37007894a (patch) | |
tree | 1f43b64539b0ddef3c6c53d467f8e2201f97d8ff /tools/bpf/bpftool/prog.c | |
parent | fb6ef42b5c8e4ce92c2c3c36398ad7574b290951 (diff) |
tools, bpftool: Display license GPL compatible in prog show/list
Display the license "gpl" string in bpftool prog command, like:
# bpftool prog list
5: tracepoint name func tag 57cd311f2e27366b gpl
loaded_at Apr 26/09:37 uid 0
xlated 16B not jited memlock 4096B
# bpftool --json --pretty prog show
[{
"id": 5,
"type": "tracepoint",
"name": "func",
"tag": "57cd311f2e27366b",
"gpl_compatible": true,
"loaded_at": "Apr 26/09:37",
"uid": 0,
"bytes_xlated": 16,
"jited": false,
"bytes_memlock": 4096
}
]
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r-- | tools/bpf/bpftool/prog.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 548adb9b7317..e71a0a11afde 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c | |||
@@ -235,6 +235,8 @@ static void print_prog_json(struct bpf_prog_info *info, int fd) | |||
235 | info->tag[0], info->tag[1], info->tag[2], info->tag[3], | 235 | info->tag[0], info->tag[1], info->tag[2], info->tag[3], |
236 | info->tag[4], info->tag[5], info->tag[6], info->tag[7]); | 236 | info->tag[4], info->tag[5], info->tag[6], info->tag[7]); |
237 | 237 | ||
238 | jsonw_bool_field(json_wtr, "gpl_compatible", info->gpl_compatible); | ||
239 | |||
238 | print_dev_json(info->ifindex, info->netns_dev, info->netns_ino); | 240 | print_dev_json(info->ifindex, info->netns_dev, info->netns_ino); |
239 | 241 | ||
240 | if (info->load_time) { | 242 | if (info->load_time) { |
@@ -295,6 +297,7 @@ static void print_prog_plain(struct bpf_prog_info *info, int fd) | |||
295 | printf("tag "); | 297 | printf("tag "); |
296 | fprint_hex(stdout, info->tag, BPF_TAG_SIZE, ""); | 298 | fprint_hex(stdout, info->tag, BPF_TAG_SIZE, ""); |
297 | print_dev_plain(info->ifindex, info->netns_dev, info->netns_ino); | 299 | print_dev_plain(info->ifindex, info->netns_dev, info->netns_ino); |
300 | printf("%s", info->gpl_compatible ? " gpl" : ""); | ||
298 | printf("\n"); | 301 | printf("\n"); |
299 | 302 | ||
300 | if (info->load_time) { | 303 | if (info->load_time) { |