|
From: <sv...@va...> - 2013-01-23 22:19:50
|
philippe 2013-01-23 22:19:36 +0000 (Wed, 23 Jan 2013)
New Revision: 13263
Log:
Avoid doing a useless system call in scheduler sanity check
Modified files:
trunk/coregrind/m_scheduler/scheduler.c
Modified: trunk/coregrind/m_scheduler/scheduler.c (+12 -10)
===================================================================
--- trunk/coregrind/m_scheduler/scheduler.c 2013-01-23 22:10:28 +00:00 (rev 13262)
+++ trunk/coregrind/m_scheduler/scheduler.c 2013-01-23 22:19:36 +00:00 (rev 13263)
@@ -1973,8 +1973,6 @@
void scheduler_sanity ( ThreadId tid )
{
Bool bad = False;
- static UInt lasttime = 0;
- UInt now;
Int lwpid = VG_(gettid)();
if (!VG_(is_running_thread)(tid)) {
@@ -1999,14 +1997,18 @@
bad = True;
}
- /* Periodically show the state of all threads, for debugging
- purposes. */
- now = VG_(read_millisecond_timer)();
- if (0 && (!bad) && (lasttime + 4000/*ms*/ <= now)) {
- lasttime = now;
- VG_(printf)("\n------------ Sched State at %d ms ------------\n",
- (Int)now);
- VG_(show_sched_status)();
+ if (0) {
+ /* Periodically show the state of all threads, for debugging
+ purposes. */
+ static UInt lasttime = 0;
+ UInt now;
+ now = VG_(read_millisecond_timer)();
+ if ((!bad) && (lasttime + 4000/*ms*/ <= now)) {
+ lasttime = now;
+ VG_(printf)("\n------------ Sched State at %d ms ------------\n",
+ (Int)now);
+ VG_(show_sched_status)();
+ }
}
/* core_panic also shows the sched status, which is why we don't
|