2006. április 28. 07.34 dátummal Hareesh Nagarajan ezt írta: > On 4/27/06, Mauricio Lin <mauriciolin2000@xxxxxxxxxxxx> wrote: > > Since sched_clock() function is implemented differently for each arch, > > how can I figure out the maximum value sched_clock can return? > > This doesn't concern your question, but I was looking at: > sched_clock() defined in arch/i386/kernel/timers/timer_tsc.c: > > <definition_sans_comments> > unsigned long long sched_clock(void) > { > unsigned long long this_offset; > #ifndef CONFIG_NUMA > if (!use_tsc) > #endif > return jiffies_64 * (1000000000 / HZ); > rdtscll(this_offset); > return cycles_2_ns(this_offset); > } > </definition_sans_comments> > > Why do we have the second return statement in the first place? It will > never be executed. Hmm ... if CONFIG_NUMA is not defined, the first return is executed only if (!use_tsc) expression is true. If (!use_tsc) is false then the second return is reached and executed. Mulder -- ============ The Bug Is Out There! ================== -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/