On Thu, 2007-06-21 at 05:59 -0700, poornima r wrote: > > We are very thankful to you for providing help and > guidance in running latency testsuites and other > assignments > We are trying to measure context switching latencies > between primary and secondary domains with changes in > the > latency code as specified in the below link > http://www.mail-archive.com/[EMAIL PROTECTED]/msg02875.html > > The following changes are done in the latency code and > the applications are attached > ------------------------------------------------------- > 1:Measured using linux call printf > err = rt_task_wait_period(&ov); > before = rt_timer_tsc(); > printf(" ");
You are measuring time for buffered I/O operations, so your measure is fundamentally flawed, since this jump won't ever jump to kernel space unless the buffer gets full once in a while, and the stdio layer has to sync. At the very least, switch buffering off using setbuf(), give a newline into the string (depends on underlying termio setup in effect, so this is unreliable) or simply invoke an actual system call, like getpgrp() or getppid (and _not_ getpid() which is optimized using direct fetches from PTDs). > after = rt_timer_tsc(); > dt = (long)(after - before); > -------------------------------------------------------- > 2. Measure using Native API call > err = rt_task_wait_period(&ov); > before = rt_timer_tsc(); > rt_task_set_mode (T_PRIMARY, NULL, NULL); > after = rt_timer_tsc(); > dt = (long)(after - before); > --------------------------------------------------------- > The worst case latencies was around 20 us using printf > call and around 60 us when rt_task_set_mode was called > -- Philippe. _______________________________________________ Adeos-main mailing list [email protected] https://mail.gna.org/listinfo/adeos-main
