From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9342 invoked by alias); 10 Apr 2010 18:58:10 -0000 Received: (qmail 9330 invoked by uid 22791); 10 Apr 2010 18:58:09 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 10 Apr 2010 18:58:05 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id AC45B1B4033 for ; Sat, 10 Apr 2010 18:58:03 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: add helper macros for branch profiling Date: Sat, 10 Apr 2010 18:58:00 -0000 Message-Id: <1270925865-23799-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00303.txt.bz2 The profile code has a lot of helper macros already, but none yet for the branch profiling code. So add ones for the basic functions -- taken and untaken branches. Signed-off-by: Mike Frysinger --- 2010-04-10 Mike Frysinger * sim-profile.h (PROFILE_BRANCH_TAKEN, PROFILE_BRANCH_UNTAKEN): New defines. sim/common/sim-profile.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/sim/common/sim-profile.h b/sim/common/sim-profile.h index 315a79f..c35fe0c 100644 --- a/sim/common/sim-profile.h +++ b/sim/common/sim-profile.h @@ -290,6 +290,22 @@ do { \ #define PROFILE_COUNT_CORE(cpu, addr, size, map) #endif /* ! core */ +#if WITH_PROFILE_MODEL_P +#define PROFILE_BRANCH_TAKEN(cpu) \ +do { \ + if (PROFILE_MODEL_P (cpu)) \ + ++ PROFILE_MODEL_TAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \ +} while (0) +#define PROFILE_BRANCH_UNTAKEN(cpu) \ +do { \ + if (PROFILE_MODEL_P (cpu)) \ + ++ PROFILE_MODEL_UNTAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \ +} while (0) +#else +#define PROFILE_BRANCH_TAKEN(cpu) +#define PROFILE_BRANCH_UNTAKEN(cpu) +#endif /* ! model */ + /* Misc. utilities. */ extern void sim_profile_print_bar (SIM_DESC, unsigned int, unsigned int, unsigned int); -- 1.7.0.2