lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150123155724.GA631220@devbig257.prn2.facebook.com>
Date:	Fri, 23 Jan 2015 07:57:24 -0800
From:	Shaohua Li <shli@...com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	<linux-kernel@...r.kernel.org>, <Kernel-team@...com>,
	Andy Lutomirski <luto@...capital.net>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [RFC 2/2] perf: update userspace page info for software event

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ