mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
	David Daney <david.daney@cavium.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Joerg Roedel <joerg.roedel@amd.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Mike Galbraith <efault@gmx.de>,
	Namhyung Kim <namhyung.kim@lge.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	Stephane Eranian <eranian@google.com>
Subject: Re: Fixing perf top --user shortcoming was: Re: [GIT PULL 0/9] perf/core improvements and fixes
Date: Thu, 26 Jan 2012 14:09:19 +0100	[thread overview]
Message-ID: <20120126130919.GA20115@elte.hu> (raw)
In-Reply-To: <20120126122200.GA9128@infradead.org>


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> > So what does --uid do which perf record --pid 1234 wouldnt 
> > already do? By all means --uid ought to be a fancy way of 
> > doing a whole bunch of perf record --pid 1234 profiling 
> > sessions, at once.
> 
> I stopped at the kernel, i.e. used what can be done with what 
> is available from the kernel right now, the diagnosis was sent 
> in private, but boils down to:
> 
> +++ 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?

If yes and if most of the 'real' tasks a user have can be 
profiled just fine then i think we should just skip the 
privileged tasks and not abort the profiling session?

Thanks,

	Ingo

  reply	other threads:[~2012-01-26 13:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24 23:07 Arnaldo Carvalho de Melo
2012-01-24 23:07 ` [PATCH 1/9] perf tools: Add fprintf methods for thread_map and cpu_map classes Arnaldo Carvalho de Melo
2012-01-24 23:07 ` [PATCH 2/9] perf tools: Introduce per user view Arnaldo Carvalho de Melo
2012-01-24 23:07 ` [PATCH 3/9] perf bench: Make "default" memcpy() selection actually use glibc's implementation Arnaldo Carvalho de Melo
2012-01-24 23:07 ` [PATCH 4/9] perf bench: Also allow measuring alternative memcpy implementations Arnaldo Carvalho de Melo
2012-01-24 23:07 ` [PATCH 5/9] perf bench: Also allow measuring memset() Arnaldo Carvalho de Melo
2012-01-24 23:07 ` [PATCH 6/9] perf bench: Allow passing an iteration count to "bench mem mem{cpy,set}" Arnaldo Carvalho de Melo
2012-01-24 23:07 ` [PATCH 7/9] perf tools: Fix broken build by defining _GNU_SOURCE in Makefile Arnaldo Carvalho de Melo
2012-01-24 23:08 ` [PATCH 8/9] perf probe: Usability fixes Arnaldo Carvalho de Melo
2012-01-24 23:08 ` [PATCH 9/9] perf tools: Fix strlen() bug in perf_event__synthesize_event_type() Arnaldo Carvalho de Melo
2012-01-26 11:16 ` [GIT PULL 0/9] perf/core improvements and fixes Ingo Molnar
2012-01-26 12:22   ` Fixing perf top --user shortcoming was: " Arnaldo Carvalho de Melo
2012-01-26 13:09     ` Ingo Molnar [this message]
2012-01-26 14:30       ` Arnaldo Carvalho de Melo
2012-01-26 18:32         ` Ingo Molnar
2012-01-26 19:24           ` Arnaldo Carvalho de Melo

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=20120126130919.GA20115@elte.hu \
    --to=mingo@elte.hu \
    --cc=acme@infradead.org \
    --cc=david.daney@cavium.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=srikar@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome