]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't use the VGP_ for profiling any more, just use VG_ -- we want to use
authorNicholas Nethercote <njn@valgrind.org>
Sat, 26 Mar 2005 00:42:02 +0000 (00:42 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sat, 26 Mar 2005 00:42:02 +0000 (00:42 +0000)
VGP_ for platform-specific things.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3435

addrcheck/ac_main.c
cachegrind/cg_main.c
coregrind/core.h
coregrind/vg_dummy_profile.c
coregrind/vg_main.c
docs/xml/writing-tools.xml
include/tool.h.base
include/tool_asm.h
include/vg_profile.c
massif/ms_main.c
memcheck/mc_main.c

index bcb937a594439cd69f4eac63f10e87c0266b2bd5..7ed3de10c11535e4d6a264ba992e9aba520c83e6 100644 (file)
@@ -1364,9 +1364,9 @@ void TL_(pre_clo_init)(void)
    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)();
index 159051b3dee17c56739d55577240f19513835347..4e625fd8aaf0eb5a1ff42306c83b7903e3099744 100644 (file)
@@ -1135,9 +1135,9 @@ void TL_(post_clo_init)(void)
    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)
index 37b5a61bbdfb1c420426f65fe394d5865588f737..16000413fd630081af636fd61d28a86b0abc203c 100644 (file)
@@ -283,13 +283,13 @@ extern Bool VGA_(client_requests)(ThreadId tid, UWord *args);
    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)
 
 
 /* ---------------------------------------------------------------------
index 2125e6922d990775d35dc856241a6eeda7f46e94..6bc2ea2de1ee025caee2d1ff59618fdc1f679e9c 100644 (file)
@@ -42,26 +42,26 @@ static void vgp_die(void)
    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();
 }
index 59389a567f6cb7fbda5fdb169571fe181818230c..31c465b32bd2fc8c0935b66a4cfa0fa2ffe28c7e 100644 (file)
@@ -2738,7 +2738,7 @@ int main(int argc, char **argv, char **envp)
    // 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 @@ void VG_(shutdown_actions)(ThreadId tid)
       print_all_stats();
 
    if (VG_(clo_profile))
-      VGP_(done_profiling)();
+      VG_(done_profiling)();
    if (VG_(clo_profile_flags) > 0)
       VG_(show_BB_profile)();
 
index aaf1d9b2b4c9d6ba9648a2e3e2249c403d49db5f..8915a3632b13b44adefce44c3ee410eb0873b9be 100644 (file)
@@ -1120,6 +1120,9 @@ want to write regression tests for your tool:</para>
 <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 @@ option.</para>
 
 <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
index 14d9fe61eb2900928389777dfc9d95605346e2cd..f4f34c799d6aa98114d87fdc9f8393693b577d56 100644 (file)
@@ -203,7 +203,7 @@ extern int VG_(vmessage)   ( VgMsgKind kind, const Char* format, va_list vargs )
 /*=== 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 @@ typedef enum { VGP_CORE_LIST } VgpCoreCC;
 
 /* 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
index 931abc63b74a196433c8eae862d168989908c6af..65c2d5ecf8a949e4197971050a2f4b98b4fbe038 100644 (file)
@@ -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)
index 6ee6f687a834d9b52b22ff09ec75ea7fb463c209..88030db38821eb53ab9904d6d720647085ecc0e9 100644 (file)
@@ -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 @@ static UInt  vgp_stack[VGP_M_STACK];
 
 /* 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 @@ void VGP_(register_profile_event) ( Int n, Char* name )
    vgp_names[n] = name;
 }
 
-void VGP_(tick) ( int sigNo )
+void VG_(tick) ( int sigNo )
 {
    Int cc;
    vgp_nticks++;
@@ -93,32 +93,32 @@ void VGP_(tick) ( int sigNo )
    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 @@ void VGP_(done_profiling) ( void )
             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 @@ void VGP_(pushcc) ( UInt cc )
    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) {
index 019f4ae385f470d12d7175241225312cf49be960..6b4661c371ca28f119ef6847de667d84fc920190 100644 (file)
@@ -1179,16 +1179,16 @@ void TL_(pre_clo_init)()
    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)();
index 4654251012a3b42d25142a6798320dc31a762687..eb2fd350a061bf535db45751ff34ba08626cb2eb 100644 (file)
@@ -1925,9 +1925,9 @@ void TL_(pre_clo_init)(void)
    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;