X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=sim%2Fcommon%2Fsim-profile.h;h=938ad7140fcffdbe3148758083360cff83a93331;hb=51a0e41ca956e6bdf072aea6a7e15c4e7269c2d0;hp=4ffe85037661646765f079b7f265a995f9cf444b;hpb=d0352a18a504a4e7b761f6b3264cf11347d8d056;p=platform%2Fupstream%2Fbinutils.git diff --git a/sim/common/sim-profile.h b/sim/common/sim-profile.h index 4ffe850..938ad71 100644 --- a/sim/common/sim-profile.h +++ b/sim/common/sim-profile.h @@ -1,22 +1,21 @@ /* Profile header for simulators using common framework. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996-2014 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GDB, the GNU debugger. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +You should have received a copy of the GNU General Public License +along with this program. If not, see . */ #ifndef SIM_PROFILE_H #define SIM_PROFILE_H @@ -96,7 +95,7 @@ SIM_RC sim_profile_set_option (SIM_DESC sd_, const char *name_, int idx_, #define WITH_PROFILE_CORE_P (WITH_PROFILE & PROFILE_core) /* If MAX_TARGET_MODES isn't defined, we can't do memory profiling. - ??? It is intended that this is a temporary occurence. Normally + ??? It is intended that this is a temporary occurrence. Normally MAX_TARGET_MODES is defined. */ #ifndef MAX_TARGET_MODES #undef WITH_PROFILE_MEMORY_P @@ -150,6 +149,10 @@ typedef struct { unsigned long total_insn_count; #define PROFILE_TOTAL_INSN_COUNT(p) ((p)->total_insn_count) + /* CPU frequency. Always accepted, regardless of profiling options. */ + unsigned long cpu_freq; +#define PROFILE_CPU_FREQ(p) ((p)->cpu_freq) + #if WITH_PROFILE_INSN_P unsigned int *insn_count; #define PROFILE_INSN_COUNT(p) ((p)->insn_count) @@ -286,8 +289,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 */