This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Questions about STP_TIMING


On Thursday, January 25, 2007 3:35 PM, Frank Ch. Eigler wrote:
>> Second, in the calculation of the delta, there's this little bit:
> 
>>   // Handle 32-bit wraparound.
>>   o->newline() << "int32_t cycles_elapsed =3D (cycles_atend >
>>   cycles_atstart)"; o->newline(1) << "? (cycles_atend -
>>   cycles_atstart)"; o->newline() << ": (~(int32_t)0) -
>> cycles_atstart + cycles_atend + 1;";
> 
>> Can you explain the need for this?  [...]  If you're trying to
>> account for wraparound in the get_cycles() return value, you need to
>> know where the wraparound occurs, right?
> 
> Not really - by masking (in this case) at 32 bits, we force a 32-bit
> wraparound.

Ok... but those are int32_t values, so you're *already* masked at
32-bits.  The funky subtraction is redundant at that point.


Josh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]