mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
tools: bpftool: fix plain output and doc for --bpffs option
Edit the documentation of the -f|--bpffs option to make it explicit that it dumps paths of pinned programs when bpftool is used to list the programs only, so that users do not believe they will see the name of the newly pinned program with "bpftool prog pin" or "bpftool prog load". Also fix the plain output: do not add a blank line after each program block, in order to remain consistent with what bpftool does when the option is not passed. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
53909030aa
commit
a8bfd2bc29
2 changed files with 3 additions and 3 deletions
|
@ -124,7 +124,8 @@ OPTIONS
|
||||||
Generate human-readable JSON output. Implies **-j**.
|
Generate human-readable JSON output. Implies **-j**.
|
||||||
|
|
||||||
-f, --bpffs
|
-f, --bpffs
|
||||||
Show file names of pinned programs.
|
When showing BPF programs, show file names of pinned
|
||||||
|
programs.
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
|
|
@ -357,10 +357,9 @@ static void print_prog_plain(struct bpf_prog_info *info, int fd)
|
||||||
if (!hash_empty(prog_table.table)) {
|
if (!hash_empty(prog_table.table)) {
|
||||||
struct pinned_obj *obj;
|
struct pinned_obj *obj;
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
hash_for_each_possible(prog_table.table, obj, hash, info->id) {
|
hash_for_each_possible(prog_table.table, obj, hash, info->id) {
|
||||||
if (obj->id == info->id)
|
if (obj->id == info->id)
|
||||||
printf("\tpinned %s\n", obj->path);
|
printf("\n\tpinned %s", obj->path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue