mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
This commit is contained in:
parent
fb6ef42b5c
commit
9b984a20ca
2 changed files with 5 additions and 1 deletions
|
|
@ -95,7 +95,7 @@ EXAMPLES
|
|||
**# bpftool prog show**
|
||||
::
|
||||
|
||||
10: xdp name some_prog tag 005a3d2123620c8b
|
||||
10: xdp name some_prog tag 005a3d2123620c8b gpl
|
||||
loaded_at Sep 29/20:11 uid 0
|
||||
xlated 528B jited 370B memlock 4096B map_ids 10
|
||||
|
||||
|
|
@ -108,6 +108,7 @@ EXAMPLES
|
|||
"id": 10,
|
||||
"type": "xdp",
|
||||
"tag": "005a3d2123620c8b",
|
||||
"gpl_compatible": true,
|
||||
"loaded_at": "Sep 29/20:11",
|
||||
"uid": 0,
|
||||
"bytes_xlated": 528,
|
||||
|
|
|
|||
|
|
@ -235,6 +235,8 @@ static void print_prog_json(struct bpf_prog_info *info, int fd)
|
|||
info->tag[0], info->tag[1], info->tag[2], info->tag[3],
|
||||
info->tag[4], info->tag[5], info->tag[6], info->tag[7]);
|
||||
|
||||
jsonw_bool_field(json_wtr, "gpl_compatible", info->gpl_compatible);
|
||||
|
||||
print_dev_json(info->ifindex, info->netns_dev, info->netns_ino);
|
||||
|
||||
if (info->load_time) {
|
||||
|
|
@ -295,6 +297,7 @@ static void print_prog_plain(struct bpf_prog_info *info, int fd)
|
|||
printf("tag ");
|
||||
fprint_hex(stdout, info->tag, BPF_TAG_SIZE, "");
|
||||
print_dev_plain(info->ifindex, info->netns_dev, info->netns_ino);
|
||||
printf("%s", info->gpl_compatible ? " gpl" : "");
|
||||
printf("\n");
|
||||
|
||||
if (info->load_time) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue