[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190507114006.GS2606@hirez.programming.kicks-ass.net>
Date: Tue, 7 May 2019 13:40:06 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Song Liu <songliubraving@...com>
Cc: linux-kernel@...r.kernel.org, kernel-team@...com,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>
Subject: Re: [PATCH] perf: allow non-privileged uprobe for user processes
On Tue, May 07, 2019 at 12:43:15AM -0700, Song Liu wrote:
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index abbd4b3b96c2..0508774d82e4 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -8532,9 +8532,10 @@ static int perf_tp_event_match(struct perf_event *event,
> if (event->hw.state & PERF_HES_STOPPED)
> return 0;
> /*
> - * All tracepoints are from kernel-space.
> + * All tracepoints except uprobes are from kernel-space.
> */
> - if (event->attr.exclude_kernel)
> + if (event->attr.exclude_kernel &&
> + ((event->tp_event->flags & TRACE_EVENT_FL_UPROBE) == 0))
That doesn't make sense; should you not be checking user_mode(regs)
instead?
Powered by blists - more mailing lists