From: John Kacur <jkacur@redhat.com>
To: williams@redhat.com
Cc: linux-rt-users@vger.kernel.org
Subject: [PATCH 3/6] pi_stress clean-ups, fix hang.
Date: Mon, 14 Sep 2009 16:35:32 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.0909141634440.4675@localhost.localdomain> (raw)
>From fdd16e7dc65be18cffbba2bc731c49f8ddd780d7 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
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
reply other threads:[~2009-09-14 14:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.00.0909141634440.4675@localhost.localdomain \
--to=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox