function.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2551
/* 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
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);
/ ( 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,
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.
------------------------------------------------------------------ */
while (True) {
/* For stats purposes only. */
- VG_(num_scheduling_events_MAJOR) ++;
+ n_scheduling_events_MAJOR++;
/* Route signals to their proper places */
VG_(route_signals)();
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",