bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/2] Introduce a new kfunc of bpf_task_under_cgroup
@ 2023-04-21  9:04 Feng zhou
  2023-04-21  9:04 ` [PATCH bpf-next v2 1/2] bpf: Add bpf_task_under_cgroup() kfunc Feng zhou
  2023-04-21  9:04 ` [PATCH bpf-next v2 2/2] selftests/bpf: Add testcase for bpf_task_under_cgroup Feng zhou
  0 siblings, 2 replies; 6+ messages in thread
From: Feng zhou @ 2023-04-21  9:04 UTC (permalink / raw)
  To: martin.lau, ast, daniel, andrii, song, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, davem, edumazet, kuba, pabeni,
	mykolal, shuah
  Cc: bpf, linux-kernel, netdev, linux-kselftest, yangzhenze,
	wangdongdong.6, zhoufeng.zf

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:
v1->v2: Addressed comments from Alexei Starovoitov
- Add kfunc instead.
Details in here:
https://lore.kernel.org/all/20230420072657.80324-1-zhoufeng.zf@bytedance.com/

 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-23 16:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21  9:04 [PATCH bpf-next v2 0/2] Introduce a new kfunc of bpf_task_under_cgroup Feng zhou
2023-04-21  9:04 ` [PATCH bpf-next v2 1/2] bpf: Add bpf_task_under_cgroup() kfunc Feng zhou
2023-04-21 18:20   ` Alexei Starovoitov
2023-04-21  9:04 ` [PATCH bpf-next v2 2/2] selftests/bpf: Add testcase for bpf_task_under_cgroup Feng zhou
2023-04-21 18:24   ` Alexei Starovoitov
     [not found]     ` <f860cf89-74b2-9102-d28b-abec7d51f349@bytedance.com>
2023-04-23 16:22       ` [External] " Alexei Starovoitov

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).