Hi, I have managed to measure the cpu time in nanoseconds. On i386 I used the monotonic_clock() to measure the cpu time. --- Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> escreveu: > Hi... > > On Tuesday 14 March 2006 05:06, Mauricio Lin wrote: > > I am trying to measure the CPU time accurately used by a process > in > > the schedule function through sched_info_depart() and > > sched_info_arrive(), but most of time the calculated CPU time is > > zero. > > Where do you get the total CPU time spent by the process? from > t->sched_info.cpu_time ? Yes, it was based on t->sched_info.cpu_time, but instead of accumulate the all cpu time, I needed just the diff=jiffies -t->sched_info.last_arrival in the sched_info_depart(). The problem was most of time the diff was zero. So to solve this problem I used a monotonic_clock() function that provide more accurate way to measure cpu time. Any comments? BR, Mauricio Lin. _______________________________________________________ Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/