Software Archive
Read-only legacy content
17061 Discussions

RDTSC and Dual Xeon

sgwoodjr
Beginner
837 Views
I have a dual Xeon server running Redhat Linux. I want to use the RDTSC command to accurately obtain cycle counts of various C functions. Currently I am accessing the RDTSC command and associated registers via inline assembly in a C function.

Questions: How does the RDTSC work with dual Xeon processors? Are the RDTSC cycle counts synchronized across both processors? What is the recommended way to use RDTSC with dual Xeon processors ?

Thanks,

-Simon
0 Kudos
3 Replies
TimP
Honored Contributor III
837 Views
Most dual Xeon systems are set up to initialize rdtsc counters as closely as possible. Recent models derive the rdtsc from the front side bus clock, so that variations in relative CPU clock speed don't affect synchronization. Of course,varying CPU clock speed will change the number of FSB cycles required for a given sequence of operations.
0 Kudos
sgwoodjr
Beginner
837 Views
Thank you for the response.

Is it possible to execute the RDTSC command on a specific processor in a dual processor configuration?

-Simon
0 Kudos
TimP
Honored Contributor III
837 Views
In principle, thread affinity functions, or Windows process affinity functionality, could be used to lock the thread you use for rdtsc() to a specific CPU.
0 Kudos
Reply