| From: |
| Feng zhou <zhoufeng.zf-AT-bytedance.com> |
| To: |
| martin.lau-AT-linux.dev, ast-AT-kernel.org, daniel-AT-iogearbox.net, andrii-AT-kernel.org, song-AT-kernel.org, yhs-AT-fb.com, john.fastabend-AT-gmail.com, kpsingh-AT-kernel.org, sdf-AT-google.com, haoluo-AT-google.com, jolsa-AT-kernel.org, davem-AT-davemloft.net, edumazet-AT-google.com, kuba-AT-kernel.org, pabeni-AT-redhat.com, mykolal-AT-fb.com, shuah-AT-kernel.org |
| Subject: |
| [PATCH bpf-next v3 0/2] Introduce a new kfunc of bpf_task_under_cgroup |
| Date: |
| Thu, 27 Apr 2023 10:30:17 +0800 |
| Message-ID: |
| <20230427023019.73576-1-zhoufeng.zf@bytedance.com> |
| Cc: |
| bpf-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, netdev-AT-vger.kernel.org, linux-kselftest-AT-vger.kernel.org, yangzhenze-AT-bytedance.com, wangdongdong.6-AT-bytedance.com, zhoufeng.zf-AT-bytedance.com |
| Archive-link: |
| Article |
From: Feng Zhou <zhoufeng.zf@bytedance.com>
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:
v2->v3: Addressed comments from Alexei Starovoitov
- Modify the comment information of the function.
- Narrow down the testcase's hook point
Details in here:
https://lore.kernel.org/all/20230421090403.15515-1-zhoufe...
v1->v2: Addressed comments from Alexei Starovoitov
- Add kfunc instead.
Details in here:
https://lore.kernel.org/all/20230420072657.80324-1-zhoufe...
kernel/bpf/helpers.c | 20 ++++++++
tools/testing/selftests/bpf/DENYLIST.s390x | 1 +
.../bpf/prog_tests/task_under_cgroup.c | 47 +++++++++++++++++++
.../selftests/bpf/progs/cgrp_kfunc_common.h | 1 +
.../bpf/progs/test_task_under_cgroup.c | 37 +++++++++++++++
5 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