[PATCH 3/6] pi_stress clean-ups, fix hang.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From fdd16e7dc65be18cffbba2bc731c49f8ddd780d7 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@xxxxxxxxxx>
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(-)

diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index b8db281..2a409cc 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -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;
 		}
 
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux