archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <>
To: Peter Zijlstra <>
Cc: "Frédéric Weisbecker" <>,
	"Andrew Steets" <>,,,
	"Paul Mackerras" <>,
	"Arnaldo Carvalho de Melo" <>
Subject: Re: perf: prctl(PR_TASK_PERF_EVENTS_DISABLE) has no effect
Date: Mon, 30 Jan 2012 14:58:36 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <1327931107.2446.205.camel@twins>

* Peter Zijlstra <> wrote:

> > What's your concern with the prctl()? This would arguably be 
> > the right kind of usage for prctl(): it's an established 
> > API/ABI for process/task-wide settings.
> Its doing things backwards, [...]

What does that mean?

> [...] also the whole concept of allowing people to hide things 
> from a profiler is so rotten I'm not willing to even consider 
> the notion.

But what we want here is not to hide things from the profiler, 
what we want to be able to is to *ask* the profiler to hide 
things for us, and we do that for a good reason.

This distinction (which I agree is important) could be 
implemented by adding a "allow self-profiling" bit (default 
disabled) in the perf_attr. That way such code would not be able 
to 'hide' from a simple:

  perf top
  perf record -a

session, but would be able to self-profile from such a session:

  perf record --allow-self-profile ...

where there could be some easy shortcut for 
--allow-self-profile, such as:

  perf record -S

that way no code could ever hide from a profiler, only if the 
profiler is specifically allowing self-profiling. (opt in)

The librarization you suggested might make sense too - but i 
think people will gravitate towards the easier to use variant, 
and prctl() is as easy and straightforward as it gets.

We can Cc: it to Linus with an explicit [RFC] and he can shoot 
it down if the API is ugly - but I don't think it's ugly.




  reply	other threads:[~2012-01-30 13:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 17:03 perf: prctl(PR_TASK_PERF_EVENTS_DISABLE) has no effect Andrew Steets
2012-01-27 17:12 ` Peter Zijlstra
2012-01-27 20:06   ` Andrew Steets
2012-01-27 21:34     ` Peter Zijlstra
2012-01-28 12:01 ` Ingo Molnar
2012-01-28 23:48   ` Andrew Steets
2012-01-29 16:32     ` Ingo Molnar
2012-01-29 17:50       ` Gleb Natapov
2012-01-30  9:52       ` Peter Zijlstra
2012-01-30 10:11         ` Ingo Molnar
2012-01-30 11:01           ` Peter Zijlstra
2012-01-30 11:31             ` Ingo Molnar
2012-01-30 13:45               ` Peter Zijlstra
2012-01-30 13:58                 ` Ingo Molnar [this message]
2012-01-30 15:30                 ` Arnaldo Carvalho de Melo
2012-01-30 15:29             ` Arnaldo Carvalho de Melo
2012-02-01 19:03           ` Frederic Weisbecker

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).