diff options
author | Ulrich Drepper <drepper@redhat.com> | 1996-10-02 01:40:17 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1996-10-02 01:40:17 +0000 |
commit | a68b0d31a37a86785b3dbeeee3fad96ee71fadcd (patch) | |
tree | 61537b1f028002a9e6e0f5354fced6128bda8b9c /gmon | |
parent | 2d07133b507b13d4a5ed6dc250f4345c8a26942a (diff) | |
download | glibc-a68b0d31a37a86785b3dbeeee3fad96ee71fadcd.tar.gz |
update from main archive 961001
Diffstat (limited to 'gmon')
-rw-r--r-- | gmon/gmon.c | 48 | ||||
-rw-r--r-- | gmon/mcount.c | 1 | ||||
-rw-r--r-- | gmon/sys/gmon_out.h | 18 |
3 files changed, 33 insertions, 34 deletions
diff --git a/gmon/gmon.c b/gmon/gmon.c index ecf7518bfb..00b5df5332 100644 --- a/gmon/gmon.c +++ b/gmon/gmon.c @@ -35,7 +35,6 @@ #include <sys/gmon.h> #include <sys/gmon_out.h> -#include <ansidecl.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> @@ -45,7 +44,7 @@ #include <string.h> #include <unistd.h> -extern int __profile_frequency (void); +extern int __profile_frequency __P ((void)); struct __bb *__bb_head; /* Head of basic-block list or NULL. */ @@ -65,7 +64,8 @@ static int s_scale; * all the data structures are ready. */ void -DEFUN(moncontrol, (mode), int mode) +moncontrol (mode) + int mode; { struct gmonparam *p = &_gmonparam; @@ -85,7 +85,9 @@ DEFUN(moncontrol, (mode), int mode) void -DEFUN(monstartup, (lowpc, highpc), u_long lowpc AND u_long highpc) +monstartup (lowpc, highpc) + u_long lowpc; + u_long highpc; { register int o; char *cp; @@ -155,21 +157,19 @@ DEFUN(monstartup, (lowpc, highpc), u_long lowpc AND u_long highpc) static void -DEFUN(write_hist, (fd), int fd) +write_hist (fd) + int fd; { const u_char tag = GMON_TAG_TIME_HIST; struct gmon_hist_hdr thdr; - int size, rate; if (_gmonparam.kcountsize > 0) { - size = _gmonparam.kcountsize / sizeof(HISTCOUNTER); - rate = __profile_frequency(); - bcopy(&_gmonparam.lowpc, &thdr.low_pc, sizeof(thdr.low_pc)); - bcopy(&_gmonparam.highpc, &thdr.high_pc, sizeof(thdr.high_pc)); - bcopy(&size, &thdr.hist_size, sizeof(thdr.hist_size)); - bcopy(&rate, &thdr.prof_rate, sizeof(thdr.prof_rate)); - strcpy(thdr.dimen, "seconds"); + thdr.low_pc = _gmonparam.lowpc; + thdr.high_pc = _gmonparam.highpc; + thdr.hist_size = _gmonparam.kcountsize / sizeof(HISTCOUNTER); + thdr.prof_rate = __profile_frequency(); + strncpy(thdr.dimen, "seconds", sizeof(thdr.dimen)); thdr.dimen_abbrev = 's'; write(fd, &tag, sizeof(tag)); @@ -180,7 +180,8 @@ DEFUN(write_hist, (fd), int fd) static void -DEFUN(write_call_graph, (fd), int fd) +write_call_graph (fd) + int fd; { const u_char tag = GMON_TAG_CG_ARC; struct gmon_cg_arc_record raw_arc; @@ -200,11 +201,9 @@ DEFUN(write_call_graph, (fd), int fd) to_index != 0; to_index = _gmonparam.tos[to_index].link) { - bcopy(&frompc, &raw_arc.from_pc, sizeof(raw_arc.from_pc)); - bcopy(&_gmonparam.tos[to_index].selfpc, &raw_arc.self_pc, - sizeof(raw_arc.self_pc)); - bcopy(&_gmonparam.tos[to_index].count, &raw_arc.count, - sizeof(raw_arc.count)); + raw_arc.from_pc = frompc; + raw_arc.self_pc = _gmonparam.tos[to_index].selfpc; + raw_arc.count = _gmonparam.tos[to_index].count; write(fd, &tag, sizeof(tag)); write(fd, &raw_arc, sizeof(raw_arc)); @@ -214,7 +213,8 @@ DEFUN(write_call_graph, (fd), int fd) static void -DEFUN(write_bb_counts, (fd), int fd) +write_bb_counts (fd) + int fd; { struct __bb *grp; const u_char tag = GMON_TAG_BB_COUNT; @@ -239,9 +239,8 @@ DEFUN(write_bb_counts, (fd), int fd) void -DEFUN_VOID(_mcleanup) +_mcleanup () { - const int version = GMON_VERSION; struct gmon_hdr ghdr; int fd; @@ -254,8 +253,9 @@ DEFUN_VOID(_mcleanup) } /* write gmon.out header: */ - bcopy(GMON_MAGIC, &ghdr.cookie[0], 4); - bcopy(&version, &ghdr.version, sizeof(version)); + memset(&ghdr, 0, sizeof(ghdr)); + memcpy(&ghdr.cookie[0], GMON_MAGIC, sizeof(ghdr.cookie)); + ghdr.version = GMON_VERSION; write(fd, &ghdr, sizeof(ghdr)); /* write PC histogram: */ diff --git a/gmon/mcount.c b/gmon/mcount.c index 00c9ff8e31..66da3d054b 100644 --- a/gmon/mcount.c +++ b/gmon/mcount.c @@ -58,7 +58,6 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93"; * perform this optimization. */ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ - register u_long frompc, selfpc; { register u_short *frompcindex; register struct tostruct *top, *prevtop; diff --git a/gmon/sys/gmon_out.h b/gmon/sys/gmon_out.h index 4224936b58..ef5b191f3d 100644 --- a/gmon/sys/gmon_out.h +++ b/gmon/sys/gmon_out.h @@ -39,8 +39,8 @@ identifying the type of records, followed by records specific data. */ */ struct gmon_hdr { char cookie[4]; - char version[4]; - char spare[3 * 4]; + int version; + int spare[3]; }; /* types of records in this file: */ @@ -49,18 +49,18 @@ typedef enum { } GMON_Record_Tag; struct gmon_hist_hdr { - char low_pc[sizeof (char *)]; /* base pc address of sample buffer */ - char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */ - char hist_size[4]; /* size of sample buffer */ - char prof_rate[4]; /* profiling clock rate */ + unsigned long low_pc; /* base pc address of sample buffer */ + unsigned long high_pc; /* max pc address of sampled buffer */ + int hist_size; /* size of sample buffer */ + int prof_rate; /* profiling clock rate */ char dimen[15]; /* phys. dim., usually "seconds" */ char dimen_abbrev; /* usually 's' for "seconds" */ }; struct gmon_cg_arc_record { - char from_pc[sizeof (char *)]; /* address within caller's body */ - char self_pc[sizeof (char *)]; /* address within callee's body */ - char count[4]; /* number of arc traversals */ + unsigned long from_pc; /* address within caller's body */ + unsigned long self_pc; /* address within callee's body */ + int count; /* number of arc traversals */ }; #endif /* !_SYS_GMON_OUT_H_ */ |