get_cyles()

Shirley Ma xma at us.ibm.com
Fri Jun 3 02:20:02 EST 2005


Doesn't ppc64 supports get_cycles() correctly?
I used below function to get_cycles(), it seems not right.

t1 = get_cycles();
t2 = get_cycles();

t2-t1 is huge.

static inline cycles_t get_cycles(void)
{
        cycles_t ret;

        __asm__ __volatile__("mftb %0" : "=r" (ret) : );
        return ret;
}

Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone(Fax): (503) 578-7638

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050602/382a94ab/attachment.htm 


More information about the Linuxppc64-dev mailing list