From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] sim: add helper macros for branch profiling
Date: Sat, 10 Apr 2010 18:58:00 -0000 [thread overview]
Message-ID: <1270925865-23799-1-git-send-email-vapier@gentoo.org> (raw)
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 <vapier@gentoo.org>
---
2010-04-10 Mike Frysinger <vapier@gentoo.org>
* 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
next reply other threads:[~2010-04-10 18:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-10 18:58 Mike Frysinger [this message]
2010-04-12 14:54 ` Joel Brobecker
2010-04-12 16:02 ` Mike Frysinger
2010-04-12 16:09 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1270925865-23799-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox