Don't use the VGP_ for profiling any more, just use VG_ -- we want to use
VGP_ for platform-specific things.  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3435 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index bcb937a..7ed3de1 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -1364,9 +1364,9 @@
    VG_(init_pre_mem_write)        ( & ac_check_is_writable );
    VG_(init_post_mem_write)       ( & ac_post_mem_write );
 
-   VGP_(register_profile_event) ( VgpSetMem,   "set-mem-perms" );
-   VGP_(register_profile_event) ( VgpCheckMem, "check-mem-perms" );
-   VGP_(register_profile_event) ( VgpESPAdj,   "adjust-ESP" );
+   VG_(register_profile_event) ( VgpSetMem,   "set-mem-perms" );
+   VG_(register_profile_event) ( VgpCheckMem, "check-mem-perms" );
+   VG_(register_profile_event) ( VgpESPAdj,   "adjust-ESP" );
 
    init_shadow_memory();
    MAC_(common_pre_clo_init)();
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index 159051b..4e625fd 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -1135,9 +1135,9 @@
    cachesim_D1_initcache(D1c);
    cachesim_L2_initcache(L2c);
 
-   VGP_(register_profile_event)(VgpGetLineCC,     "get-lineCC");
-   VGP_(register_profile_event)(VgpCacheSimulate, "cache-simulate");
-   VGP_(register_profile_event)(VgpCacheResults,  "cache-results");
+   VG_(register_profile_event)(VgpGetLineCC,     "get-lineCC");
+   VG_(register_profile_event)(VgpCacheSimulate, "cache-simulate");
+   VG_(register_profile_event)(VgpCacheResults,  "cache-results");
 }
 
 VG_DETERMINE_INTERFACE_VERSION(TL_(pre_clo_init), 0)
diff --git a/coregrind/core.h b/coregrind/core.h
index 37b5a61..1600041 100644
--- a/coregrind/core.h
+++ b/coregrind/core.h
@@ -283,13 +283,13 @@
    Profiling stuff
    ------------------------------------------------------------------ */
 
-extern void VGP_(init_profiling) ( void );
-extern void VGP_(done_profiling) ( void );
+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)) VGP_(pushcc)(x)
-#define VGP_POPCC(x)    if (VG_(clo_profile)) VGP_(popcc)(x)
+#define VGP_PUSHCC(x)   if (VG_(clo_profile)) VG_(pushcc)(x)
+#define VGP_POPCC(x)    if (VG_(clo_profile)) VG_(popcc)(x)
 
 
 /* ---------------------------------------------------------------------
diff --git a/coregrind/vg_dummy_profile.c b/coregrind/vg_dummy_profile.c
index 2125e69..6bc2ea2 100644
--- a/coregrind/vg_dummy_profile.c
+++ b/coregrind/vg_dummy_profile.c
@@ -42,26 +42,26 @@
    VG_(exit)(1);
 }
 
-void VGP_(register_profile_event) ( Int n, Char* name )
+void VG_(register_profile_event) ( Int n, Char* name )
 {
 }
 
-void VGP_(init_profiling) ( void )
+void VG_(init_profiling) ( void )
 {
    vgp_die();
 }
 
-void VGP_(done_profiling) ( void )
+void VG_(done_profiling) ( void )
 {
    VG_(core_panic)("done_profiling(), but not compiled for profiling??");
 }
 
-void VGP_(pushcc) ( UInt cc )
+void VG_(pushcc) ( UInt cc )
 {
    vgp_die();
 }
 
-void VGP_(popcc) ( UInt cc )
+void VG_(popcc) ( UInt cc )
 {
    vgp_die();
 }
diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c
index 59389a5..31c465b 100644
--- a/coregrind/vg_main.c
+++ b/coregrind/vg_main.c
@@ -2738,7 +2738,7 @@
    // in pre_process_cmd_line_options() could get it earlier.
    //--------------------------------------------------------------
    if (VG_(clo_profile))
-      VGP_(init_profiling)();
+      VG_(init_profiling)();
 
    VGP_PUSHCC(VgpStartup);
 
@@ -2836,7 +2836,7 @@
       print_all_stats();
 
    if (VG_(clo_profile))
-      VGP_(done_profiling)();
+      VG_(done_profiling)();
    if (VG_(clo_profile_flags) > 0)
       VG_(show_BB_profile)();
 
diff --git a/docs/xml/writing-tools.xml b/docs/xml/writing-tools.xml
index aaf1d9b..8915a36 100644
--- a/docs/xml/writing-tools.xml
+++ b/docs/xml/writing-tools.xml
@@ -1120,6 +1120,9 @@
 <sect2 id="writing-tools.profiling" xreflabel="Profiling">
 <title>Profiling</title>
 
+<para>Nb: as of 25-Mar-2005, the profiling is broken, and has been
+for a long time...</para>
+
 <para>To do simple tick-based profiling of a tool, include the
 line:</para>
 <programlisting><![CDATA[
@@ -1131,7 +1134,7 @@
 
 <para>The profiler is stack-based; you can register a profiling
 event with
-<computeroutput>VGP_(register_profile_event)()</computeroutput>
+<computeroutput>VG_(register_profile_event)()</computeroutput>
 and then use the <computeroutput>VGP_PUSHCC</computeroutput> and
 <computeroutput>VGP_POPCC</computeroutput> macros to record time
 spent doing certain things.  New profiling event numbers must not
diff --git a/include/tool.h.base b/include/tool.h.base
index 14d9fe6..f4f34c7 100644
--- a/include/tool.h.base
+++ b/include/tool.h.base
@@ -203,7 +203,7 @@
 /*=== Profiling                                                    ===*/
 /*====================================================================*/
 
-/* Nb: VGP_(register_profile_event)() relies on VgpUnc being the first one */
+/* 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"),          \
@@ -244,10 +244,10 @@
 
 /* When registering tool profiling events, ensure that the 'n' value is in
  * the range (VgpFini+1..) */
-extern void VGP_(register_profile_event) ( Int n, Char* name );
+extern void VG_(register_profile_event) ( Int n, Char* name );
 
-extern void VGP_(pushcc) ( UInt cc );
-extern void VGP_(popcc)  ( UInt cc );
+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
diff --git a/include/tool_asm.h b/include/tool_asm.h
index 931abc6..65c2d5e 100644
--- a/include/tool_asm.h
+++ b/include/tool_asm.h
@@ -41,8 +41,9 @@
 /* These macros should add different prefixes so the same base
    name can safely be used across different macros. */
 #define VG_(str)    VGAPPEND(vgPlain_,str)
-#define VGP_(str)   VGAPPEND(vgProf_,str)
 #define VGA_(str)   VGAPPEND(vgArch_,str)
+#define VGO_(str)   VGAPPEND(vgOS,str)
+#define VGP_(str)   VGAPPEND(vgPlatform,str)
 
 /* Tool-specific ones.  Note that final name still starts with "vg". */
 #define TL_(str)    VGAPPEND(vgTool_,str)
diff --git a/include/vg_profile.c b/include/vg_profile.c
index 6ee6f68..88030db 100644
--- a/include/vg_profile.c
+++ b/include/vg_profile.c
@@ -43,8 +43,8 @@
 /* Override the empty definitions from tool.h */
 #undef  VGP_PUSHCC
 #undef  VGP_POPCC
-#define VGP_PUSHCC(x)   if (VG_(clo_profile)) VGP_(pushcc)(x)
-#define VGP_POPCC(x)    if (VG_(clo_profile)) VGP_(popcc)(x)
+#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
@@ -62,7 +62,7 @@
 
 /* These definitions override the panicking ones in vg_profile.c */
 
-void VGP_(register_profile_event) ( Int n, Char* name )
+void VG_(register_profile_event) ( Int n, Char* name )
 {
    /* Adjust for negative values */
    n += VgpUnc;
@@ -84,7 +84,7 @@
    vgp_names[n] = name;
 }
 
-void VGP_(tick) ( int sigNo )
+void VG_(tick) ( int sigNo )
 {
    Int cc;
    vgp_nticks++;
@@ -93,32 +93,32 @@
    vgp_counts[ cc ]++;
 }
 
-void VGP_(init_profiling) ( void )
+void VG_(init_profiling) ( void )
 {
    struct itimerval value;
    Int ret;
 
    /* Register core events... tricky macro definition causes
-      VGP_(register_profile_event)() to be called once for each core event
+      VG_(register_profile_event)() to be called once for each core event
       in VGP_CORE_LIST. */
    tl_assert(VgpUnc == 0);
-#  define VGP_PAIR(n,name) VGP_(register_profile_event)(n,name)
+#  define VGP_PAIR(n,name) VG_(register_profile_event)(n,name)
    VGP_CORE_LIST;
 #  undef  VGP_PAIR
 
    vgp_sp = -1;
-   VGP_(pushcc) ( VgpUnc );
+   VG_(pushcc) ( VgpUnc );
 
    value.it_interval.tv_sec  = 0;
    value.it_interval.tv_usec = 10 * 1000;
    value.it_value = value.it_interval;
 
-   signal(SIGPROF, VGP_(tick) );
+   signal(SIGPROF, VG_(tick) );
    ret = setitimer(ITIMER_PROF, &value, NULL);
    if (ret != 0) VG_(tool_panic)("vgp_init_profiling");
 }
 
-void VGP_(done_profiling) ( void )
+void VG_(done_profiling) ( void )
 {
    Int i;
    VG_(printf)("\nProfiling done, %d ticks\n", vgp_nticks);
@@ -131,13 +131,13 @@
             vgp_entries[i], vgp_names[i] );
 }
 
-void VGP_(pushcc) ( UInt cc )
+void VG_(pushcc) ( UInt cc )
 {
    if (vgp_sp >= VGP_M_STACK-1) { 
       VG_(printf)(
          "\nMaximum profile stack depth (%d) reached for event #%d (`%s').\n"
-         "This is probably due to a VGP_(pushcc)() without a matching\n"
-         "VGP_(popcc)().  Make sure they all match.\n"
+         "This is probably due to a VG_(pushcc)() without a matching\n"
+         "VG_(popcc)().  Make sure they all match.\n"
          "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]);
@@ -148,12 +148,12 @@
    vgp_entries[ cc ] ++;
 }
 
-void VGP_(popcc) ( UInt cc )
+void VG_(popcc) ( UInt cc )
 {
    if (vgp_sp <= 0) {
       VG_(printf)(
-         "\nProfile stack underflow.  This is due to a VGP_(popcc)() without\n"
-         "a matching VGP_(pushcc)().  Make sure they all match.\n");
+         "\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");
    }
    if (vgp_stack[vgp_sp] != cc) {
diff --git a/massif/ms_main.c b/massif/ms_main.c
index 019f4ae..6b4661c 100644
--- a/massif/ms_main.c
+++ b/massif/ms_main.c
@@ -1179,16 +1179,16 @@
    VG_(init_die_mem_stack_signal) ( die_mem_stack_signal );
 
    // Profiling events
-   VGP_(register_profile_event)(VgpGetXPt,         "get-XPt");
-   VGP_(register_profile_event)(VgpGetXPtSearch,   "get-XPt-search");
-   VGP_(register_profile_event)(VgpCensus,         "census");
-   VGP_(register_profile_event)(VgpCensusHeap,     "census-heap");
-   VGP_(register_profile_event)(VgpCensusSnapshot, "census-snapshot");
-   VGP_(register_profile_event)(VgpCensusTreeSize, "census-treesize");
-   VGP_(register_profile_event)(VgpUpdateXCon,     "update-XCon");
-   VGP_(register_profile_event)(VgpCalcSpacetime2, "calc-exact_ST_dbld");
-   VGP_(register_profile_event)(VgpPrintHp,        "print-hp");
-   VGP_(register_profile_event)(VgpPrintXPts,      "print-XPts");
+   VG_(register_profile_event)(VgpGetXPt,         "get-XPt");
+   VG_(register_profile_event)(VgpGetXPtSearch,   "get-XPt-search");
+   VG_(register_profile_event)(VgpCensus,         "census");
+   VG_(register_profile_event)(VgpCensusHeap,     "census-heap");
+   VG_(register_profile_event)(VgpCensusSnapshot, "census-snapshot");
+   VG_(register_profile_event)(VgpCensusTreeSize, "census-treesize");
+   VG_(register_profile_event)(VgpUpdateXCon,     "update-XCon");
+   VG_(register_profile_event)(VgpCalcSpacetime2, "calc-exact_ST_dbld");
+   VG_(register_profile_event)(VgpPrintHp,        "print-hp");
+   VG_(register_profile_event)(VgpPrintXPts,      "print-XPts");
 
    // HP_Chunks
    malloc_list  = VG_(HT_construct)();
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
index 4654251..eb2fd35 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -1925,9 +1925,9 @@
    VG_(init_post_reg_write)                   ( & mc_post_reg_write );
    VG_(init_post_reg_write_clientcall_return) ( & mc_post_reg_write_clientcall );
 
-   VGP_(register_profile_event) ( VgpSetMem,   "set-mem-perms" );
-   VGP_(register_profile_event) ( VgpCheckMem, "check-mem-perms" );
-   VGP_(register_profile_event) ( VgpESPAdj,   "adjust-ESP" );
+   VG_(register_profile_event) ( VgpSetMem,   "set-mem-perms" );
+   VG_(register_profile_event) ( VgpCheckMem, "check-mem-perms" );
+   VG_(register_profile_event) ( VgpESPAdj,   "adjust-ESP" );
 
    /* Additional block description for VG_(describe_addr)() */
    MAC_(describe_addr_supp) = client_perm_maybe_describe;