From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21457 invoked by alias); 8 Aug 2006 11:49:44 -0000 Received: (qmail 21407 invoked by uid 22791); 8 Aug 2006 11:49:44 -0000 X-Spam-Check-By: sourceware.org Received: from bender.bawue.de (HELO bender.bawue.de) (193.7.176.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 Aug 2006 11:49:42 +0000 Received: from lagash (mipsfw.mips-uk.com [194.74.144.146]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by bender.bawue.de (Postfix) with ESMTP id 45B5344209 for ; Tue, 8 Aug 2006 13:49:40 +0200 (MEST) Received: from ths by lagash with local (Exim 4.62) (envelope-from ) id 1GAQ4R-0007Fc-Ro for gdb-patches@sources.redhat.com; Tue, 08 Aug 2006 12:48:27 +0100 Date: Tue, 08 Aug 2006 11:49:00 -0000 To: gdb-patches@sources.redhat.com Subject: [PATCH] sim: Better profiling Message-ID: <20060808114827.GF29989@networkno.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.12-2006-07-14 From: Thiemo Seufer Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00038.txt.bz2 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 * 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)