[PATCH] Fix profiling on hppa (1/2)

Carlos O'Donell carlos@baldric.uwo.ca
Fri Feb 20 04:14:00 GMT 2004


libc-alpha,

Fixes gprof for hppa. This requires some changes to generic code in
order to get alignment correct.

Tested on i386, hppa.

Thanks,
c.

2003-11-15  Randolph Chung  <tausq@debian.org>

	* gmon/gmon.c (__monstartup): Round kcountsize to multiples of
	the froms[] array so the array is properly aligned.

--- libc-orig/gmon/gmon.c	2003-09-04 10:20:46.000000000 -0400
+++ libc/gmon/gmon.c	2003-12-15 00:38:40.000000000 -0500
@@ -114,7 +114,7 @@
   p->lowpc = ROUNDDOWN(lowpc, HISTFRACTION * sizeof(HISTCOUNTER));
   p->highpc = ROUNDUP(highpc, HISTFRACTION * sizeof(HISTCOUNTER));
   p->textsize = p->highpc - p->lowpc;
-  p->kcountsize = p->textsize / HISTFRACTION;
+  p->kcountsize = ROUNDUP(p->textsize / HISTFRACTION, sizeof(*p->froms));
   p->hashfraction = HASHFRACTION;
   p->log_hashfraction = -1;
   /* The following test must be kept in sync with the corresponding



More information about the Libc-alpha mailing list