]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Modularised the profiling stuff as m_profile.c. It's much more
authorNicholas Nethercote <njn@valgrind.org>
Wed, 1 Jun 2005 03:09:59 +0000 (03:09 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 1 Jun 2005 03:09:59 +0000 (03:09 +0000)
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

21 files changed:
addrcheck/ac_main.c
cachegrind/cg_main.c
coregrind/Makefile.am
coregrind/core.h
coregrind/m_debuginfo/symtab.c
coregrind/m_demangle/demangle.c
coregrind/m_execontext.c
coregrind/m_main.c
coregrind/m_mallocfree.c
coregrind/m_profile.c [moved from include/vg_profile.c with 84% similarity]
coregrind/m_scheduler/scheduler.c
coregrind/m_stacktrace.c
coregrind/m_syscalls/syscalls.c
coregrind/m_translate.c
coregrind/pub_core_profile.h [moved from coregrind/vg_dummy_profile.c with 55% similarity]
helgrind/hg_main.c
include/Makefile.am
include/pub_tool_profile.h [new file with mode: 0644]
include/tool.h
massif/ms_main.c
memcheck/mac_shared.h

index 026fce2758aa6712bd6455eed5b1649b9cf7c377..d36684d45d8ed65a74a8942ad8ab913c033ebd71 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "mac_shared.h"
 #include "memcheck.h"
-//#include "vg_profile.c"
 
 
 /*------------------------------------------------------------*/
index 0dfb7bda1ba956b56605eb344acd8e4053ae13bd..ab14f8de134328e45123555d1430cbddcb9039d8 100644 (file)
@@ -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"
index 48cc80b3b6d76e7f787360bfa788340f34096008..4509a8dffccbf726cee861f6c5b55a2aa13e8fd5 100644 (file)
@@ -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
 
index 0129cc5554679b3b97ae871eda2a5ee82fa25743..e421c9eb60ac5069de0a3f4d5fee57c0c57a0d68 100644 (file)
 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
    ------------------------------------------------------------------ */
index d09806fa5f550762590af0d5a8338f4df1281f53..5ed4141552c6ae67b4e04bf30e3f4237923d6f4f 100644 (file)
@@ -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"
index 55bb403a5bfa5de3413044c95ccba34872bc62c8..6a88e66fca53155686106ee48aff9d1f85a64e0b 100644 (file)
@@ -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 )
index b27ec7db3a187066476fa38024758a5d6950880f..d8a47af418e27795c2b24ed4a96b4a81db1a10ff 100644 (file)
@@ -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.                        ---*/
index dac1c15f5e7edf9ac77d581ca2353cc3cfb4dcc5..fc973034c41ed69d06490481989badbc4b407698 100644 (file)
@@ -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"
index 87d21f4e84931dec48e48ebe1ee0ee705a35504c..af81cd73a7b29e744a30b24127cdf7184a604226 100644 (file)
@@ -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"
similarity index 84%
rename from include/vg_profile.c
rename to coregrind/m_profile.c
index 306c10e6e92bed8cb13e11450ecd5237c1c8c496..630fa9d29d2a47d13c0f73f7a941bc4064ba1cfe 100644 (file)
@@ -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 ---*/
 /*--------------------------------------------------------------------*/
 
 /*
    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 <signal.h>
 #include <sys/time.h>
 
-/* 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                                                          ---*/
 /*--------------------------------------------------------------------*/
+
+
index 05978a283d8bc02b17f3c03bf8f35672c04456a5..f907c746675270aff1cfe1dacbbd3f4c674df747 100644 (file)
@@ -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"
index 82f69d8be8a0f1f230fb017b3ad16c53cc4b3a4d..365b9159419e421074e31f5b2c4752cf1b5c0e17 100644 (file)
@@ -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"
 
 /*------------------------------------------------------------*/
index b8657a27af7548b97ec1d548bfd3c757f99eeb73..776f9eb20dc87b4fb439028654e357aa077ad0f4 100644 (file)
@@ -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);
 }
 
 /*--------------------------------------------------------------------*/
index 74c3207284e5cb074b2af70f4254ec6bcafcba10..bef168ac090a32bcb597ed5d162bcdf7685171c7 100644 (file)
@@ -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. */
similarity index 55%
rename from coregrind/vg_dummy_profile.c
rename to coregrind/pub_core_profile.h
index 6bc2ea2de1ee025caee2d1ff59618fdc1f679e9c..c87f8ab177c84fdb94746ff8ed8592351b0b7280 100644 (file)
@@ -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
    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                                                          ---*/
 /*--------------------------------------------------------------------*/
index 660df2080108fb069807bb24004c12c23cc6442c..c7c43a8a4b7615792e36409564477a1d105ea99f 100644 (file)
@@ -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);
 }
 
 
index d35e71b46d76b912ae8430acd2a775ef34d8abd8..b2fa0347063e399dc3956668b4c0df9d6d6c85ec 100644 (file)
@@ -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 (file)
index 0000000..df9df66
--- /dev/null
@@ -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                                                          ---*/
+/*--------------------------------------------------------------------*/
index 6f7e91fa1e7292d431db3f27d713564c2209de4e..de3eb18e23faf855e57d8439155c6a5d9b1988c9 100644 (file)
@@ -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                     ===*/
 /*====================================================================*/
index c427bc78e8ff489b9d93ca128d1920d26396c5a0..7da42499d8792b5782f6af6eb065ba5b34954f42 100644 (file)
@@ -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"
index 304803221411dc187876c9199a0f5e9cab8f1f73..d76a7a0a92e7a6ca5c8b37cb67d41d913663bd82 100644 (file)
@@ -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"