[PATCH bpf-next 0/2] Add kfunc for doing pid -> task cwd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux