* [PATCH] sim: add helper macros for branch profiling
@ 2010-04-10 18:58 Mike Frysinger
2010-04-12 14:54 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2010-04-10 18:58 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sim: add helper macros for branch profiling
2010-04-10 18:58 [PATCH] sim: add helper macros for branch profiling Mike Frysinger
@ 2010-04-12 14:54 ` Joel Brobecker
2010-04-12 16:02 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2010-04-12 14:54 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
> 2010-04-10 Mike Frysinger <vapier@gentoo.org>
>
> * sim-profile.h (PROFILE_BRANCH_TAKEN, PROFILE_BRANCH_UNTAKEN): New
> defines.
Forgive my ignorance, but are these macros going to be automatically
used? Or is there another patch in the pipeline that makes use of them?
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sim: add helper macros for branch profiling
2010-04-12 14:54 ` Joel Brobecker
@ 2010-04-12 16:02 ` Mike Frysinger
2010-04-12 16:09 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2010-04-12 16:02 UTC (permalink / raw)
To: gdb-patches; +Cc: Joel Brobecker
[-- Attachment #1: Type: Text/Plain, Size: 663 bytes --]
On Monday 12 April 2010 10:54:18 Joel Brobecker wrote:
> > 2010-04-10 Mike Frysinger <vapier@gentoo.org>
> >
> > * sim-profile.h (PROFILE_BRANCH_TAKEN, PROFILE_BRANCH_UNTAKEN): New
> > defines.
>
> Forgive my ignorance, but are these macros going to be automatically
> used? Or is there another patch in the pipeline that makes use of them?
i'm using them in the Blackfin sim. once i can get the Blackfin FDPIC shared
lib stuff working with latest GDB again, i'll post that patch series.
i'd also point out that at a lot of the trace/profile stuff seems like it has
a good framework, but few to no one seem to be hooking it up ...
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sim: add helper macros for branch profiling
2010-04-12 16:02 ` Mike Frysinger
@ 2010-04-12 16:09 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2010-04-12 16:09 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
> > > 2010-04-10 Mike Frysinger <vapier@gentoo.org>
> > >
> > > * sim-profile.h (PROFILE_BRANCH_TAKEN, PROFILE_BRANCH_UNTAKEN): New
> > > defines.
> >
> > Forgive my ignorance, but are these macros going to be automatically
> > used? Or is there another patch in the pipeline that makes use of them?
>
> i'm using them in the Blackfin sim. once i can get the Blackfin FDPIC shared
> lib stuff working with latest GDB again, i'll post that patch series.
OK - after some thoughts, I think it's fine for you to check the code in,
even if it's unused. I usually don't like that, but since you already
posted the patch, hopefully it won't be too long before you start using it.
The risk you're exposing yourself to is that someones figures out that
it's unused, and just removes it. But I think it's very remote, at least
in the simulator code.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-12 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-10 18:58 [PATCH] sim: add helper macros for branch profiling Mike Frysinger
2010-04-12 14:54 ` Joel Brobecker
2010-04-12 16:02 ` Mike Frysinger
2010-04-12 16:09 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox