linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jianxun Zhang <jianxun.zhang@linux.intel.com>
To: linux-rt-users@vger.kernel.org
Cc: vedang.patel@intel.com, Jianxun Zhang <jianxun.zhang@linux.intel.com>
Subject: [PATCH] Make -x option position-agnostic
Date: Thu, 20 Apr 2017 10:09:42 -0700	[thread overview]
Message-ID: <1492708182-104442-1-git-send-email-jianxun.zhang@linux.intel.com> (raw)

Change 9d2c9edd86943dfea399a0176826af8bb92bf97c introduces
the new option of POSIX timer and makes MODE_CLOCK_NANOSLEEP
the default choice. But there are two places explicitly set
MODE_CLOCK_NANOSLEEP to the variable use_nanosleep in the code,
so the actual value of the variable after parsing depends on
the position of '-x' to '-U' and '-S'.

These command pairs result in different values in the variable:
'cyclictest -S -x' VS 'cyclictest -x -S'
'cyclictest -U -x' VS 'cyclictest -x -U'

This change ensures -x work regardless its position by removing
the two lines in these cases.

Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
---
Note: This patch is submitted after a very limited test in its scope. No real RT test was performed. Maintainers may want to do a full test or a closer review for anything I missed.

There are other findings regarding to the parsing logic but I don't think they are critical as long as the usage gives correct test results. I could amend these with more patches later.

Thanks

 src/cyclictest/cyclictest.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 0b13441..381191c 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1705,7 +1705,6 @@ static void process_options (int argc, char *argv[], int max_cpus)
 			smp = 1;
 			num_threads = max_cpus;
 			setaffinity = AFFINITY_USEALL;
-			use_nanosleep = MODE_CLOCK_NANOSLEEP;
 			break;
 		case 't':
 		case OPT_THREADS:
@@ -1744,7 +1743,6 @@ static void process_options (int argc, char *argv[], int max_cpus)
 #ifdef NUMA
 			num_threads = max_cpus;
 			setaffinity = AFFINITY_USEALL;
-			use_nanosleep = MODE_CLOCK_NANOSLEEP;
 #else
 			warn("cyclictest was not built with the numa option\n");
 			warn("ignoring --numa or -U\n");
-- 
2.7.4


             reply	other threads:[~2017-04-20 17:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 17:09 Jianxun Zhang [this message]
2017-05-15 14:50 ` [PATCH] Make -x option position-agnostic John Kacur

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=1492708182-104442-1-git-send-email-jianxun.zhang@linux.intel.com \
    --to=jianxun.zhang@linux.intel.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=vedang.patel@intel.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;
as well as URLs for NNTP newsgroup(s).