[ltt-dev] sys time

Gian Lorenzo Meocci glmeocci at gmail.com
Fri Oct 17 09:06:31 EDT 2008


Hi,

I want to retrieve from a lttng trace a total time that a thread has
spent in the kernel.
For example this stupid program uses only sys call functions:

int main()
{
       int i=0;
       char buf[1024];
       FILE *fd=fopen("/dev/urandom","r");
       while(i<10000)
       {
               fread(&buf[0],1,1024,fd);
               i++;
       }

       fclose(fd);
       return 0;
}

if I run it with the linux command "time" I give:

real    0m1.714s
user    0m0.004s
sys     0m1.708s

I want to know if it is possible to obtain this results using lttng trace.
Actually I made a sum of all differences from a
kernel_arch_trap_entry/kernel_arch_trap_exit,
kernel_arch_syscall_entry/exit, kernel_softirq_entry/exit,
mm_handle_fault_entry/exit, kernel_irq_entry/exit.
But for now, my results isn't very good.

Best regards,

-- 
Ing. Gian Lorenzo Meocci
http://www.meocci.it




More information about the lttng-dev mailing list