lkml.org 
[lkml]   [2013]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: perf top -u <uid> does not seem to be working
Em Wed, Nov 13, 2013 at 12:22:49AM +0100, Ingo Molnar escreveu:
> Hm, this is unexpected I think:
>
> hubble:~> perf top --stdio -u mingo
> Error:
> You may not have permission to collect stats.
> Consider tweaking /proc/sys/kernel/perf_event_paranoid:
> -1 - Not paranoid at all
> 0 - Disallow raw tracepoint access for unpriv
> 1 - Disallow cpu events for unpriv
> 2 - Disallow kernel profiling for unpriv
>
> hubble:~> cat /proc/sys/kernel/perf_event_paranoid
> -1
>
> (perf is the latest version from tip:perf/core)

https://lkml.org/lkml/2012/1/26/142

Fell thru the cracks, summary:

> > > +++ b/kernel/events/core.c
> > > @@ -2636,7 +2636,8 @@ find_lively_task_by_vpid(pid_t vpid)
> > > /* Reuse ptrace permission checks for now. */
> > > err = -EACCES;
> > > - if (!ptrace_may_access(task, PTRACE_MODE_READ))
> > > + if (perf_paranoid_tracepoint_raw() &&
> > > + !ptrace_may_access(task, PTRACE_MODE_READ))
> > > goto errout;
> > > return task;

> > > ptrace_may_access(task, PTRACE_MODE_READ) fails for some tasks
> > > owned by the user because, IIRC, in __ptrace_may_access:

> > Which tasks are these, are they privileged in any sense?

> IIRC one of them was a child of sshd, that runs as root and then changes
> the child ownership to the user logging in.

- Arnaldo


\
 
 \ /
  Last update: 2013-11-13 19:21    [W:0.046 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site