[PATCH bpf-next v2 0/2] Introduce a new kfunc of bpf_task_under_cgroup
From: Feng zhou
Date: Fri Apr 21 2023 - 05:06:01 EST
From: Feng Zhou <zhoufeng.zf@xxxxxxxxxxxxx>
Trace sched related functions, such as enqueue_task_fair, it is necessary to
specify a task instead of the current task which within a given cgroup.
Feng Zhou (2):
bpf: Add bpf_task_under_cgroup() kfunc
selftests/bpf: Add testcase for bpf_task_under_cgroup
Changelog:
v1->v2: Addressed comments from Alexei Starovoitov
- Add kfunc instead.
Details in here:
https://lore.kernel.org/all/20230420072657.80324-1-zhoufeng.zf@xxxxxxxxxxxxx/
kernel/bpf/helpers.c | 19 ++++++++
.../bpf/prog_tests/task_under_cgroup.c | 46 +++++++++++++++++++
.../selftests/bpf/progs/cgrp_kfunc_common.h | 1 +
.../bpf/progs/test_task_under_cgroup.c | 40 ++++++++++++++++
4 files changed, 106 insertions(+)
create mode 100644 tools/testing/selftests/bpf/prog_tests/task_under_cgroup.c
create mode 100644 tools/testing/selftests/bpf/progs/test_task_under_cgroup.c
--
2.20.1