diff options
author | Jiri Olsa <jolsa@kernel.org> | 2020-08-25 22:21:20 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-26 01:41:15 +0300 |
commit | 6e22ab9da79343532cd3cde39df25e5a5478c692 (patch) | |
tree | 0421c44d1e43134bdf0abcdf575b0520e99796ec /scripts/bpf_helpers_doc.py | |
parent | eae2e83e62633a2659e3bc690facba1c2fc9c45b (diff) | |
download | linux-6e22ab9da79343532cd3cde39df25e5a5478c692.tar.xz |
bpf: Add d_path helper
Adding d_path helper function that returns full path for
given 'struct path' object, which needs to be the kernel
BTF 'path' object. The path is returned in buffer provided
'buf' of size 'sz' and is zero terminated.
bpf_d_path(&file->f_path, buf, size);
The helper calls directly d_path function, so there's only
limited set of function it can be called from. Adding just
very modest set for the start.
Updating also bpf.h tools uapi header and adding 'path' to
bpf_helpers_doc.py script.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: KP Singh <kpsingh@google.com>
Link: https://lore.kernel.org/bpf/20200825192124.710397-11-jolsa@kernel.org
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
-rwxr-xr-x | scripts/bpf_helpers_doc.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/bpf_helpers_doc.py b/scripts/bpf_helpers_doc.py index 5bfa448b4704..08388173973f 100755 --- a/scripts/bpf_helpers_doc.py +++ b/scripts/bpf_helpers_doc.py @@ -432,6 +432,7 @@ class PrinterHelpers(Printer): 'struct __sk_buff', 'struct sk_msg_md', 'struct xdp_md', + 'struct path', ] known_types = { '...', @@ -472,6 +473,7 @@ class PrinterHelpers(Printer): 'struct tcp_request_sock', 'struct udp6_sock', 'struct task_struct', + 'struct path', } mapped_types = { 'u8': '__u8', |