aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sim/common/ChangeLog6
-rw-r--r--sim/common/sim-profile.c31
2 files changed, 34 insertions, 3 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 2a5e8f6..6a5f5f8 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,9 @@
+Tue Feb 24 22:45:39 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * sim-profile.c (profile_print): Delete duplicate test of
+ PROFILE_INSN_IDX.
+ (profile_print_pc): Exit early if data collection not set up.
+
Mon Feb 23 20:45:57 1998 Mark Alexander <marka@cygnus.com>
* nltvals.def: Regenerate with MN10300 additions.
diff --git a/sim/common/sim-profile.c b/sim/common/sim-profile.c
index d386e4a..ff882df 100644
--- a/sim/common/sim-profile.c
+++ b/sim/common/sim-profile.c
@@ -1,5 +1,5 @@
/* Default profiling support.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB, the GNU debugger.
@@ -425,6 +425,9 @@ profile_print_pc (sim_cpu *cpu, int verbose)
unsigned total;
unsigned i;
+ if (PROFILE_PC_COUNT (profile) == 0)
+ return;
+
sim_io_printf (sd, "Program Counter Statistics:\n\n");
/* First pass over data computes various things. */
@@ -869,8 +872,30 @@ profile_print (SIM_DESC sd, int verbose,
sim_cpu *cpu = STATE_CPU (sd, c);
PROFILE_DATA *data = CPU_PROFILE_DATA (cpu);
- if (MAX_NR_PROCESSORS > 1)
- sim_io_printf (sd, "CPU %d\n\n", c);
+ if (MAX_NR_PROCESSORS > 1
+ && (0
+#if WITH_PROFILE_INSN_P
+ || PROFILE_FLAGS (data) [PROFILE_INSN_IDX]
+#endif
+#if WITH_PROFILE_MEMORY_P
+ || PROFILE_FLAGS (data) [PROFILE_MEMORY_IDX]
+#endif
+#if WITH_PROFILE_CORE_P
+ || PROFILE_FLAGS (data) [PROFILE_CORE_IDX]
+#endif
+#if WITH_PROFILE_MODEL_P
+ || PROFILE_FLAGS (data) [PROFILE_MODEL_IDX]
+#endif
+#if WITH_PROFILE_SCACHE_P && WITH_SCACHE
+ || PROFILE_FLAGS (data) [PROFILE_SCACHE_IDX]
+#endif
+#if WITH_PROFILE_PC_P
+ || PROFILE_FLAGS (data) [PROFILE_PC_IDX]
+#endif
+ ))
+ {
+ sim_io_printf (sd, "CPU %d\n\n", c);
+ }
#if WITH_PROFILE_INSN_P
if (PROFILE_FLAGS (data) [PROFILE_INSN_IDX])