]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Scheduler counts don't need to be in vg_include.h. Replace with a print
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 2 Aug 2004 15:27:22 +0000 (15:27 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 2 Aug 2004 15:27:22 +0000 (15:27 +0000)
function.

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

coregrind/vg_include.h
coregrind/vg_main.c
coregrind/vg_scheduler.c

index c6d45b7d31f7abaf1677d762d913f00c403e582f..f5b8669146e48221a2d803f74cf125265858d6c6 100644 (file)
@@ -1358,10 +1358,7 @@ extern UInt VG_(bb_dechain_count);
 /* Number of unchained jumps performed. */
 extern UInt VG_(unchained_jumps_done);
 
-
-/* Counts pertaining to the scheduler. */
-extern UInt VG_(num_scheduling_events_MINOR);
-extern UInt VG_(num_scheduling_events_MAJOR);
+extern void VG_(print_scheduler_stats) ( void );
 
 /* ---------------------------------------------------------------------
    Exports of vg_memory.c
index def1d0d87a1b8540560501d54d6f9b5cc32e75fc..990b70c2d12aed85305018f5f2c92d328b9f547f 100644 (file)
@@ -201,11 +201,6 @@ UInt VG_(unchained_jumps_done) = 0;
 static UInt sanity_fast_count = 0;
 static UInt sanity_slow_count = 0;
 
-/* Counts pertaining to the scheduler. */
-UInt VG_(num_scheduling_events_MINOR) = 0;
-UInt VG_(num_scheduling_events_MAJOR) = 0;
-
-
 static __inline__ Int safe_idiv(Int a, Int b)
 {
    return (b == 0 ? 0 : a / b);
@@ -239,11 +234,9 @@ static void show_counts ( void )
          / ( VG_(bbs_done)==0 ? 1 : VG_(bbs_done) )
    );
 
+   VG_(print_scheduler_stats)();
    VG_(message)(Vg_DebugMsg,
-      "           %d/%d major/minor sched events.  %d tt_fast misses.", 
-                     VG_(num_scheduling_events_MAJOR), 
-                     VG_(num_scheduling_events_MINOR), 
-                     VG_(tt_fast_misses));
+      "           %d tt_fast misses.", VG_(tt_fast_misses));
 
    VG_(print_reg_alloc_stats)();
    VG_(message)(Vg_DebugMsg, 
index 8128c667dae4b77ac4afaabab0986724b3e13011..b4bab2454e85953af1c96813c8f7be652ad39fc9 100644 (file)
@@ -134,6 +134,17 @@ static void do_client_request ( ThreadId tid );
 static void scheduler_sanity ( void );
 static void do_pthread_cond_timedwait_TIMEOUT ( ThreadId tid );
 
+/* Stats. */
+static UInt n_scheduling_events_MINOR = 0;
+static UInt n_scheduling_events_MAJOR = 0;
+
+void VG_(print_scheduler_stats)(void)
+{
+   VG_(message)(Vg_DebugMsg,
+      "           %d/%d major/minor sched events.", 
+      n_scheduling_events_MAJOR, n_scheduling_events_MINOR);
+}
+
 /* ---------------------------------------------------------------------
    Helper functions for the scheduler.
    ------------------------------------------------------------------ */
@@ -938,7 +949,7 @@ VgSchedReturnCode VG_(scheduler) ( Int* exitcode )
       while (True) {
 
          /* For stats purposes only. */
-         VG_(num_scheduling_events_MAJOR) ++;
+         n_scheduling_events_MAJOR++;
 
         /* Route signals to their proper places */
         VG_(route_signals)();
@@ -1038,7 +1049,7 @@ VgSchedReturnCode VG_(scheduler) ( Int* exitcode )
          VG_(last_run_tid) = tid;
 
          /* For stats purposes only. */
-         VG_(num_scheduling_events_MINOR) ++;
+         n_scheduling_events_MINOR++;
 
          if (0)
             VG_(message)(Vg_DebugMsg, "thread %d: running for %d bbs",