Reputation: 554
I'm trying to get the runtime of a given process in kernel space or user space. Anyway here is what i'm trying to do...
//suppose struct task_struct *task has a direct link to pid 1
cputime_t ktime = task->cputime_expires.stime;
cputime_t utime = task->cputime_expires.utime;
cputime_t total = ktime + utime;
printk(KERN_INFO "TOTAL [%lu]",total); // 0
why the output is zero ?
Upvotes: 0
Views: 763