how to calculate total cpu time of task in percentage using task_struct
with the 2 fields of task_struct stucture, utime and stime i am calculating total time a task taken,
The procedure i m following in every 100th timer interrupt, I am updating cpu time of current task
(now_cpu - previous_cpu)/(now_jiffies -prev_jiffeis)
now_cpu = (utime+stime);
but i am not satisfied with the result,any one have idea about that
please help me out.