Sun Feb 25 22:36:10 1996 David Mosberger-Tang <davidm@azstarnet.com>
authorroland <roland>
Tue, 19 Mar 1996 20:08:48 +0000 (20:08 +0000)
committerroland <roland>
Tue, 19 Mar 1996 20:08:48 +0000 (20:08 +0000)
* gmon/gmon.c (__bb_head): new variable.
(write_hist, write_call_graph, write_bb_counts): new functions.
(_mcleanup): modified to call above functions instead of directly
  writing out gmon.out.
* gmon/sys/gmon.h (struct __bb): New type.
(struct gmonhdr): Type removed.
(struct gmonparam): New member `log_hashfraction'.
(GMONVERSION): Macro removed.

gmon/sys/gmon.h

index f7af72b..8cbd6bd 100644 (file)
 #include <sys/cdefs.h>
 
 /*
- * Structure prepended to gmon.out profiling data file.
+ * See gmon_out.h for gmon.out format.
  */
-struct gmonhdr {
-       u_long  lpc;            /* base pc address of sample buffer */
-       u_long  hpc;            /* max pc address of sampled buffer */
-       int     ncnt;           /* size of sample buffer (plus this header) */
-       int     version;        /* version number */
-       int     profrate;       /* profiling clock rate */
-       int     spare[3];       /* reserved */
+
+/* structure emitted by "gcc -a".  This must match struct bb in
+   gcc/libgcc2.c.  It is OK for gcc to declare a longer structure as
+   long as the members below are present.  */
+struct __bb
+{
+  long                 zero_word;
+  const char           *filename;
+  long                 *counts;
+  long                 ncounts;
+  struct __bb          *next;
+  const unsigned long  *addresses;
 };
-#define GMONVERSION    0x00051879
+
+extern struct __bb *__bb_head;
 
 /*
  * histogram counters are unsigned shorts (according to the kernel).
@@ -137,6 +143,7 @@ struct gmonparam {
        u_long          highpc;
        u_long          textsize;
        u_long          hashfraction;
+       long            log_hashfraction;
 };
 extern struct gmonparam _gmonparam;