Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] sim: Better profiling
@ 2006-08-08 11:49 Thiemo Seufer
  2006-08-29 14:56 ` Thiemo Seufer
  0 siblings, 1 reply; 3+ messages in thread
From: Thiemo Seufer @ 2006-08-08 11:49 UTC (permalink / raw)
  To: gdb-patches

Hello All,

the appended patch uses a prime number to initialise the PC sampling
frequency, this makes scaling effects less likely.

It also fixes an endianness bug in the sample data printing.


Thiemo


2006-08-08  Nigel Stephens  <nigel@mips.com>

	* sim-profile.c (profile_pc_init): Initialise default profiling
	frequency to a prime number.
	(profile_print_pc): Convert gmon.out sample data into target
	byte order.


Index: sim/common/sim-profile.c
===================================================================
RCS file: /cvs/src/src/sim/common/sim-profile.c,v
retrieving revision 1.5
diff -u -p -r1.5 sim-profile.c
--- sim/common/sim-profile.c	15 Feb 2001 21:14:40 -0000	1.5
+++ sim/common/sim-profile.c	7 Aug 2006 16:52:17 -0000
@@ -519,7 +519,7 @@ profile_pc_init (SIM_DESC sd)
 	  int bucket_size;
 	  /* fill in the frequency if not specified */
 	  if (PROFILE_PC_FREQ (data) == 0)
-	    PROFILE_PC_FREQ (data) = 256;
+	    PROFILE_PC_FREQ (data) = 257;
 	  /* fill in the start/end if not specified */
 	  if (PROFILE_PC_END (data) == 0)
 	    {
@@ -700,6 +700,7 @@ profile_print_pc (sim_cpu *cpu, int verb
 	      sample = 0xffff;
 	    else
 	      sample = PROFILE_PC_COUNT (profile) [loop];
+ 	    H2T (sample);
 	    ok = fwrite (&sample, sizeof (sample), 1, pf);
 	  }
 	if (ok == 0)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-29 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-08 11:49 [PATCH] sim: Better profiling Thiemo Seufer
2006-08-29 14:56 ` Thiemo Seufer
2006-08-29 15:10   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox