[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y0nQ4uc7iPHgelfP@maniforge.dhcp.thefacebook.com>
Date: Fri, 14 Oct 2022 16:13:06 -0500
From: David Vernet <void@...ifault.com>
To: bpf@...r.kernel.org
Cc: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
martin.lau@...ux.dev, song@...nel.org, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org, sdf@...gle.com,
haoluo@...gle.com, jolsa@...nel.org, linux-kernel@...r.kernel.org,
kernel-team@...com, tj@...nel.org, memxor@...il.com
Subject: Re: [PATCH v4 2/3] Now that BPF supports adding new kernel functions
with kfuncs, and storing kernel objects in maps with kptrs, we can add a set
of kfuncs which allow struct task_struct objects to be stored in maps as
referenced kptrs. The possible use cases for doing this are plentiful.
During tracing, for example, it would be useful to be able to collect some
tasks that performed a certain operation, and then periodically summarize
who they are, which cgroup they're in, how much CPU time they've utilized,
etc.
On Fri, Oct 14, 2022 at 03:28:51PM -0500, David Vernet wrote:
> In order to enable this, this patch adds three new kfuncs:
>
> struct task_struct *bpf_task_acquire(struct task_struct *p);
> struct task_struct *bpf_task_kptr_get(struct task_struct **pp);
> void bpf_task_release(struct task_struct *p);
>
> A follow-on patch will add selftests validating these kfuncs.
>
> Signed-off-by: David Vernet <void@...ifault.com>
And somehow I managed to remove the commit title for this one. Sincere
apologies for the noise everyone. Hopefully I'll stop going off the
rails in v5.
Powered by blists - more mailing lists