Re: [android-kernel] Meausre CPU usage after renice

2012-06-27 Thread Kanishka Ariyapala
According to this article http://kerneltrap.org/node/11773 it says ' each level of nice adds or substracts 10% of CPU utilization, "*the '10% effect' is relative and cumulative: from _any_ nice level, if you go up 1 level, it's -10% CPU usage, if you go down 1 level it's +10% CPU usage.*" ' Is thi

Re: [android-kernel] Meausre CPU usage after renice

2012-06-27 Thread Kanishka Ariyapala
Looked in to the clock_gettime() it is not going to work as it has to be called inside the process, also it gives the total time taken for a function to complete. This will include the time other processes was using the CPU as well ryt? Yes my goal was to make a process consume more processor by l

Re: [android-kernel] Meausre CPU usage after renice

2012-06-27 Thread Alexander Ray
I don't quite understand what you're trying to do here. Is the goal to make a process consume more processor? If you run a process at a higher priority, it isn't guaranteed to take more cpu time. For example, a heavily i/o bound process could just be woken up a bit faster after blocking, but sti

Re: [android-kernel] Meausre CPU usage after renice

2012-06-27 Thread Glenn Kasten
See also "man clock_gettime" for CLOCK_PROCESS_CPUTIME_ID or CLOCK_THREAD_CPUTIME_ID, which would need to be called by the process or thread itself. On Wednesday, June 27, 2012 1:32:16 AM UTC-7, kanishka wrote: > > I looked in to the /proc//stat and it gives some use full information > about th

Re: [android-kernel] Meausre CPU usage after renice

2012-06-27 Thread Kanishka Ariyapala
I looked in to the /proc//stat and it gives some use full information about the process. There are many time variables and what should I use to calculate the CPU time? Also is there a way to measure if the CPU time slice has increased or the frequency of getting the CPU has in creased after a reni