www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/12/10/09:57:30

To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: "Peter E. Miller" <PMILLER AT dpc DOT hdos DOT hac DOT com>
Date: 10 Dec 92 08:58:51 GMT-0500
Subject: profiling under 1.09

I'm having a problem with 'gprof' when I try to profile execution
times with go32 version 1.09: it doesn't seem to record execution
times in the 'gmon.out' file. I _do_ get timing info when I run it
with 1.08.

A simple test program is at the end of this note. I compile it with:
    gcc -pg -Wall -o test test.c
and run with:
    go32 test
A 'gmon.out' is created, and I profile with:
    gprof test > test.gpr

When I use go32(1.08) to run 'test', gprof produces:

...skipping...
> Each sample counts as 0.0555556 seconds.
>
> % time  seconds   cumsec   calls  function
>  99.70    18.72    18.72    1000  subr
>   0.30     0.06    18.78          close
>   0.00     0.00    18.78       5  fclose
>   0.00     0.00    18.78       5  fflush
...etc.

but with go32(1.09), it's:

...skipping...
> Each sample counts as 0.0555556 seconds.
>
> % time  seconds   cumsec   calls  function
>   0.00     0.00     0.00    1000  subr
>   0.00     0.00     0.00       5  fclose
>   0.00     0.00     0.00       5  fflush
...etc.

If I knew how to fix(?) go32(1.09) I would.  Can anyone help?  For
profiling, using 1.08 is no problem, but it was just luck that I had a
copy of the older go32.exe.

Thanks,
Peter E. Miller
-----------------------------------
The sample program 'test.c':
----------------------------------------------------------------------
void
subr(void)
{
  int i;
  for (i=0; i<10000; i++)
    ;
}

int
main(void)
{
  int i;
  for (i=0; i<1000; i++)
    ;
  for (i=0; i<1000; i++)
    subr();
  exit(0);
}
----------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019