sim: use libiberty countargv in more places
[deliverable/binutils-gdb.git] / sim / common / sim-profile.h
index 411214fe6cfc2cdb7abea94edd4ad606d207efaa..04fecd4e4d035ca66ce7fa09f95aeb1127088f82 100644 (file)
@@ -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 */
This page took 0.026376 seconds and 4 git commands to generate.