You need to know exactly what you are doing for using rdtsc. There are some external factors that affect the counting such as dynamic clock, and out of order execution. I'm not sure that rdtsc registers are synchronized on different CPUs. Some code for you to play with: https://github.com/petersenna/rdtscbench https://github.com/petersenna/Kernel/tree/master/stopwatch
On Mon, Apr 7, 2014 at 3:21 PM, Sunny <[email protected]> wrote: > Hi all, > > I'm running xen 4.2 on Linux Kernel 3.7 and I'm trying to figure out the time > taken(latency) by a network packet to reach it's destination VM from the time > it arrives at the NIC. What do you think is the best way to do it? I was > thinking may be add rdtsc timestamp to the IP options header on arrival, and > one more when it reaches to its desired VM and examine the two timestamps. > I've not figured out a way to do this yet--but do you think this is a viable > option or what other methods would you recommend? > > Thanks, > Sunny > _______________________________________________ > Kernelnewbies mailing list > [email protected] > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies -- Peter _______________________________________________ Kernelnewbies mailing list [email protected] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
