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(+)
linux-kselftest-mirror@lists.linaro.org