pi_stress clean-ups, fix hang.
PATCH 3/6 pi_stress clean-ups, fix hang.
Quoted 1 line
From
fdd16e7dc65be18cffbba2bc731c49f8ddd780d7Mon Sep 17 00:00:00 2001
From: John Kacur <[email protected]>
Date: Wed, 2 Sep 2009 15:31:01 +0200
Subject: [PATCH] Simplify the logic by using the info function
For verbose printing we can make use of the info function, instead of complicated the logic with if (!quiet)
--- src/pi_tests/pi_stress.c | 30 ++++++++++++------------------ 1 files changed, 12 insertions(+), 18 deletions(-)
src/pi_tests/pi_stress.c +12 -18
@@ -414,8 +414,7 @@ set_cpu_affinity(cpu_set_t *test_mask, cpu_set_t *admin_mask)CPU_ZERO (test_mask);CPU_SET (0 , admin_mask);CPU_SET (0 , test_mask); -if (!quiet) -printf ("admin and test threads running on one processor\n" ); +info ("admin and test threads running on one processor\n" );return SUCCESS ; }
@@ -442,21 +441,20 @@ set_cpu_affinity(cpu_set_t *test_mask, cpu_set_t *admin_mask)error ("set_cpu_affinity: setting CPU affinity mask: 0x%x\n" , status);return FAILURE ; } -if (!quiet) -printf ("Admin thread running on processor: %d\n" , i); +info ("Admin thread running on processor: %d\n" , i);/* Set test affinity so that tests run on the non-admin processors */ CPU_ZERO (test_mask);for (i = admin_proc+1 ; i < num_processors; i++)CPU_SET (i, test_mask); -if (!quiet) { -if (admin_proc+1 == num_processors -1 ) -printf ("Test threads running on processor: %ld\n" , num_processors-1 ); -else -printf ("Test threads running on processors: %d-%d\n" , - admin_proc+1 , (int )num_processors-1 ); - } +if (admin_proc+1 == num_processors -1 ) +info ("Test threads running on processor: %ld\n" , + num_processors-1 ); +else +info ("Test threads running on processors: %d-%d\n" , + admin_proc+1 , (int )num_processors-1 ); +return SUCCESS ; }
@@ -543,9 +541,7 @@ reporter(void *arg) }debug ("reporter: starting report loop\n" ); - -if (!quiet) -printf ("Press Control-C to stop test\nCurrent Inversions: \n" ); +info ("Press Control-C to stop test\nCurrent Inversions: \n" );while (shutdown ==0 ) {// wait for our reporting interval
@@ -565,16 +561,14 @@ reporter(void *arg)// if we specified a duration, see if it has expired if (end &&time (NULL ) > end) { -if (!quiet) -printf ("duration reached (%d seconds)\n" , duration); +info ("duration reached (%d seconds)\n" , duration);cleanup ();continue ; }// check for a pending SIGINT if (pending_interrupt ()) { -if (!quiet) -printf ("Keyboard Interrupt!\n" ); +info ("Keyboard Interrupt!\n" );break ; }
Signature · 1 line
1.6.0.6