From: Nicholas Nethercote Date: Wed, 1 Jun 2005 03:09:59 +0000 (+0000) Subject: Modularised the profiling stuff as m_profile.c. It's much more X-Git-Tag: svn/VALGRIND_3_0_0~485 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5bdf595e70a23dd0f73d61b377dffbee3a08ae79;p=thirdparty%2Fvalgrind.git Modularised the profiling stuff as m_profile.c. It's much more sensible now -- no vg_dummy_profile.c, no silly #including of vg_profile.c from tools. Unfortunately, it still doesn't work, due to bad interactions with signal handling that I don't understand. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3833 --- diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c index 026fce2758..d36684d45d 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -32,7 +32,6 @@ #include "mac_shared.h" #include "memcheck.h" -//#include "vg_profile.c" /*------------------------------------------------------------*/ diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c index 0dfb7bda1b..ab14f8de13 100644 --- a/cachegrind/cg_main.c +++ b/cachegrind/cg_main.c @@ -34,6 +34,7 @@ #include "pub_tool_hashtable.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" +#include "pub_tool_profile.h" #include "pub_tool_tooliface.h" #include "cg_arch.h" diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 48cc80b3b6..4509a8dffc 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -49,6 +49,7 @@ noinst_HEADERS = \ pub_core_main.h \ pub_core_mallocfree.h \ pub_core_options.h \ + pub_core_profile.h \ pub_core_redir.h \ pub_core_replacemalloc.h\ pub_core_scheduler.h \ @@ -89,6 +90,7 @@ stage2_SOURCES = \ m_main.c \ m_mallocfree.c \ m_options.c \ + m_profile.c \ m_redir.c \ m_signals.c \ m_skiplist.c \ @@ -100,7 +102,6 @@ stage2_SOURCES = \ ume.c \ vg_messages.c \ vg_mylibc.c \ - vg_dummy_profile.c \ vg_threadmodel.c \ vg_pthreadmodel.c diff --git a/coregrind/core.h b/coregrind/core.h index 0129cc5554..e421c9eb60 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -87,19 +87,6 @@ extern Int VG_(fd_soft_limit); extern Int VG_(fd_hard_limit); -/* --------------------------------------------------------------------- - Profiling stuff - ------------------------------------------------------------------ */ - -extern void VG_(init_profiling) ( void ); -extern void VG_(done_profiling) ( void ); - -#undef VGP_PUSHCC -#undef VGP_POPCC -#define VGP_PUSHCC(x) if (VG_(clo_profile)) VG_(pushcc)(x) -#define VGP_POPCC(x) if (VG_(clo_profile)) VG_(popcc)(x) - - /* --------------------------------------------------------------------- Exports of vg_intercept.c ------------------------------------------------------------------ */ diff --git a/coregrind/m_debuginfo/symtab.c b/coregrind/m_debuginfo/symtab.c index d09806fa5f..5ed4141552 100644 --- a/coregrind/m_debuginfo/symtab.c +++ b/coregrind/m_debuginfo/symtab.c @@ -33,6 +33,7 @@ #include "pub_core_aspacemgr.h" #include "pub_core_demangle.h" #include "pub_core_options.h" +#include "pub_core_profile.h" #include "pub_core_redir.h" #include "pub_core_tooliface.h" #include "priv_symtab.h" diff --git a/coregrind/m_demangle/demangle.c b/coregrind/m_demangle/demangle.c index 55bb403a5b..6a88e66fca 100644 --- a/coregrind/m_demangle/demangle.c +++ b/coregrind/m_demangle/demangle.c @@ -31,6 +31,7 @@ #include "core.h" #include "pub_core_demangle.h" #include "pub_core_options.h" +#include "pub_core_profile.h" #include "demangle.h" void VG_(demangle) ( Char* orig, Char* result, Int result_size ) diff --git a/coregrind/m_execontext.c b/coregrind/m_execontext.c index b27ec7db3a..d8a47af418 100644 --- a/coregrind/m_execontext.c +++ b/coregrind/m_execontext.c @@ -31,6 +31,7 @@ #include "core.h" #include "pub_core_execontext.h" #include "pub_core_options.h" +#include "pub_core_profile.h" /*------------------------------------------------------------*/ /*--- Low-level ExeContext storage. ---*/ diff --git a/coregrind/m_main.c b/coregrind/m_main.c index dac1c15f5e..fc973034c4 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -38,6 +38,7 @@ #include "pub_core_execontext.h" #include "pub_core_main.h" #include "pub_core_options.h" +#include "pub_core_profile.h" #include "pub_core_redir.h" #include "pub_core_signals.h" #include "pub_core_syscalls.h" diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 87d21f4e84..af81cd73a7 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -33,6 +33,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_options.h" +#include "pub_core_profile.h" #include "valgrind.h" //zz#include "memcheck/memcheck.h" diff --git a/include/vg_profile.c b/coregrind/m_profile.c similarity index 84% rename from include/vg_profile.c rename to coregrind/m_profile.c index 306c10e6e9..630fa9d29d 100644 --- a/include/vg_profile.c +++ b/coregrind/m_profile.c @@ -1,9 +1,6 @@ /*--------------------------------------------------------------------*/ -/*--- Profiling machinery. #include this file into a tool to ---*/ -/*--- enable --profile=yes, but not for release versions of tools, ---*/ -/*--- because it uses glibc code. ---*/ -/*--- vg_profile.c ---*/ +/*--- Profiling machinery. m_profile.c ---*/ /*--------------------------------------------------------------------*/ /* @@ -31,25 +28,17 @@ The GNU General Public License is contained in the file COPYING. */ -#ifndef __VG_PROFILE_C -#define __VG_PROFILE_C - -#include "tool.h" +#include "core.h" +#include "pub_core_profile.h" /* get rid of these, if possible */ #include #include -/* Override the empty definitions from tool.h */ -#undef VGP_PUSHCC -#undef VGP_POPCC -#define VGP_PUSHCC(x) if (VG_(clo_profile)) VG_(pushcc)(x) -#define VGP_POPCC(x) if (VG_(clo_profile)) VG_(popcc)(x) #define VGP_M_STACK 20 #define VGP_MAX_CCS 50 - /* All zeroed initially because they're static */ static Int vgp_nticks; @@ -84,7 +73,7 @@ void VG_(register_profile_event) ( Int n, Char* name ) vgp_names[n] = name; } -void VG_(tick) ( int sigNo ) +static void tick ( int sigNo ) { Int cc; vgp_nticks++; @@ -98,6 +87,12 @@ void VG_(init_profiling) ( void ) struct itimerval value; Int ret; +#ifndef VG_DO_PROFILING + VG_(printf)("valgrind: you must compile with VG_DO_PROFILING defined\n"); + VG_(printf)(" before using --profile=yes. Aborting.\n"); + VG_(exit)(1); +#endif + /* Register core events... tricky macro definition causes VG_(register_profile_event)() to be called once for each core event in VGP_CORE_LIST. */ @@ -113,9 +108,9 @@ void VG_(init_profiling) ( void ) value.it_interval.tv_usec = 10 * 1000; value.it_value = value.it_interval; - signal(SIGPROF, VG_(tick) ); + signal(SIGPROF, tick ); ret = setitimer(ITIMER_PROF, &value, NULL); - if (ret != 0) VG_(tool_panic)("vgp_init_profiling"); + if (ret != 0) VG_(core_panic)("vgp_init_profiling"); } void VG_(done_profiling) ( void ) @@ -141,7 +136,7 @@ void VG_(pushcc) ( UInt cc ) "Or if you are nesting profiling events very deeply, increase\n" "VGP_M_STACK and recompile Valgrind.\n", VGP_M_STACK, cc, vgp_names[cc]); - VG_(tool_panic)("Profiling stack overflow"); + VG_(core_panic)("Profiling stack overflow"); } vgp_sp++; vgp_stack[vgp_sp] = cc; @@ -154,10 +149,11 @@ void VG_(popcc) ( UInt cc ) VG_(printf)( "\nProfile stack underflow. This is due to a VG_(popcc)() without\n" "a matching VG_(pushcc)(). Make sure they all match.\n"); - VG_(tool_panic)("Profiling stack underflow"); + VG_(core_panic)("Profiling stack underflow"); } if (vgp_stack[vgp_sp] != cc) { Int i; + VG_(printf)("profiling problem:\n"); VG_(printf)("popping %s, stack looks like:\n", vgp_names[cc]); for (i = vgp_sp; i >= 0; i--) VG_(printf)("%2d: %s\n", i, vgp_names[vgp_stack[i]]); @@ -166,8 +162,8 @@ void VG_(popcc) ( UInt cc ) vgp_sp--; } -#endif /* __VG_PROFILE_C */ - /*--------------------------------------------------------------------*/ -/*--- end vg_profile.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ + + diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index 05978a283d..f907c74667 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -65,6 +65,7 @@ #include "pub_core_errormgr.h" #include "pub_core_main.h" #include "pub_core_options.h" +#include "pub_core_profile.h" #include "pub_core_replacemalloc.h" #include "pub_core_scheduler.h" #include "pub_core_signals.h" diff --git a/coregrind/m_stacktrace.c b/coregrind/m_stacktrace.c index 82f69d8be8..365b915941 100644 --- a/coregrind/m_stacktrace.c +++ b/coregrind/m_stacktrace.c @@ -31,6 +31,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_options.h" +#include "pub_core_profile.h" #include "pub_core_stacktrace.h" /*------------------------------------------------------------*/ diff --git a/coregrind/m_syscalls/syscalls.c b/coregrind/m_syscalls/syscalls.c index b8657a27af..776f9eb20d 100644 --- a/coregrind/m_syscalls/syscalls.c +++ b/coregrind/m_syscalls/syscalls.c @@ -32,6 +32,7 @@ #include "pub_core_debuglog.h" #include "pub_core_aspacemgr.h" #include "pub_core_main.h" +#include "pub_core_profile.h" #include "pub_core_stacktrace.h" #include "pub_core_syscalls.h" #include "pub_core_tooliface.h" @@ -6071,7 +6072,7 @@ void VG_(client_syscall) ( ThreadId tid ) Bool runInLWP = False; Bool syscall_done = False; /* we actually ran the syscall */ - VGP_PUSHCC(VgpCoreSysWrap); +// VGP_PUSHCC(VgpCoreSysWrap); tst = VG_(get_ThreadState)(tid); @@ -6198,7 +6199,7 @@ void VG_(client_syscall) ( ThreadId tid ) /* VG_(post_syscall) should set this */ vg_assert(tst->syscallno == -1); - VGP_POPCC(VgpCoreSysWrap); +// VGP_POPCC(VgpCoreSysWrap); } /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c index 74c3207284..bef168ac09 100644 --- a/coregrind/m_translate.c +++ b/coregrind/m_translate.c @@ -33,6 +33,7 @@ #include "pub_core_aspacemgr.h" #include "pub_core_main.h" // for VG_(bbs_done) #include "pub_core_options.h" +#include "pub_core_profile.h" #include "pub_core_redir.h" #include "pub_core_signals.h" #include "pub_core_tooliface.h" @@ -468,6 +469,8 @@ Bool VG_(translate) ( ThreadId tid, verbosity = VG_(clo_trace_flags); } + VGP_PUSHCC(VgpVexTime); + /* Actually do the translation. */ tl_assert2(VG_(tdict).tool_instrument, "you forgot to set VgToolInterface function 'tool_instrument'"); @@ -492,6 +495,8 @@ Bool VG_(translate) ( ThreadId tid, vg_assert(tmpbuf_used <= N_TMPBUF); vg_assert(tmpbuf_used > 0); + VGP_POPCC(VgpVexTime); + #undef DECIDE_IF_PRINTING_CODEGEN /* Copy data at trans_addr into the translation cache. */ diff --git a/coregrind/vg_dummy_profile.c b/coregrind/pub_core_profile.h similarity index 55% rename from coregrind/vg_dummy_profile.c rename to coregrind/pub_core_profile.h index 6bc2ea2de1..c87f8ab177 100644 --- a/coregrind/vg_dummy_profile.c +++ b/coregrind/pub_core_profile.h @@ -1,15 +1,13 @@ /*--------------------------------------------------------------------*/ -/*--- Dummy profiling machinery -- overridden by tools when they ---*/ -/*--- want profiling. ---*/ -/*--- vg_dummy_profile.c ---*/ +/*--- The built-in profiler. pub_core_profile.h ---*/ /*--------------------------------------------------------------------*/ /* This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2005 Julian Seward + Copyright (C) 2000-2005 Julian Seward jseward@acm.org This program is free software; you can redistribute it and/or @@ -30,42 +28,23 @@ The GNU General Public License is contained in the file COPYING. */ -#include "core.h" +#ifndef __PUB_CORE_PROFILE_H +#define __PUB_CORE_PROFILE_H -static void vgp_die(void) -{ - VG_(printf)( - "\nProfiling error:\n" - " The --profile=yes option was specified, but the tool\n" - " wasn't built for profiling. #include \"vg_profile.c\"\n" - " into the tool and rebuild to allow profiling.\n\n"); - VG_(exit)(1); -} +//-------------------------------------------------------------------- +// PURPOSE: This module implements Valgrind's internal tick-and-stack-based +// profiler. To use it, define VG_DO_PROFILING and use --profile=yes. +// Unfortunately, it's currently broken (and has been for some time) +// because it doesn't interact well with signal handling. +//-------------------------------------------------------------------- -void VG_(register_profile_event) ( Int n, Char* name ) -{ -} +#include "pub_tool_profile.h" -void VG_(init_profiling) ( void ) -{ - vgp_die(); -} +extern void VG_(init_profiling) ( void ); +extern void VG_(done_profiling) ( void ); -void VG_(done_profiling) ( void ) -{ - VG_(core_panic)("done_profiling(), but not compiled for profiling??"); -} - -void VG_(pushcc) ( UInt cc ) -{ - vgp_die(); -} - -void VG_(popcc) ( UInt cc ) -{ - vgp_die(); -} +#endif // __PUB_CORE_PROFILE_H /*--------------------------------------------------------------------*/ -/*--- end vg_dummy_profile.c ---*/ +/*--- end ---*/ /*--------------------------------------------------------------------*/ diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 660df20801..c7c43a8a4b 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -34,6 +34,7 @@ #include "pub_tool_hashtable.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" +#include "pub_tool_profile.h" #include "pub_tool_replacemalloc.h" #include "pub_tool_tooliface.h" @@ -1613,7 +1614,7 @@ void set_address_range_state ( Addr a, SizeT len /* in bytes */, "Warning: set address range state: large range %d", len); - VGP_PUSHCC(VgpSARP); + //VGP_PUSHCC(VgpSARP); /* Remove mutexes in recycled memory range from hash */ find_mutex_range(a, a+len, cleanmx); @@ -1661,7 +1662,7 @@ void set_address_range_state ( Addr a, SizeT len /* in bytes */, VG_(tool_panic)("Unexpected Vge_InitStatus"); } - VGP_POPCC(VgpSARP); + //VGP_POPCC(VgpSARP); } diff --git a/include/Makefile.am b/include/Makefile.am index d35e71b46d..b2fa034706 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,4 @@ -EXTRA_DIST = \ - vg_profile.c - incincdir = $(includedir)/valgrind incinc_HEADERS = \ @@ -13,6 +10,7 @@ incinc_HEADERS = \ pub_tool_hashtable.h \ pub_tool_mallocfree.h \ pub_tool_options.h \ + pub_tool_profile.h \ pub_tool_replacemalloc.h \ pub_tool_skiplist.h \ pub_tool_stacktrace.h \ diff --git a/include/pub_tool_profile.h b/include/pub_tool_profile.h new file mode 100644 index 0000000000..df9df66f8f --- /dev/null +++ b/include/pub_tool_profile.h @@ -0,0 +1,92 @@ + +/*--------------------------------------------------------------------*/ +/*--- The built-in profiler. pub_tool_profile.h ---*/ +/*--------------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2000-2005 Julian Seward + jseward@acm.org + + 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 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. + + The GNU General Public License is contained in the file COPYING. +*/ + +#ifndef __PUB_TOOL_PROFILE_H +#define __PUB_TOOL_PROFILE_H + +// Define this to turn on profiling. +//#define VG_DO_PROFILING 1 + +/* Override the empty definitions from tool.h */ +#ifdef VG_DO_PROFILING +# define VGP_PUSHCC(x) if (VG_(clo_profile)) VG_(pushcc)(x) +# define VGP_POPCC(x) if (VG_(clo_profile)) VG_(popcc)(x) +#else +# define VGP_PUSHCC(x) +# define VGP_POPCC(x) +#endif + +/* Nb: VG_(register_profile_event)() relies on VgpUnc being the first one */ +#define VGP_CORE_LIST \ + /* These ones depend on the core */ \ + VGP_PAIR(VgpUnc, "unclassified"), \ + VGP_PAIR(VgpStartup, "startup"), \ + VGP_PAIR(VgpRun, "running"), \ + VGP_PAIR(VgpSched, "scheduler"), \ + VGP_PAIR(VgpMalloc, "low-lev malloc/free"), \ + VGP_PAIR(VgpCliMalloc, "client malloc/free"), \ + VGP_PAIR(VgpTranslate, "translate-main"), \ + VGP_PAIR(VgpVexTime, "Vex-time"), \ + VGP_PAIR(VgpImprove, "improve"), \ + VGP_PAIR(VgpESPUpdate, "ESP-update"), \ + VGP_PAIR(VgpSlowFindT, "slow-search-transtab"), \ + VGP_PAIR(VgpExeContext, "exe-context"), \ + VGP_PAIR(VgpReadSyms, "read-syms"), \ + VGP_PAIR(VgpSearchSyms, "search-syms"), \ + VGP_PAIR(VgpAddToT, "add-to-transtab"), \ + VGP_PAIR(VgpCoreSysWrap, "core-syscall-wrapper"), \ + VGP_PAIR(VgpDemangle, "demangle"), \ + VGP_PAIR(VgpCoreCheapSanity, "core-cheap-sanity"), \ + VGP_PAIR(VgpCoreExpensiveSanity, "core-expensive-sanity"), \ + /* These ones depend on the tool */ \ + VGP_PAIR(VgpPreCloInit, "pre-clo-init"), \ + VGP_PAIR(VgpPostCloInit, "post-clo-init"), \ + VGP_PAIR(VgpInstrument, "instrument"), \ + VGP_PAIR(VgpToolSysWrap, "tool-syscall-wrapper"), \ + VGP_PAIR(VgpToolCheapSanity, "tool-cheap-sanity"), \ + VGP_PAIR(VgpToolExpensiveSanity, "tool-expensive-sanity"), \ + VGP_PAIR(VgpFini, "fini") + +#define VGP_PAIR(n,name) n +typedef enum { VGP_CORE_LIST } VgpCoreCC; +#undef VGP_PAIR + +/* When registering tool profiling events, ensure that the 'n' value is in + * the range (VgpFini+1..) */ +extern void VG_(register_profile_event) ( Int n, Char* name ); + +extern void VG_(pushcc) ( UInt cc ); +extern void VG_(popcc) ( UInt cc ); + +#endif // __PUB_TOOL_PROFILE_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ diff --git a/include/tool.h b/include/tool.h index 6f7e91fa1e..de3eb18e23 100644 --- a/include/tool.h +++ b/include/tool.h @@ -96,65 +96,6 @@ extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... ); extern UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs ); -/*====================================================================*/ -/*=== Profiling ===*/ -/*====================================================================*/ - -/* Nb: VG_(register_profile_event)() relies on VgpUnc being the first one */ -#define VGP_CORE_LIST \ - /* These ones depend on the core */ \ - VGP_PAIR(VgpUnc, "unclassified"), \ - VGP_PAIR(VgpStartup, "startup"), \ - VGP_PAIR(VgpRun, "running"), \ - VGP_PAIR(VgpSched, "scheduler"), \ - VGP_PAIR(VgpMalloc, "low-lev malloc/free"), \ - VGP_PAIR(VgpCliMalloc, "client malloc/free"), \ - VGP_PAIR(VgpTranslate, "translate-main"), \ - VGP_PAIR(VgpToUCode, "to-ucode"), \ - VGP_PAIR(VgpFromUcode, "from-ucode"), \ - VGP_PAIR(VgpImprove, "improve"), \ - VGP_PAIR(VgpESPUpdate, "ESP-update"), \ - VGP_PAIR(VgpRegAlloc, "reg-alloc"), \ - VGP_PAIR(VgpLiveness, "liveness-analysis"), \ - VGP_PAIR(VgpDoLRU, "do-lru"), \ - VGP_PAIR(VgpSlowFindT, "slow-search-transtab"), \ - VGP_PAIR(VgpExeContext, "exe-context"), \ - VGP_PAIR(VgpReadSyms, "read-syms"), \ - VGP_PAIR(VgpSearchSyms, "search-syms"), \ - VGP_PAIR(VgpAddToT, "add-to-transtab"), \ - VGP_PAIR(VgpCoreSysWrap, "core-syscall-wrapper"), \ - VGP_PAIR(VgpDemangle, "demangle"), \ - VGP_PAIR(VgpCoreCheapSanity, "core-cheap-sanity"), \ - VGP_PAIR(VgpCoreExpensiveSanity, "core-expensive-sanity"), \ - /* These ones depend on the tool */ \ - VGP_PAIR(VgpPreCloInit, "pre-clo-init"), \ - VGP_PAIR(VgpPostCloInit, "post-clo-init"), \ - VGP_PAIR(VgpInstrument, "instrument"), \ - VGP_PAIR(VgpToolSysWrap, "tool-syscall-wrapper"), \ - VGP_PAIR(VgpToolCheapSanity, "tool-cheap-sanity"), \ - VGP_PAIR(VgpToolExpensiveSanity, "tool-expensive-sanity"), \ - VGP_PAIR(VgpFini, "fini") - -#define VGP_PAIR(n,name) n -typedef enum { VGP_CORE_LIST } VgpCoreCC; -#undef VGP_PAIR - -/* When registering tool profiling events, ensure that the 'n' value is in - * the range (VgpFini+1..) */ -extern void VG_(register_profile_event) ( Int n, Char* name ); - -extern void VG_(pushcc) ( UInt cc ); -extern void VG_(popcc) ( UInt cc ); - -/* Define them only if they haven't already been defined by vg_profile.c */ -#ifndef VGP_PUSHCC -# define VGP_PUSHCC(x) -#endif -#ifndef VGP_POPCC -# define VGP_POPCC(x) -#endif - - /*====================================================================*/ /*=== Useful stuff to call from generated code ===*/ /*====================================================================*/ diff --git a/massif/ms_main.c b/massif/ms_main.c index c427bc78e8..7da42499d8 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -39,6 +39,7 @@ #include "pub_tool_hashtable.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" +#include "pub_tool_profile.h" #include "pub_tool_replacemalloc.h" #include "pub_tool_stacktrace.h" #include "pub_tool_tooliface.h" diff --git a/memcheck/mac_shared.h b/memcheck/mac_shared.h index 3048032214..d76a7a0a92 100644 --- a/memcheck/mac_shared.h +++ b/memcheck/mac_shared.h @@ -40,6 +40,7 @@ #include "pub_tool_hashtable.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" +#include "pub_tool_profile.h" #include "pub_tool_replacemalloc.h" #include "pub_tool_tooliface.h"