Skip to contentSkip to conversation

bpf_helpers_doc.py: Fix warning when compiling bpftool.

PATCH Applied Carlos Neira 4 participants 5 messages Mar 13, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf_helpers_doc.py: Fix warning when compiling bpftool.

When compiling bpftool the following warning is found:
"declaration of 'struct bpf_pidns_info' will not be visible outside of this function." This patch adds struct bpf_pidns_info to type_fwds array to fix this.

---
 scripts/bpf_helpers_doc.py | 1 +
 1 file changed, 1 insertion(+)
scripts/bpf_helpers_doc.py +1 -0
index c1e2b5410faa..f43d193aff3a 100755
@@ -400,6 +400,7 @@ class PrinterHelpers(Printer):
             'struct bpf_fib_lookup',
             'struct bpf_perf_event_data',
             'struct bpf_perf_event_value',
+            'struct bpf_pidns_info',
             'struct bpf_sock',
             'struct bpf_sock_addr',
             'struct bpf_sock_ops',
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

2020-03-13 12:46 UTC-0300 ~ Carlos Neira <[email protected]>

Quoted 16 lines

When compiling bpftool the following warning is found:
"declaration of 'struct bpf_pidns_info' will not be visible outside of this function." This patch adds struct bpf_pidns_info to type_fwds array to fix this.

---
 scripts/bpf_helpers_doc.py | 1 +
 1 file changed, 1 insertion(+)
scripts/bpf_helpers_doc.py +0 -0
index c1e2b5410faa..f43d193aff3a 100755

scripts/bpf_helpers_doc.py class PrinterHelpers(Printer): · line 406

Quoted 7 lines
scripts/bpf_helpers_doc.py +1 -0
@@ -400,6 +400,7 @@ class PrinterHelpers(Printer):
             'struct bpf_fib_lookup',
             'struct bpf_perf_event_data',
             'struct bpf_perf_event_value',
+            'struct bpf_pidns_info',
             'struct bpf_sock',
             'struct bpf_sock_addr',
             'struct bpf_sock_ops',

Note that the warning is not specific to bpftool (I just happened to spot it when compiling this tool), it's for anything that uses libbpf, or more generally, the generated header for helpers.

It is fixed by your patch, thank you!

Acked-by on v1 1/1
#2 lore raw
In reply to Carlos Neira
Quoted 6 lines · Carlos Neira

When compiling bpftool the following warning is found:
"declaration of 'struct bpf_pidns_info' will not be visible outside of this function." This patch adds struct bpf_pidns_info to type_fwds array to fix this.

Fixes b4490c5c4e02 ("bpf: Added new helper bpf_get_ns_current_pid_tgid")

Please add the Fixes tag next time. Other than tracking, it will be easier for review purpose also.

#3 lore raw
Quoted 6 lines · Martin KaFai Lau
Quoted 5 lines · Carlos Neira

When compiling bpftool the following warning is found:
"declaration of 'struct bpf_pidns_info' will not be visible outside of this function." This patch adds struct bpf_pidns_info to type_fwds array to fix this.

Quoted 6 lines
Quoted 1 line
Fixes b4490c5c4e02 ("bpf: Added new helper bpf_get_ns_current_pid_tgid")

Please add the Fixes tag next time. Other than tracking, it will be easier for review purpose also.

Thanks, I will do that in the future.

Bests

maintainer Applied
#4 lore raw
Quoted 7 lines · Carlos Antonio Neira Bustos
Quoted 6 lines · Martin KaFai Lau
Quoted 5 lines · Carlos Neira

When compiling bpftool the following warning is found:
"declaration of 'struct bpf_pidns_info' will not be visible outside of this function." This patch adds struct bpf_pidns_info to type_fwds array to fix this.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Fixes b4490c5c4e02 ("bpf: Added new helper bpf_get_ns_current_pid_tgid")

Please add the Fixes tag next time. Other than tracking, it will be easier for review purpose also.

Thanks, I will do that in the future.

Applied, thanks!