diff options
author | Doug Evans <dje@google.com> | 1998-02-25 07:16:09 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 1998-02-25 07:16:09 +0000 |
commit | 3910fb4a5148aeba066d32985be4c72c23635c7e (patch) | |
tree | a12b2dd984e7e4964e8a17a491b1d4570aced07d /sim/common/sim-profile.c | |
parent | 39149be2246d4c375faf6c357e370f12cb66016d (diff) | |
download | gdb-3910fb4a5148aeba066d32985be4c72c23635c7e.zip gdb-3910fb4a5148aeba066d32985be4c72c23635c7e.tar.gz gdb-3910fb4a5148aeba066d32985be4c72c23635c7e.tar.bz2 |
* sim-profile.c (profile_print): Delete duplicate test of
PROFILE_INSN_IDX.
(profile_print_pc): Exit early if data collection not set up.
Diffstat (limited to 'sim/common/sim-profile.c')
-rw-r--r-- | sim/common/sim-profile.c | 31 |
1 files changed, 28 insertions, 3 deletions
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]) |