Messages in this thread | | | From | Mark_H_Johnson@raytheon ... | Subject | Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-15 | Date | Fri, 10 Dec 2004 15:54:07 -0600 |
| |
The code does not quite match either pattern but is perhaps more like your second example.
For reference, the cpu_delay loop looks like this...
t1 = mygettime(); for(u=0;u<(loops/1000);u++) { t0 = t1; if (do_a_trace) { gettimeofday(0, (struct timezone*)1); } for (v=0;v<1000;v++) k+=1; t1 = mygettime(); if ((t1-t0)>max_delay){ delay++; if (do_a_trace) { gettimeofday(0,0); do_a_trace = 0; printf("Trace triggered with %f second delay.\n",t1-t0); } } }
I was trying to avoid the extra "rdtsc" overhead (plus the floating point calculations) so - yes, I could have cases where the time I measure is not caught by the kernel tracer.
[do some tests...] Now I'm 5 for 5 with the revised code. Odd that all the numbers are within about 2 or 3 usec (application measured / kernel measured). If it was as bad as I was measuring it, I would have expected one or two to be really off.
--Mark
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |