All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Vagin <avagin@openvz.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Paul Mackerras <paulus@samba.org>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Arun Sharma <asharma@fb.com>
Subject: Re: [PATCH] trace: add ability to set a target task for events (v2)
Date: Wed, 11 Jul 2012 17:07:36 +0200	[thread overview]
Message-ID: <20120711150733.GD17991@somewhere> (raw)
In-Reply-To: <1342018508.3462.163.camel@twins>

On Wed, Jul 11, 2012 at 04:55:08PM +0200, Peter Zijlstra wrote:
> On Wed, 2012-07-11 at 16:48 +0200, Frederic Weisbecker wrote:
> > On Wed, Jul 11, 2012 at 04:38:19PM +0200, Peter Zijlstra wrote:
> > > On Wed, 2012-07-11 at 16:36 +0200, Frederic Weisbecker wrote:
> > > > 
> > > > In this case he can just record sched wakeup as well. With sched_switch
> > > > + sched_wakeup, he'll unlikely lose events.
> > > > 
> > > > With sched_stat_sleep he will lose events, unless we fix this period
> > > > demux thing. 
> > > 
> > > But without this patch, the sched_wakeup will belong to another task, so
> > > if you trace task A, and B wakes you, you'll never see the wakeup.
> > 
> > Ah so the goal is to minimize the amount of events by only tracing task A?
> 
> Right, or just not having sufficient privs to trace the world. And a
> wakeup of A is very much also part of A, not only the task doing the
> wakeup.
> 
> Hence the proposed mechanism.

Yeah that's fair.

> 
> > Ok then. Still we need to fix these events that use __perf_count() because
> > wide tracing of sched_switch/wake_up still generate less events than
> > sched stat sleep.
> > 
> > I believe:
> > 
> > 	perf record -e sched:sched_stat_sleep sleep 1
> > 
> > produces 1 billion events because we sleep 1 billion nanosecs. Or
> > something like that.
> 
> Right.. back when I did that the plan was to make PERF_SAMPLE_PERIOD fix
> that, of course that never seemed to have happened.
> 
> With PERF_SAMPLE_PERIOD you can simply write the 1b into the period of 1
> event and be done with it.

I believe the perf tools handle pretty well variable periods of an event
on top of PERF_SAMPLE_PERIOD. We just need to tweak the maths in
perf_swevent_overflow() I think...

  reply	other threads:[~2012-07-11 15:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 14:14 [PATCH] trace: add ability to set a target task for events (v2) Andrew Vagin
2012-07-11 14:31 ` Frederic Weisbecker
2012-07-11 14:33   ` Peter Zijlstra
2012-07-11 14:36     ` Frederic Weisbecker
2012-07-11 14:38       ` Peter Zijlstra
2012-07-11 14:48         ` Frederic Weisbecker
2012-07-11 14:55           ` Peter Zijlstra
2012-07-11 15:07             ` Frederic Weisbecker [this message]
2012-07-11 15:12             ` Peter Zijlstra
2012-07-11 15:17               ` Frederic Weisbecker
2012-07-11 15:09 ` Peter Zijlstra
2012-07-31 17:58 ` [tip:perf/urgent] perf/trace: Add ability to set a target task for events tip-bot for Andrew Vagin

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=20120711150733.GD17991@somewhere \
    --to=fweisbec@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=asharma@fb.com \
    --cc=avagin@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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.