From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, "David Ahern" <dsahern@gmail.com>,
"Namhyung Kim" <namhyung@kernel.org>,
"Jiri Olsa" <jolsa@redhat.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"Frédéric Weisbecker" <fweisbec@gmail.com>
Subject: Re: perf top -u <uid> does not seem to be working
Date: Wed, 13 Nov 2013 14:59:31 -0300 [thread overview]
Message-ID: <20131113175931.GC14758@ghostprotocols.net> (raw)
In-Reply-To: <20131112232249.GA31384@gmail.com>
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
prev parent reply other threads:[~2013-11-13 17:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-12 23:22 perf top -u <uid> does not seem to be working Ingo Molnar
2013-11-12 23:26 ` Ingo Molnar
2013-11-15 7:24 ` [tip:perf/urgent] perf top: Add missing newline if the 'uid' is invalid tip-bot for Ingo Molnar
2013-11-13 17:59 ` Arnaldo Carvalho de Melo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131113175931.GC14758@ghostprotocols.net \
--to=acme@infradead.org \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.