]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
allow compile time tracing to be enabled using the stats counters
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 1 Mar 2013 20:37:41 +0000 (20:37 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 1 Mar 2013 20:37:41 +0000 (20:37 +0000)
(so put first the static stats counters).

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

coregrind/m_stacktrace.c

index 0420200a1cd6191b7bde4b04e6dc7b2f214ecedc..3a1fdff02b807352626dfc28d1e093fb1f54982c 100644 (file)
@@ -142,20 +142,6 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
                                UnwindStartRegs* startRegs,
                                Addr fp_max_orig )
 {
-   const Bool   debug = False; // VG_(debugLog_getLevel) () > 3; // True;
-   const HChar* unwind_case; // used when debug is True.
-   // Debugging this function is not straightforward.
-   // Here is the easiest way I have found:
-   // 1. Change the above to True.
-   // 2. Start your program under Valgrind with --tool=none --vgdb-error=0
-   // 3. Use GDB/vgdb to put a breakpoint where you want to debug the stacktrace
-   // 4. Continue till breakpoint is encountered
-   // 5. From GDB, use 'monitor v.info scheduler' and examine the unwind traces.
-   //    You might have to do twice 'monitor v.info scheduler' to see
-   //    the effect of caching the results of the verification.
-   //    You can also modify the debug dynamically using by using
-   //    'monitor v.set debuglog 4.
-
    const Bool do_stats = False; // compute and output some stats regularly.
    static struct {
       UInt nr; // nr of stacktraces computed
@@ -171,6 +157,23 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
       UInt MS; // microsoft unwind
    } stats;
    
+   const Bool   debug = False;
+   //                 = VG_(debugLog_getLevel) () > 3;
+   //                 = True;
+   //                 = stats.nr >= 123456;
+   const HChar* unwind_case; // used when debug is True.
+   // Debugging this function is not straightforward.
+   // Here is the easiest way I have found:
+   // 1. Change the above to True.
+   // 2. Start your program under Valgrind with --tool=none --vgdb-error=0
+   // 3. Use GDB/vgdb to put a breakpoint where you want to debug the stacktrace
+   // 4. Continue till breakpoint is encountered
+   // 5. From GDB, use 'monitor v.info scheduler' and examine the unwind traces.
+   //    You might have to do twice 'monitor v.info scheduler' to see
+   //    the effect of caching the results of the verification.
+   //    You can also modify the debug dynamically using by using
+   //    'monitor v.set debuglog 4.
+
    Int   i;
    Addr  fp_max;
    UInt  n_found = 0;