* [PATCH bpf-next 0/2] Add kfunc for doing pid -> task cwd
@ 2025-05-29 3:26 Rong Tao
0 siblings, 0 replies; only message in thread
From: Rong Tao @ 2025-05-29 3:26 UTC (permalink / raw)
To: ast, daniel
Cc: rtoax, rongtao, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
Shuah Khan, Juntong Deng, Amery Hung, Dave Marchevsky,
open list:BPF [GENERAL] (Safe Dynamic Programs and Tools),
open list, open list:KERNEL SELFTEST FRAMEWORK
In some application like bpftrace [1], need to get the cwd from the pid.
This patch provides a new kfunc that can get the cwd of the process from
the pid.
[1] https://github.com/bpftrace/bpftrace/issues/3314
Rong Tao (2):
bpf: Add bpf_task_cwd_from_pid() kfunc
selftests/bpf: Add selftests for bpf_task_cwd_from_pid()
kernel/bpf/helpers.c | 45 ++++++++++++++++++
.../selftests/bpf/prog_tests/task_kfunc.c | 3 ++
.../selftests/bpf/progs/task_kfunc_common.h | 1 +
.../selftests/bpf/progs/task_kfunc_success.c | 47 +++++++++++++++++++
4 files changed, 96 insertions(+)
--
2.49.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-29 3:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29 3:26 [PATCH bpf-next 0/2] Add kfunc for doing pid -> task cwd Rong Tao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).