lkml.org 
[lkml]   [2011]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH V4] POWER: perf_event: Skip updating kernel counters if register value shrinks
Date
From

> On Wed, 27 Apr 2011, David Laight wrote:
>
> > > But it isn't, and it doesn't have trouble with 2^32 - 1.
> >
> > what about:
> > prev = 0x00000001
> > val = 0xffffffff
>
> Result is 0xfffffffe and we are fine.

'delta' will be 0xfffffffe, but you need the function to
return zero - since the underlying counter has decremented
by 2. But 'prev > val' is false so the counter will
be increased by 2^32-2.

David




\
 
 \ /
  Last update: 2011-04-27 15:07    [W:1.722 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site