NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-amd64/40960: gprof(1) does not report accumulated time for profiled binaries



>Number:         40960
>Category:       port-amd64
>Synopsis:       gprof(1) does not report accumulated time for profiled binaries
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 04 15:30:00 +0000 2009
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.7
>Organization:
Institut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 5.99.7 NetBSD 5.99.7 (LANFEUST) #0: Tue 
Mar 3 12:23:05 CET 2009 
njoly%lanfeust.sis.pasteur.fr@localhost:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST
 amd64
Architecture: x86_64
Machine: amd64
>Description:
gprof(1) does not report accumulated time for profiled binaries on amd64 (i
checked that it works fine on i386 and alpha).

njoly@lanfeust [tmp/gprof]> cat prof.c 
#include <err.h>
#include <stdlib.h>
#include <string.h>

int main() {
  char *buf;
  int i, cnt;
  size_t len;

  cnt = 10000;
  len = 1 * 1024 * 1024;

  for (i = 0; i < cnt; i++) {
    buf = malloc(len);
    if (buf == NULL)
      err(1, "malloc failed");
    (void)memset(buf, 0xff, len);
    free(buf);
  }

  return 0; }
njoly@lanfeust [tmp/gprof]> cc -pg -o prof prof.c 
njoly@lanfeust [tmp/gprof]> /usr/bin/time ./prof
       16.10 real         4.20 user        11.69 sys
njoly@lanfeust [tmp/gprof]> gprof ./prof ./gmon.out
Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  Ts/call  Ts/call  name    
  0.00      0.00     0.00   160011     0.00     0.00  __libc_mutex_trylock
  0.00      0.00     0.00    20000     0.00     0.00  base_chunk_node_alloc
  0.00      0.00     0.00    20000     0.00     0.00  chunk_tree_s_RB_INSERT


>How-To-Repeat:
Try the above sequence.
>Fix:
Please.



Home | Main Index | Thread Index | Old Index