All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clark Williams <williams@redhat.com>
To: Carsten Emde <ce@ceag.ch>
Cc: Frank Rowand <frank.rowand@am.sony.com>,
	RT <linux-rt-users@vger.kernel.org>
Subject: change to cyclictest -h option?
Date: Thu, 29 Sep 2011 09:28:19 -0500	[thread overview]
Message-ID: <20110929092819.39119817@redhat.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 976 bytes --]

Carsten,

I'm considering applying the following patch to cyclictest, which will
change an implied behavior for the -h/--histogram option. Currently
when you specify -h without --smp or --numa, any realtime priority
specified is spread across the range of measurement threads. This patch
makes that spread an explicit option, rather than implicit in the
histogram option. 

Previous command line:

	$ sudo cyclictest --h -t -p90

New command line:

	$ sudo cyclictest --h -t -p90 -Q

Where the -Q/--priospread option causes the priority assigned to
measurement threads to be decremented after each thread is created.
With this option in place, the first command line would create a
measurement thread for each core, all running at fifo:90.

Is this going to cause you pain and heartache in your automated tests?

Clark

P.S. Yes, I know that -Q makes no sense, but I couldn't come up with a
one-letter option that did, that wasn't already taken :)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: priospread.patch --]
[-- Type: text/x-patch, Size: 2638 bytes --]

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 731b4bd..c0cde4a 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -170,6 +170,7 @@ static int duration = 0;
 static int use_nsecs = 0;
 static int refresh_on_max;
 static int force_sched_other;
+static int priospread = 0;
 
 static pthread_cond_t refresh_on_max_cond = PTHREAD_COND_INITIALIZER;
 static pthread_mutex_t refresh_on_max_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -845,6 +846,7 @@ static void display_help(int error)
 	       "-p PRIO  --prio=PRIO       priority of highest prio thread\n"
 	       "-P       --preemptoff      Preempt off tracing (used with -b)\n"
 	       "-q       --quiet           print only a summary on exit\n"
+	       "-Q       --priospread       spread priority levels starting at specified value\n"
 	       "-r       --relative        use relative timer instead of absolute\n"
 	       "-s       --system          use sys_nanosleep and sys_setitimer\n"
 	       "-t       --threads         one thread per available processor\n"
@@ -984,9 +986,10 @@ static void process_options (int argc, char *argv[])
 			{"smp", no_argument, NULL, 'S'},
 			{"numa", no_argument, NULL, 'U'},
 			{"latency", required_argument, NULL, 'e'},
+			{"priospread", no_argument, NULL, 'Q'},
 			{NULL, 0, NULL, 0}
 		};
-		int c = getopt_long(argc, argv, "a::b:Bc:Cd:Efh:H:i:Il:MnNo:O:p:PmqrsSt::uUvD:wWT:y:e:",
+		int c = getopt_long(argc, argv, "a::b:Bc:Cd:Efh:H:i:Il:MnNo:O:p:PmqQrsSt::uUvD:wWT:y:e:",
 				    long_options, &option_index);
 		if (c == -1)
 			break;
@@ -1045,6 +1048,7 @@ static void process_options (int argc, char *argv[])
 			}
 			break;
 		case 'q': quiet = 1; break;
+		case 'Q': priospread = 1; break;
 		case 'r': timermode = TIMER_RELTIME; break;
 		case 's': use_system = MODE_SYS_OFFSET; break;
 		case 't':
@@ -1140,6 +1144,12 @@ static void process_options (int argc, char *argv[])
 	if (priority < 0 || priority > 99)
 		error = 1;
 
+	if (priospread && priority == 0) {
+		fprintf(stderr, "defaulting realtime priority to %d\n", 
+			num_threads+1);
+		priority = num_threads+1;
+	}
+
 	if (priority && (policy != SCHED_FIFO && policy != SCHED_RR)) {
 		fprintf(stderr, "policy and priority don't match: setting policy to SCHED_FIFO\n");
 		policy = SCHED_FIFO;
@@ -1456,7 +1466,7 @@ int main(int argc, char **argv)
 			par->policy = SCHED_OTHER;
 			force_sched_other = 1;
 		}
-		if (priority && !histogram && !smp && !numa)
+		if (priospread)
 			priority--;
 		par->clock = clocksources[clocksel];
 		par->mode = mode;

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

                 reply	other threads:[~2011-09-29 14:28 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=20110929092819.39119817@redhat.com \
    --to=williams@redhat.com \
    --cc=ce@ceag.ch \
    --cc=frank.rowand@am.sony.com \
    --cc=linux-rt-users@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.