* 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.
#include <sys/cdefs.h>
/*
#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).
/*
* histogram counters are unsigned shorts (according to the kernel).
u_long highpc;
u_long textsize;
u_long hashfraction;
u_long highpc;
u_long textsize;
u_long hashfraction;
};
extern struct gmonparam _gmonparam;
};
extern struct gmonparam _gmonparam;