From: Doug Evans Date: Wed, 25 Feb 1998 07:16:09 +0000 (+0000) Subject: * sim-profile.c (profile_print): Delete duplicate test of X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3910fb4a5148aeba066d32985be4c72c23635c7e;p=binutils-gdb.git * sim-profile.c (profile_print): Delete duplicate test of PROFILE_INSN_IDX. (profile_print_pc): Exit early if data collection not set up. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 2a5e8f6d20b..6a5f5f876c8 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 24 22:45:39 1998 Doug Evans + + * 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 * nltvals.def: Regenerate with MN10300 additions. diff --git a/sim/common/sim-profile.c b/sim/common/sim-profile.c index d386e4a2924..ff882dfb3ca 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])