All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Andrew Steets" <asteets@rgmadvisors.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Paul Mackerras" <paulus@samba.org>,
	"Arnaldo Carvalho de Melo" <acme@ghostprotocols.net>
Subject: Re: perf: prctl(PR_TASK_PERF_EVENTS_DISABLE) has no effect
Date: Mon, 30 Jan 2012 14:45:07 +0100	[thread overview]
Message-ID: <1327931107.2446.205.camel@twins> (raw)
In-Reply-To: <20120130113115.GA6565@elte.hu>

On Mon, 2012-01-30 at 12:31 +0100, Ingo Molnar wrote:
> * Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> 
> > On Mon, 2012-01-30 at 11:11 +0100, Ingo Molnar wrote:
> > > So, what workflow are you suggesting to Andrew?
> > 
> > Librarize perf record, then in your code do something like:
> > 
> > #include "perf_record.h"
> 
> Maybe. (and then it shouldnt be limited to perf_record.h but 
> should be events.h plus libevents.so or such)

Yes it should be, you want to reserve the more generic name for less
narrow interfaces.

> > 
> >   handle = perf_record_init(); /* creates perf events and creates
> >                                   a record thread that writes samples
> >                                   to perf.data, consumes env(PERF_*)
> >                                   for configuration, registers with
> >                                   at_exit() for cleanup */
> >   if (!handle)
> >     /* burn */
> > 
> >   /* do you other code */
> > 
> >   perf_record_start(handle);
> > 
> >   /* do the bit you want profiled */
> > 
> >   perf_record_stop(handle);
> > 
> > Then build with -lperfrecord or so. Not too hard, right?
> 
> Isnt a simple prctl() so much easier and faster?

I really don't want to add another two prctl()s for this, ideally I'd
remove the ones we have now, but I've never done due to maintaining
backwards blah..

> 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, 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.

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

Thread overview: 30+ 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 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 [this message]
2012-01-30 13:58                 ` Ingo Molnar
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
2013-05-30 23:45 ` Using perf and cgroups to profile part of a long-running program Riku Saikkonen
  -- strict thread matches above, loose matches on Subject: below --
2012-07-26 10:54 perf: prctl(PR_TASK_PERF_EVENTS_DISABLE) has no effect Iegorov Oleg
2012-07-27  7:26 ` Ingo Molnar
2012-07-27  8:00   ` Peter Zijlstra
2012-07-27  8:18     ` Ingo Molnar
2012-07-27  8:29       ` Peter Zijlstra
2012-07-27 11:40         ` Iegorov Oleg
2012-07-27 11:53         ` Ingo Molnar
2012-07-30 20:04           ` Andi Kleen
2012-07-31  5:47           ` Peter Zijlstra
2012-07-31  7:16             ` Ingo Molnar
2012-07-31 19:48               ` Peter Zijlstra

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=1327931107.2446.205.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=asteets@rgmadvisors.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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.