public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Parav Pandit <paravpandit@yahoo.com>
To: Linux kernel <linux-kernel@vger.kernel.org>
Subject: Calculating time in order of 0.1usec on x86 system
Date: Tue, 30 Sep 2008 00:01:55 -0700 (PDT)	[thread overview]
Message-ID: <855204.33912.qm@web30108.mail.mud.yahoo.com> (raw)

Hi,

I need to calculate time spent by a function in order of less then a microsecond on x86 SMP platform.

Current profiling tools and gettimeofday() are not sufficient.

So I am using get_cycles() to get the CPU cycles.

Now how do I convert it into the time interval?

Do I have to divide it by "cpu_khz" variable? Or some other method?
Is yes, what will be the unit of the result (time interval)? nsec/usec/msec?

e.g. get_cycles()/cpu_khz (unit?)

Or Is there more simpler method exist?

Regards,
Parav Pandit


      

             reply	other threads:[~2008-09-30  7:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30  7:01 Parav Pandit [this message]
2008-09-30  9:37 ` Calculating time in order of 0.1usec on x86 system Parav Pandit

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=855204.33912.qm@web30108.mail.mud.yahoo.com \
    --to=paravpandit@yahoo.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