Questions about STP_TIMING

Stone, Joshua I joshua.i.stone@intel.com
Thu Jan 25 23:46:00 GMT 2007


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



More information about the Systemtap mailing list