Scheduler counts don't need to be in vg_include.h.  Replace with a print
function.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2551 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_include.h b/coregrind/vg_include.h
index c6d45b7..f5b8669 100644
--- a/coregrind/vg_include.h
+++ b/coregrind/vg_include.h
@@ -1358,10 +1358,7 @@
 /* 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
diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c
index def1d0d..990b70c 100644
--- a/coregrind/vg_main.c
+++ b/coregrind/vg_main.c
@@ -201,11 +201,6 @@
 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 @@
          / ( 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, 
diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c
index 8128c66..b4bab24 100644
--- a/coregrind/vg_scheduler.c
+++ b/coregrind/vg_scheduler.c
@@ -134,6 +134,17 @@
 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 @@
       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 @@
          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",