linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf: prctl(PR_TASK_PERF_EVENTS_DISABLE) has no effect
@ 2012-07-26 10:54 Iegorov Oleg
  2012-07-27  7:26 ` Ingo Molnar
  0 siblings, 1 reply; 14+ messages in thread
From: Iegorov Oleg @ 2012-07-26 10:54 UTC (permalink / raw)
  To: linux-perf-users, mingo, a.p.zijlstra, acme

as there was no proposed solution that helped me in response to the same 
post by Andrew Steets, I would like to know if it is possible to 
disable/enable perf event counters from the source code?

calling prctl(PR_TASK_PERF_EVENTS_DISABLE) has no effect, nor does 
compiling with -fno-omit-frame-pointer option.

It would be extremely useful to disable perf event counters for some 
parts of code and re-enable them for other parts of code, like:

prctl(PR_TASK_PERF_EVENTS_DISABLE);
// not important for performance analysis code
prctl(PR_TASK_PERF_EVENTS_ENABLE);
// code that needs to be analysed

and then, run perf:

$ perf record ./program
$ perf report

Can anyone tell me how can I enable such functionality?
Thank you

--Oleg

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-08-06  1:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-07-27 11:56   ` [RFD] perf: events defined contexts (was Re: perf: prctl(PR_TASK_PERF_EVENTS_DISABLE) has no effect) Frederic Weisbecker
2012-07-27 12:45     ` Jiri Olsa
2012-08-06  1:41       ` Namhyung Kim

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