X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fcommon%2Fsim-profile.h;h=04fecd4e4d035ca66ce7fa09f95aeb1127088f82;hb=34fed69938f1296b62354b2a825b49602fe7af50;hp=411214fe6cfc2cdb7abea94edd4ad606d207efaa;hpb=9b254dd1ce46c19dde1dde5b8d1e22e862dfacce;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/common/sim-profile.h b/sim/common/sim-profile.h index 411214fe6c..04fecd4e4d 100644 --- a/sim/common/sim-profile.h +++ b/sim/common/sim-profile.h @@ -1,5 +1,5 @@ /* Profile header for simulators using common framework. - Copyright (C) 1996, 1997, 1998, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 1996-2016 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GDB, the GNU debugger. @@ -102,12 +102,6 @@ SIM_RC sim_profile_set_option (SIM_DESC sd_, const char *name_, int idx_, #define WITH_PROFILE_MEMORY_P 0 #endif -/* Only build MODEL code when the target simulator has support for it */ -#ifndef SIM_HAVE_MODEL -#undef WITH_PROFILE_MODEL_P -#define WITH_PROFILE_MODEL_P 0 -#endif - /* Profiling install handler. */ MODULE_INSTALL_FN profile_install; @@ -289,8 +283,24 @@ 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); +extern void sim_profile_print_bar (SIM_DESC, sim_cpu *, unsigned int, unsigned int, unsigned int); #endif /* SIM_PROFILE_H */