linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Dietsche <olaf.dietsche@t-online.de>
To: Maciej Soltysiak <solt@dns.toxicfilms.tv>
Cc: linux-kernel@vger.kernel.org
Subject: Re: timing an application
Date: Tue, 14 Jan 2003 23:09:16 +0100	[thread overview]
Message-ID: <87vg0rjsdv.fsf@goat.bogus.local> (raw)
In-Reply-To: Pine.LNX.4.51.0301142044400.6432@dns.toxicfilms.tv

Maciej Soltysiak <solt@dns.toxicfilms.tv> writes:

> being inspired by some book about optimizing c++ code i decided to do
> timing of functions i wrote. I am using gettimeofday to set
> two timeval structs and calculate the time between them.
> But the results depend heavily on the load, also i reckon that this
> is an innacurate timing.

You will get elapsed time, which is usually not the same as used cpu
time.

> Any ideas on timing a function, or a block of code? Maybe some kernel
> timers or something.

If you're timing/pofiling some user space functions, gprof should be
sufficient. If you want to profile kernel and module functions as
well, try oprofile at <http://oprofile.sourceforge.net/>. It is part
of the kernel since 2.5.43.

Regards, Olaf.

  parent reply	other threads:[~2003-01-14 22:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-14 19:58 timing an application Maciej Soltysiak
2003-01-14 20:07 ` Chris Friesen
2003-01-14 20:38   ` Corey Minyard
2003-01-14 20:20 ` Richard B. Johnson
2003-01-15 12:21   ` timing an application [results] Maciej Soltysiak
2003-01-14 22:09 ` Olaf Dietsche [this message]
2003-01-14 20:37 timing an application Howell, David P
2003-01-14 21:34 ` David Mosberger

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=87vg0rjsdv.fsf@goat.bogus.local \
    --to=olaf.dietsche@t-online.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=solt@dns.toxicfilms.tv \
    /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;
as well as URLs for NNTP newsgroup(s).