mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
UPSTREAM: 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. Change-Id: Ic530ea9da08f5f6479bfd7a5b7c8c26d7d4aaa66 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
This commit is contained in:
parent
c72965f7f4
commit
73ea92cc7a
4 changed files with 78 additions and 0 deletions
|
|
@ -433,6 +433,7 @@ class PrinterHelpers(Printer):
|
|||
'struct __sk_buff',
|
||||
'struct sk_msg_md',
|
||||
'struct xdp_md',
|
||||
'struct path',
|
||||
]
|
||||
known_types = {
|
||||
'...',
|
||||
|
|
@ -473,6 +474,7 @@ class PrinterHelpers(Printer):
|
|||
'struct tcp_request_sock',
|
||||
'struct udp6_sock',
|
||||
'struct task_struct',
|
||||
'struct path',
|
||||
}
|
||||
mapped_types = {
|
||||
'u8': '__u8',
|
||||
|
|
|
|||
Loading…
Reference in a new issue