mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mauricio Lin" <mauriciolin@gmail.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, craig.lkml@gmail.com
Subject: Re: Jiffy is not able to measure the fraction of time a process runs a processor
Date: Wed, 15 Mar 2006 10:40:34 -0400	[thread overview]
Message-ID: <3f250c710603150640y95617e3sfa7c8f8db005290b@mail.gmail.com> (raw)
In-Reply-To: <y0mveugagsm.fsf@ton.toronto.redhat.com>

Hi all,

I have managed to measure the cpu time in nanoseconds. On i386 I have used
the monotonic_clock() to measure the cpu time accurately.

The cpu time measurements were based on t->sched_info.cpu_time, but
instead of accumulate
the all cpu time, I needed just the diff=jiffies
-t->sched_info.last_arrival in the sched_info_depart().

The problem was most of time the diff was zero. So to solve this
problem I used the monotonic_clock() function that provides more accurate
way to measure cpu time.

Any comments?

On 14 Mar 2006 15:54:17 -0500, Frank Ch. Eigler <fche@redhat.com> wrote:
> "Mauricio Lin" <mauriciolin@gmail.com> writes:
>
> >  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.
>
> See sched_clock().

I have checked it. It helped me to reach the monotonic_clock()
function after hacking the code.

>
> >  The example below [...]
> > 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
>
> What tool/patchset are you using to generate this trace?

I am using the relayfs to report the information I need among the
processors. I just put some klog in some key points in the code.

BR,

Mauricio Lin.

  reply	other threads:[~2006-03-15 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-13 13:49 Mauricio Lin
2006-03-14 20:54 ` Frank Ch. Eigler
2006-03-15 14:40   ` Mauricio Lin [this message]
2006-03-15 15:55     ` linux-os (Dick Johnson)
2006-03-15 17:43       ` Mauricio Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f250c710603150640y95617e3sfa7c8f8db005290b@mail.gmail.com \
    --to=mauriciolin@gmail.com \
    --cc=craig.lkml@gmail.com \
    --cc=fche@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®