From acf51e02617b9b8da57b0ee982f96080ee954a38 Mon Sep 17 00:00:00 2001 From: "Thomas Bushnell, BSG" Date: Fri, 6 Sep 1996 00:08:55 +0000 Subject: *** empty log message *** Thu Sep 5 13:18:25 1996 Thomas Bushnell, n/BSG * sysdeps/mach/hurd/i386/init-first.c (__libc_argc, __libc_argv): New variables. (init1): Initialize them. * hurd/hurdinit.c (_hurd_setproc): Now that happens to be available, pass __libc_argv in call to __proc_set_arg_locations. * gmon/gmon.c (write_hist): Call __profile_frequency instead of hertz. (hertz): Delete function. * gmon/Makefile (routines): Add `prof-freq'. * sysdeps/generic/prof-freq.c: New file. * sysdeps/mach/hurd/prof-freq.c: New (stubby) file. * sysdeps/mach/hurd/profil.c (profile_tick): New variable. (update_waiter): Store frequency in profile_tick. (__profile_frequency): New function. * sysdeps/mach/hurd/sendto.c (sendto): Use prototype definition syntax. * Rules (generated): Restore reference to $(generated). * mach/Machrules (mig.uh, mig.__h): Don't include $(user-MIGFLAGS) here. * malloc/free.c (free): __lib_malloc_lock -> __libc_malloc_lock. * malloc/free.c: Provide extern decl of __libc_malloc_lock. * malloc/realloc.c: Likewise. * malloc/malloc-find.c: Likewise. * malloc/malloc-size.c: Likewise. * malloc/malloc-walk.c: Likewise. * malloc/memalign.c: Likewise. * mach/Machrules (mig.uh, mig.__h): Include $(user-MIGFLAGS) and --- sysdeps/mach/hurd/profil.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sysdeps/mach/hurd/profil.c') diff --git a/sysdeps/mach/hurd/profil.c b/sysdeps/mach/hurd/profil.c index 431982e498..41c7c4b956 100644 --- a/sysdeps/mach/hurd/profil.c +++ b/sysdeps/mach/hurd/profil.c @@ -36,6 +36,7 @@ static size_t sample_scale; static sampled_pc_seqno_t seqno; static struct mutex lock = MUTEX_INITIALIZER; static mach_msg_timeout_t collector_timeout; /* ms between collections. */ +static int profile_tick; /* Enable statistical profiling, writing samples of the PC into at most SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling @@ -62,8 +63,7 @@ update_waiter (u_short *sample_buffer, size_t size, size_t offset, u_int scale) if (! err) { - int tick; /* Microseconds per sample. */ - err = __task_enable_pc_sampling (__mach_task_self (), &tick, + err = __task_enable_pc_sampling (__mach_task_self (), &profile_tick, SAMPLED_PC_PERIODIC); if (!err && sample_scale == 0) /* Profiling was not turned on, so the collector thread was @@ -79,13 +79,19 @@ update_waiter (u_short *sample_buffer, size_t size, size_t offset, u_int scale) and the kernel buffer size we get the length of time it takes to fill the buffer; translate that to milliseconds for mach_msg, and chop it in half for general lag factor. */ - collector_timeout = MAX_PC_SAMPLES * tick / 1000 / 2; + collector_timeout = MAX_PC_SAMPLES * profile_tick / 1000 / 2; } } return err; } +int +__profile_frequency () +{ + return profile_tick; +} + int profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale) { -- cgit 1.4.1