[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160126161637.GF6357@twins.programming.kicks-ass.net>
Date: Tue, 26 Jan 2016 17:16:37 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
vince@...ter.net, eranian@...gle.com,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Jiri Olsa <jolsa@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH v2] perf: Synchronously cleanup child events
On Mon, Jan 25, 2016 at 08:59:49PM -0800, Alexei Starovoitov wrote:
> I think I understand what you're trying to do and
> the patch looks good to me.
Great, thanks!
> As far as BPF side I did the following...
> does it match the model you outlined above?
Yes, a few comments/questions below.
>
> Subject: [PATCH ] perf,bpf: convert perf_event_array to use struct file
>
> Signed-off-by: Alexei Starovoitov <ast@...nel.org>
Can I take this through the tip/perf tree so that all these changes land
together?
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 06ae52e99ac2..2a95e0d2370f 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -8896,21 +8896,17 @@ void perf_event_delayed_put(struct task_struct *task)
> WARN_ON_ONCE(task->perf_event_ctxp[ctxn]);
> }
>
> +struct file *perf_event_get(unsigned int fd)
> {
> + struct file *file;
>
> + file = fget_raw(fd);
fget_raw() to guarantee the return value isn't NULL? afaict the O_PATH
stuff does not apply to perf events, so you'd put any fd for which the
distinction matters anyway.
> + if (file->f_op != &perf_fops) {
> + fput(file);
> + return ERR_PTR(-EBADF);
> + }
>
> + return file;
> }
Powered by blists - more mailing lists