public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jakob Østergaard" <jakob@unthought.net>
To: Dave Francheski <davef@seven-systems.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: gprof / profiling support ?
Date: Wed, 6 Feb 2002 21:09:12 +0100	[thread overview]
Message-ID: <20020206210912.L14729@unthought.net> (raw)
In-Reply-To: <3C5C1E8A.9D0FFAD3@torque.net> <LBEMJABKBLOPOMBFFMDEKECOCBAA.davef@seven-systems.com>
In-Reply-To: <LBEMJABKBLOPOMBFFMDEKECOCBAA.davef@seven-systems.com>; from davef@seven-systems.com on Tue, Feb 05, 2002 at 03:20:47PM -0800

On Tue, Feb 05, 2002 at 03:20:47PM -0800, Dave Francheski wrote:
> I'm trying to profile an application
> using the 'gprof' utility, and in particular
> get timing information from the profile.
> 
> For some reason, the output from gprof
> displays 
> 
> "no time accumulated"
> 
> and I see no cumulative/self seconds
> at all.  However, all of the call counts
> appear to be correct.
> 
> I suspect that the sampling rate using
> by gprof/linux is simply two slow, given
> the particular application I'm running.
> 
> Can anybody help me obtain timing information
> from gprof and/or point me to a better
> source for application profiling in general?

This is way OT for linux-kernel, but here goes:

If you application runs for a very short amount of time (say, less than a
second) the profile will probably be dominated by glibc startup, application
initializations and exit routines.   It's useless.   That you don't have
time accumulated is the least of your problems - even with the times, your
profile would be random numbers and random function names.

In order to profile *anything* - you should make sure that it runs for a while
(I would say minutes at least, but it depends very much on the complexity of
your application, eg. number of functions involved, and how their run-time is
affected by data input and the environment (timing-sensitive threaded
applications etc.)).  You simply need a good data sample, otherwise any data
you have will be dominated by noise, and your profile will be random.

If it's a very small computational routine, simply put it in a
   for (int i = 0; i != 100000; i++) { ... }

-- 
................................................................
:   jakob@unthought.net   : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob Østergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:

      reply	other threads:[~2002-02-06 20:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-02 17:14 [PATCH] lk 2.5.3 scsi generic (sg) driver Douglas Gilbert
2002-02-05 23:20 ` gprof / profiling support ? Dave Francheski
2002-02-06 20:09   ` Jakob Østergaard [this message]

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=20020206210912.L14729@unthought.net \
    --to=jakob@unthought.net \
    --cc=davef@seven-systems.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