diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-04-12 16:57:24 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-04-12 16:57:24 +0000 |
commit | d691350337a747dc827c09a265859df1ac86e79b (patch) | |
tree | a2b1199fc312366c2c590792ef20469ad0c18f43 /sim/common/sim-profile.h | |
parent | 7bbdc114c3787e8be817374c9ca3fff4e6944413 (diff) | |
download | gdb-d691350337a747dc827c09a265859df1ac86e79b.tar.gz |
sim: add helper macros for branch profiling
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>
Diffstat (limited to 'sim/common/sim-profile.h')
-rw-r--r-- | 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 315a79f140a..c35fe0c4f3c 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); |