lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/8] perf: Allow to block process in syscall tracepoints
On Thu, Dec 06, 2018 at 09:17:07AM +0100, Peter Zijlstra wrote:
> On Wed, Dec 05, 2018 at 05:05:02PM +0100, Jiri Olsa wrote:
> > @@ -10461,6 +10484,19 @@ SYSCALL_DEFINE5(perf_event_open,
> > return -EINVAL;
> > }
> >
> > + if (attr.block) {
> > + /*
> > + * Allow only syscall tracepoints, check for syscall class
> > + * is made in the tracepoint event_init callback.
> > + */
> > + if (attr.type != PERF_TYPE_TRACEPOINT)
> > + return -EINVAL;
> > +
> > + /* Allow to block only if we attach to a process. */
> > + if (pid == -1)
> > + return -EINVAL;
> > + }
> > +
> > /* Only privileged users can get physical addresses */
> > if ((attr.sample_type & PERF_SAMPLE_PHYS_ADDR) &&
> > perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN))
>
> That's fairly horrible and will, when copied, lead to a giant mess.
>
> Please see the whole exclusion patch set here:
>
> https://lkml.kernel.org/r/1543230756-15319-1-git-send-email-andrew.murray@arm.com
>
> PERF_PMU_CAP_BLOCK sounds like something you'd want here.

ok, that's better

jirka

\
 
 \ /
  Last update: 2018-12-06 11:28    [W:0.080 / U:1.604 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site