All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@fb.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <Kernel-team@fb.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC 2/2] perf: update userspace page info for software event
Date: Fri, 23 Jan 2015 07:57:24 -0800	[thread overview]
Message-ID: <20150123155724.GA631220@devbig257.prn2.facebook.com> (raw)
In-Reply-To: <20150123084451.GE2896@worktop.programming.kicks-ass.net>

On Fri, Jan 23, 2015 at 09:44:51AM +0100, Peter Zijlstra wrote:
> On Thu, Jan 22, 2015 at 01:09:02PM -0800, Shaohua Li wrote:
> > ---
> >  kernel/events/core.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/kernel/events/core.c b/kernel/events/core.c
> > index 4edde3e..4221240 100644
> > --- a/kernel/events/core.c
> > +++ b/kernel/events/core.c
> > @@ -5950,6 +5950,7 @@ static int perf_swevent_add(struct perf_event *event, int flags)
> >  	}
> >  
> >  	hlist_add_head_rcu(&event->hlist_entry, head);
> > +	perf_event_update_userpage(event);
> >  
> >  	return 0;
> >  }
> > @@ -6419,6 +6420,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
> >  {
> >  	if (flags & PERF_EF_START)
> >  		cpu_clock_event_start(event, flags);
> > +	perf_event_update_userpage(event);
> >  
> >  	return 0;
> >  }
> > @@ -6493,6 +6495,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
> >  {
> >  	if (flags & PERF_EF_START)
> >  		task_clock_event_start(event, flags);
> > +	perf_event_update_userpage(event);
> >  
> >  	return 0;
> >  }
> 
> How about the one I sent; which adds it to {start,stop} instead of add?
> {start,stop} is the right place to add them, although this add might be
> sufficient for your use case.
Hi Peter,
I tried {start, stop}, it doesn't work (doesn't get called in context
switch) and I still get a CLOCK_MONOTONIC. So I added it to .add, which
is called in context switch and I got correct thread time. Am I missing
anything?

Thanks,
Shaohua

  reply	other threads:[~2015-01-23 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 21:09 [RFC 1/2] perf: update shadow timestamp before add event Shaohua Li
2015-01-22 21:09 ` [RFC 2/2] perf: update userspace page info for software event Shaohua Li
2015-01-23  8:44   ` Peter Zijlstra
2015-01-23 15:57     ` Shaohua Li [this message]
2015-01-29  7:00       ` Shaohua Li

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=20150123155724.GA631220@devbig257.prn2.facebook.com \
    --to=shli@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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.