public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: mcuss@cdlsystems.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Measuring execution time
Date: Wed, 16 Jan 2002 12:23:33 -0500	[thread overview]
Message-ID: <3C45B715.926A0BA0@nortelnetworks.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0201151409270.1744-100000@barbarella.hawaga.org.uk> <042f01c19e13$6da6f4f0$160e10ac@hades>

Mark Cuss wrote:

> I am working on optimizing some software and would like to be able to
> measure how long an instruction takes (down to the clock cycle of the CPU).
> I recall reading somewhere about a kernel time measurement called a "Jiffy"
> and figured that it would probably apply to this.
> 
> If anyone has any tips on how to figure out how to do this I'd really
> appreciate it.

Jiffies are quite coarse-grained.  On x86 you want the rdtsc instruction, while
on ppc you want mfrtcu/mfrtcl or mftbu/mftb depending on the version of the
chip.  These are used as inline assembly, and if you do a google search you
should be able to find code snippets.

Chris

-- 
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com

  reply	other threads:[~2002-01-16 17:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-15 16:01 [ANNOUNCE][PATCH] New fs to control access to system resources Olaf Dietsche
2002-01-15 16:53 ` Richard Gooch
2002-01-15 17:38   ` Wichert Akkerman
2002-01-15 17:54     ` Richard Gooch
2002-01-15 17:48   ` Olaf Dietsche
2002-01-16 19:05   ` Andreas Ferber
2002-01-15 22:13 ` Ben Clifford
2002-01-15 22:24   ` Measuring execution time Mark Cuss
2002-01-16 17:23     ` Chris Friesen [this message]
2002-01-16 17:53       ` Richard B. Johnson
2002-01-16 21:47       ` Jakob Østergaard
2002-01-16 17:18   ` [ANNOUNCE][PATCH] New fs to control access to system resources Olaf Dietsche
2002-01-16 18:26     ` Ben Clifford
2002-01-17  0:34       ` Olaf Dietsche
2002-01-15 22:51 ` CaT
2002-01-15 23:00   ` David Weinehall
2002-01-15 23:13     ` CaT
2002-01-16  4:19 ` dean gaudet
2002-01-16 17:18   ` Olaf Dietsche
2002-01-16 18:12     ` dean gaudet
2002-01-17  0:34       ` Olaf Dietsche
2002-01-16 18:51 ` Andreas Ferber
2002-01-16 13:38   ` gmack
2002-01-16 23:06   ` Greg KH
2002-01-17  9:26     ` Andreas Ferber
2002-01-18 19:38       ` Greg KH
2002-01-18 15:36 ` Anthony DeRobertis
2002-01-18 18:22   ` Olaf Dietsche

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=3C45B715.926A0BA0@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcuss@cdlsystems.com \
    /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