This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Questions about STP_TIMING
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: <systemtap at sources dot redhat dot com>
- Date: Thu, 25 Jan 2007 15:46:10 -0800
- Subject: 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