mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Jiffy is not able to measure the fraction of time a process runs a processor
@ 2006-03-13 13:49 Mauricio Lin
  2006-03-14 20:54 ` Frank Ch. Eigler
  0 siblings, 1 reply; 5+ messages in thread
From: Mauricio Lin @ 2006-03-13 13:49 UTC (permalink / raw)
  To: linux-kernel

Hi all,

 I am trying to measure the fraction of time a process runs on a
processor, but the jiffies is not able to provide an accurate value.

 The example below shows that in one kernel tick or one jiffy, kmix
and  lpd was schedule in the same processor and the cpu time of each
one was  zero. The calculation of cpu time is based on jiffies and the
cpu time  is zero because the jiffy value was not incremented yet.

  PID  :  NAME              : LAST ARRIVAL : CPU TIME            : CALLER
 4544  : kmix                  : 6170433                 : 0          
                 : work_resched+0x6c
 4078  : lpd                     : 6170433                 : 0        
                   : __down_interruptible+0x5
 4544  : kmix                  : 6170433                 : 0          
                  : schedule_timeout+0xb8


 Look again, when jiffies is 6170503 klipper and emacs are scheduled
many  times.

 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule_irq+0xb8
 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule+0x3d
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x34
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x34
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : preempt_schedule+0x5
 16150 : emacs               : 6170503                 : 0            
              : schedule_timeout+0x34
 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule+0x6c
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x34
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : schedule_timeout+0x5

 Does anyone know how can I measure precisely the fraction of time a
process runs on a processor?

 BR,

 Mauricio Lin.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-15 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-13 13:49 Jiffy is not able to measure the fraction of time a process runs a processor Mauricio Lin
2006-03-14 20:54 ` Frank Ch. Eigler
2006-03-15 14:40   ` Mauricio Lin
2006-03-15 15:55     ` linux-os (Dick Johnson)
2006-03-15 17:43       ` Mauricio Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®