* [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. @ 2017-03-13 17:58 Vedang Patel 2017-03-13 18:00 ` Patel, Vedang 0 siblings, 1 reply; 9+ messages in thread From: Vedang Patel @ 2017-03-13 17:58 UTC (permalink / raw) To: williams, jkacur; +Cc: linux-rt-users, Vedang Patel it is recommended that clock_nanosleep should be used for real-time wherever available. So, make sure that cyclictest runs clock_nanosleep by default. Added an option to run POSIX timers. The '-n' option is redundant now. I did not remove it so that it does not break existing scripts. Signed-off-by: Vedang Patel <vedang.patel@intel.com> --- src/cyclictest/cyclictest.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 00e5f3d59a5b..a185a8a99065 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1360,7 +1360,8 @@ static void display_help(int error) " format: n:c:v n=tasknum c=count v=value in us\n" "-w --wakeup task wakeup tracing (used with -b)\n" "-W --wakeuprt rt task wakeup tracing (used with -b)\n" - " --dbg_cyclictest print info useful for debugging cyclictest\n", + " --dbg_cyclictest print info useful for debugging cyclictest\n" + "-x --posix_timers use POSIX timers\n", tracers ); if (error) @@ -1368,7 +1369,7 @@ static void display_help(int error) exit(EXIT_SUCCESS); } -static int use_nanosleep; +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; /* use clock_nanosleep by default. */ static int timermode = TIMER_ABSTIME; static int use_system; static int priority; @@ -1489,6 +1490,7 @@ enum option_values { OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, OPT_WAKEUP, OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS, OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, OPT_TRACEMARK, + OPT_POSIX_TIMERS, }; /* Process commandline options */ @@ -1553,9 +1555,10 @@ static void process_options (int argc, char *argv[], int max_cpus) {"dbg_cyclictest", no_argument, NULL, OPT_DBGCYCLIC }, {"policy", required_argument, NULL, OPT_POLICY }, {"help", no_argument, NULL, OPT_HELP }, + {"posix_timers", no_argument, NULL, OPT_POSIX_TIMERS }, {NULL, 0, NULL, 0} }; - int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", + int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:x", long_options, &option_index); if (c == -1) break; @@ -1756,6 +1759,9 @@ static void process_options (int argc, char *argv[], int max_cpus) case 'W': case OPT_WAKEUPRT: tracetype = WAKEUPRT; break; + case 'x': + case OPT_POSIX_TIMERS: + use_nanosleep = MODE_CYCLIC; break; case '?': case OPT_HELP: display_help(0); break; -- 2.7.3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-13 17:58 [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers Vedang Patel @ 2017-03-13 18:00 ` Patel, Vedang 2017-03-14 15:49 ` John Kacur 0 siblings, 1 reply; 9+ messages in thread From: Patel, Vedang @ 2017-03-13 18:00 UTC (permalink / raw) To: jkacur@redhat.com, williams@redhat.com; +Cc: linux-rt-users@vger.kernel.org Fixing a typo in John's email -Vedang On Mon, 2017-03-13 at 10:58 -0700, Vedang Patel wrote: > it is recommended that clock_nanosleep should be used for real-time > wherever available. So, make sure that cyclictest runs > clock_nanosleep > by default. Added an option to run POSIX timers. The '-n' option is > redundant now. I did not remove it so that it does not break existing > scripts. > > Signed-off-by: Vedang Patel <vedang.patel@intel.com> > --- > src/cyclictest/cyclictest.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/src/cyclictest/cyclictest.c > b/src/cyclictest/cyclictest.c > index 00e5f3d59a5b..a185a8a99065 100644 > --- a/src/cyclictest/cyclictest.c > +++ b/src/cyclictest/cyclictest.c > @@ -1360,7 +1360,8 @@ static void display_help(int error) > " format: n:c:v n=tasknum > c=count v=value in us\n" > "-w --wakeup task wakeup tracing (used > with -b)\n" > "-W --wakeuprt rt task wakeup tracing > (used with -b)\n" > - " --dbg_cyclictest print info useful for > debugging cyclictest\n", > + " --dbg_cyclictest print info useful for > debugging cyclictest\n" > + "-x --posix_timers use POSIX timers\n", > tracers > ); > if (error) > @@ -1368,7 +1369,7 @@ static void display_help(int error) > exit(EXIT_SUCCESS); > } > > -static int use_nanosleep; > +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; /* use > clock_nanosleep by default. */ > static int timermode = TIMER_ABSTIME; > static int use_system; > static int priority; > @@ -1489,6 +1490,7 @@ enum option_values { > OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, > OPT_WAKEUP, > OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, > OPT_NUMOPTS, > OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, > OPT_TRACEMARK, > + OPT_POSIX_TIMERS, > }; > > /* Process commandline options */ > @@ -1553,9 +1555,10 @@ static void process_options (int argc, char > *argv[], int max_cpus) > {"dbg_cyclictest", no_argument, NULL > , OPT_DBGCYCLIC }, > {"policy", required_argument, > NULL, OPT_POLICY }, > {"help", no_argument, NULL > , OPT_HELP }, > + {"posix_timers", no_argument, NUL > L, OPT_POSIX_TIMERS }, > {NULL, 0, NULL, 0} > }; > - int c = getopt_long(argc, argv, > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", > + int c = getopt_long(argc, argv, > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:x", > long_options, &option_index); > if (c == -1) > break; > @@ -1756,6 +1759,9 @@ static void process_options (int argc, char > *argv[], int max_cpus) > case 'W': > case OPT_WAKEUPRT: > tracetype = WAKEUPRT; break; > + case 'x': > + case OPT_POSIX_TIMERS: > + use_nanosleep = MODE_CYCLIC; break; > case '?': > case OPT_HELP: > display_help(0); break; ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-13 18:00 ` Patel, Vedang @ 2017-03-14 15:49 ` John Kacur 2017-03-14 18:42 ` Patel, Vedang 2017-03-14 19:43 ` Vedang Patel 0 siblings, 2 replies; 9+ messages in thread From: John Kacur @ 2017-03-14 15:49 UTC (permalink / raw) To: Patel, Vedang; +Cc: williams@redhat.com, linux-rt-users@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 3705 bytes --] On Mon, 13 Mar 2017, Patel, Vedang wrote: > Fixing a typo in John's email > > -Vedang > On Mon, 2017-03-13 at 10:58 -0700, Vedang Patel wrote: > > it is recommended that clock_nanosleep should be used for real-time > > wherever available. So, make sure that cyclictest runs > > clock_nanosleep > > by default. Added an option to run POSIX timers. The '-n' option is > > redundant now. I did not remove it so that it does not break existing > > scripts. > > > > Signed-off-by: Vedang Patel <vedang.patel@intel.com> > > --- > > src/cyclictest/cyclictest.c | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/src/cyclictest/cyclictest.c > > b/src/cyclictest/cyclictest.c > > index 00e5f3d59a5b..a185a8a99065 100644 > > --- a/src/cyclictest/cyclictest.c > > +++ b/src/cyclictest/cyclictest.c > > @@ -1360,7 +1360,8 @@ static void display_help(int error) > > " format: n:c:v n=tasknum > > c=count v=value in us\n" > > "-w --wakeup task wakeup tracing (used > > with -b)\n" > > "-W --wakeuprt rt task wakeup tracing > > (used with -b)\n" > > - " --dbg_cyclictest print info useful for > > debugging cyclictest\n", > > + " --dbg_cyclictest print info useful for > > debugging cyclictest\n" > > + "-x --posix_timers use POSIX timers\n", > > tracers > > ); > > if (error) > > @@ -1368,7 +1369,7 @@ static void display_help(int error) > > exit(EXIT_SUCCESS); > > } > > > > -static int use_nanosleep; > > +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; /* use > > clock_nanosleep by default. */ > > static int timermode = TIMER_ABSTIME; > > static int use_system; > > static int priority; > > @@ -1489,6 +1490,7 @@ enum option_values { > > OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, > > OPT_WAKEUP, > > OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, > > OPT_NUMOPTS, > > OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, > > OPT_TRACEMARK, > > + OPT_POSIX_TIMERS, > > }; > > > > /* Process commandline options */ > > @@ -1553,9 +1555,10 @@ static void process_options (int argc, char > > *argv[], int max_cpus) > > {"dbg_cyclictest", no_argument, NULL > > , OPT_DBGCYCLIC }, > > {"policy", required_argument, > > NULL, OPT_POLICY }, > > {"help", no_argument, NULL > > , OPT_HELP }, > > + {"posix_timers", no_argument, NUL > > L, OPT_POSIX_TIMERS }, > > {NULL, 0, NULL, 0} > > }; > > - int c = getopt_long(argc, argv, > > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", > > + int c = getopt_long(argc, argv, > > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:x", > > long_options, &option_index); > > if (c == -1) > > break; > > @@ -1756,6 +1759,9 @@ static void process_options (int argc, char > > *argv[], int max_cpus) > > case 'W': > > case OPT_WAKEUPRT: > > tracetype = WAKEUPRT; break; > > + case 'x': > > + case OPT_POSIX_TIMERS: > > + use_nanosleep = MODE_CYCLIC; break; > > case '?': > > case OPT_HELP: > > display_help(0); break; We could apply this to the "unstable" developer version, in which case we are not concerned with maintaining compatibility with scripts etc, so you can go ahead and remove -n too. Use either one of the following branches unstable/devel/v1.1.1 unstable/devel/v1.1.1-devel (yeah, I need to clean that up in the near future) Thanks John ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-14 15:49 ` John Kacur @ 2017-03-14 18:42 ` Patel, Vedang 2017-03-14 19:43 ` Vedang Patel 1 sibling, 0 replies; 9+ messages in thread From: Patel, Vedang @ 2017-03-14 18:42 UTC (permalink / raw) To: jkacur@redhat.com; +Cc: linux-rt-users@vger.kernel.org, williams@redhat.com On Tue, 2017-03-14 at 16:49 +0100, John Kacur wrote: > > On Mon, 13 Mar 2017, Patel, Vedang wrote: > > > > > Fixing a typo in John's email > > > > -Vedang > > On Mon, 2017-03-13 at 10:58 -0700, Vedang Patel wrote: > > > > > > it is recommended that clock_nanosleep should be used for real- > > > time > > > wherever available. So, make sure that cyclictest runs > > > clock_nanosleep > > > by default. Added an option to run POSIX timers. The '-n' option > > > is > > > redundant now. I did not remove it so that it does not break > > > existing > > > scripts. > > > > > > Signed-off-by: Vedang Patel <vedang.patel@intel.com> > > > --- > > > src/cyclictest/cyclictest.c | 12 +++++++++--- > > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > > > diff --git a/src/cyclictest/cyclictest.c > > > b/src/cyclictest/cyclictest.c > > > index 00e5f3d59a5b..a185a8a99065 100644 > > > --- a/src/cyclictest/cyclictest.c > > > +++ b/src/cyclictest/cyclictest.c > > > @@ -1360,7 +1360,8 @@ static void display_help(int error) > > > " format: n:c:v > > > n=tasknum > > > c=count v=value in us\n" > > > "-w --wakeup task wakeup tracing > > > (used > > > with -b)\n" > > > "-W --wakeuprt rt task wakeup > > > tracing > > > (used with -b)\n" > > > - " --dbg_cyclictest print info useful for > > > debugging cyclictest\n", > > > + " --dbg_cyclictest print info useful for > > > debugging cyclictest\n" > > > + "-x --posix_timers use POSIX > > > timers\n", > > > tracers > > > ); > > > if (error) > > > @@ -1368,7 +1369,7 @@ static void display_help(int error) > > > exit(EXIT_SUCCESS); > > > } > > > > > > -static int use_nanosleep; > > > +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; /* use > > > clock_nanosleep by default. */ > > > static int timermode = TIMER_ABSTIME; > > > static int use_system; > > > static int priority; > > > @@ -1489,6 +1490,7 @@ enum option_values { > > > OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, > > > OPT_VERBOSE, > > > OPT_WAKEUP, > > > OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, > > > OPT_NUMOPTS, > > > OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, > > > OPT_TRACEMARK, > > > + OPT_POSIX_TIMERS, > > > }; > > > > > > /* Process commandline options */ > > > @@ -1553,9 +1555,10 @@ static void process_options (int argc, > > > char > > > *argv[], int max_cpus) > > > {"dbg_cyclictest", no_argument, > > > NULL > > > , OPT_DBGCYCLIC }, > > > {"policy", required_argument, > > > NULL, OPT_POLICY }, > > > {"help", no_argument, > > > NULL > > > , OPT_HELP }, > > > + {"posix_timers", no_argument, > > > NUL > > > L, OPT_POSIX_TIMERS }, > > > {NULL, 0, NULL, 0} > > > }; > > > - int c = getopt_long(argc, argv, > > > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", > > > + int c = getopt_long(argc, argv, > > > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:x", > > > long_options, > > > &option_index); > > > if (c == -1) > > > break; > > > @@ -1756,6 +1759,9 @@ static void process_options (int argc, char > > > *argv[], int max_cpus) > > > case 'W': > > > case OPT_WAKEUPRT: > > > tracetype = WAKEUPRT; break; > > > + case 'x': > > > + case OPT_POSIX_TIMERS: > > > + use_nanosleep = MODE_CYCLIC; break; > > > case '?': > > > case OPT_HELP: > > > display_help(0); break; > > We could apply this to the "unstable" developer version, in which > case we > are not concerned with maintaining compatibility with scripts etc, so > you can go ahead and remove -n too. > > Use either one of the following branches > unstable/devel/v1.1.1 > unstable/devel/v1.1.1-devel > Thanks for the quick response, John. Sending another patch after removing '-n' option and rebasing on top of v1.1.1-devel. Thanks, Vedang Patel Software Engineer Intel Corporation > (yeah, I need to clean that up in the near future) > > Thanks > > John ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-14 15:49 ` John Kacur 2017-03-14 18:42 ` Patel, Vedang @ 2017-03-14 19:43 ` Vedang Patel 2017-03-23 19:14 ` Henrik Austad 1 sibling, 1 reply; 9+ messages in thread From: Vedang Patel @ 2017-03-14 19:43 UTC (permalink / raw) To: williams, jkacur; +Cc: linux-rt-users, Vedang Patel it is recommended that clock_nanosleep should be used for real-time wherever available. So, make sure that cyclictest runs clock_nanosleep by default. Added an option to run POSIX timers. Removing the '-n' option because it is redundant now. Signed-off-by: Vedang Patel <vedang.patel@intel.com> --- src/cyclictest/cyclictest.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 3f1bef1ffca9..cf82f8e1deaa 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1321,7 +1321,6 @@ static void display_help(int error) "-m --mlockall lock current and future memory allocations\n" "-M --refresh_on_max delay updating the screen until a new max\n" " latency is hit. Userful for low bandwidth.\n" - "-n --nanosleep use clock_nanosleep\n" " --notrace suppress tracing\n" "-N --nsecs print results in ns instead of us (default us)\n" "-o RED --oscope=RED oscilloscope mode, reduce verbose output by RED\n" @@ -1364,7 +1363,8 @@ static void display_help(int error) " format: n:c:v n=tasknum c=count v=value in us\n" "-w --wakeup task wakeup tracing (used with -b)\n" "-W --wakeuprt rt task wakeup tracing (used with -b)\n" - " --dbg_cyclictest print info useful for debugging cyclictest\n", + " --dbg_cyclictest print info useful for debugging cyclictest\n" + "-x --posix_timers use POSIX timers\n", tracers ); if (error) @@ -1372,7 +1372,7 @@ static void display_help(int error) exit(EXIT_SUCCESS); } -static int use_nanosleep; +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; /* use clock_nanosleep by default. */ static int timermode = TIMER_ABSTIME; static int use_system; static int priority; @@ -1493,6 +1493,7 @@ enum option_values { OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, OPT_WAKEUP, OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS, OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, OPT_TRACEMARK, + OPT_POSIX_TIMERS, }; /* Process commandline options */ @@ -1530,7 +1531,6 @@ static void process_options (int argc, char *argv[], int max_cpus) {"loops", required_argument, NULL, OPT_LOOPS }, {"mlockall", no_argument, NULL, OPT_MLOCKALL }, {"refresh_on_max", no_argument, NULL, OPT_REFRESH }, - {"nanosleep", no_argument, NULL, OPT_NANOSLEEP }, {"nsecs", no_argument, NULL, OPT_NSECS }, {"oscope", required_argument, NULL, OPT_OSCOPE }, {"traceopt", required_argument, NULL, OPT_TRACEOPT }, @@ -1557,9 +1557,10 @@ static void process_options (int argc, char *argv[], int max_cpus) {"dbg_cyclictest", no_argument, NULL, OPT_DBGCYCLIC }, {"policy", required_argument, NULL, OPT_POLICY }, {"help", no_argument, NULL, OPT_HELP }, + {"posix_timers", no_argument, NULL, OPT_POSIX_TIMERS }, {NULL, 0, NULL, 0} }; - int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", + int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MNo:O:p:PmqrRsSt::uUvD:wWT:x", long_options, &option_index); if (c == -1) break; @@ -1651,9 +1652,6 @@ static void process_options (int argc, char *argv[], int max_cpus) case 'M': case OPT_REFRESH: refresh_on_max = 1; break; - case 'n': - case OPT_NANOSLEEP: - use_nanosleep = MODE_CLOCK_NANOSLEEP; break; case 'N': case OPT_NSECS: use_nsecs = 1; break; @@ -1760,6 +1758,9 @@ static void process_options (int argc, char *argv[], int max_cpus) case 'W': case OPT_WAKEUPRT: tracetype = WAKEUPRT; break; + case 'x': + case OPT_POSIX_TIMERS: + use_nanosleep = MODE_CYCLIC; break; case '?': case OPT_HELP: display_help(0); break; -- 2.7.3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-14 19:43 ` Vedang Patel @ 2017-03-23 19:14 ` Henrik Austad 2017-03-24 18:28 ` Patel, Vedang 0 siblings, 1 reply; 9+ messages in thread From: Henrik Austad @ 2017-03-23 19:14 UTC (permalink / raw) To: Vedang Patel; +Cc: williams, jkacur, linux-rt-users [-- Attachment #1: Type: text/plain, Size: 5162 bytes --] On Tue, Mar 14, 2017 at 12:43:48PM -0700, Vedang Patel wrote: > it is recommended that clock_nanosleep should be used for real-time extreme nitpick: Captialize first word in a sentence. > wherever available. So, make sure that cyclictest runs clock_nanosleep > by default. Added an option to run POSIX timers. Removing the '-n' > option because it is redundant now. > > Signed-off-by: Vedang Patel <vedang.patel@intel.com> > --- > src/cyclictest/cyclictest.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c > index 3f1bef1ffca9..cf82f8e1deaa 100644 > --- a/src/cyclictest/cyclictest.c > +++ b/src/cyclictest/cyclictest.c > @@ -1321,7 +1321,6 @@ static void display_help(int error) > "-m --mlockall lock current and future memory allocations\n" > "-M --refresh_on_max delay updating the screen until a new max\n" > " latency is hit. Userful for low bandwidth.\n" > - "-n --nanosleep use clock_nanosleep\n" > " --notrace suppress tracing\n" > "-N --nsecs print results in ns instead of us (default us)\n" > "-o RED --oscope=RED oscilloscope mode, reduce verbose output by RED\n" > @@ -1364,7 +1363,8 @@ static void display_help(int error) > " format: n:c:v n=tasknum c=count v=value in us\n" > "-w --wakeup task wakeup tracing (used with -b)\n" > "-W --wakeuprt rt task wakeup tracing (used with -b)\n" > - " --dbg_cyclictest print info useful for debugging cyclictest\n", > + " --dbg_cyclictest print info useful for debugging cyclictest\n" > + "-x --posix_timers use POSIX timers\n", Since we are now removing all references to clock_nanosleep, perhaps add note here indicating that nanosleep is the default, i.e. something like "use POSIX timers instead of clock_nanosleep" > tracers > ); > if (error) > @@ -1372,7 +1372,7 @@ static void display_help(int error) > exit(EXIT_SUCCESS); > } > > -static int use_nanosleep; > +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; /* use clock_nanosleep by default. */ Not sure if you really need the trailing comment, but I'll leave that up to John (I'd drop it) > static int timermode = TIMER_ABSTIME; > static int use_system; > static int priority; > @@ -1493,6 +1493,7 @@ enum option_values { > OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, OPT_WAKEUP, > OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS, > OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, OPT_TRACEMARK, > + OPT_POSIX_TIMERS, > }; > > /* Process commandline options */ > @@ -1530,7 +1531,6 @@ static void process_options (int argc, char *argv[], int max_cpus) > {"loops", required_argument, NULL, OPT_LOOPS }, > {"mlockall", no_argument, NULL, OPT_MLOCKALL }, > {"refresh_on_max", no_argument, NULL, OPT_REFRESH }, > - {"nanosleep", no_argument, NULL, OPT_NANOSLEEP }, > {"nsecs", no_argument, NULL, OPT_NSECS }, > {"oscope", required_argument, NULL, OPT_OSCOPE }, > {"traceopt", required_argument, NULL, OPT_TRACEOPT }, > @@ -1557,9 +1557,10 @@ static void process_options (int argc, char *argv[], int max_cpus) > {"dbg_cyclictest", no_argument, NULL, OPT_DBGCYCLIC }, > {"policy", required_argument, NULL, OPT_POLICY }, > {"help", no_argument, NULL, OPT_HELP }, > + {"posix_timers", no_argument, NULL, OPT_POSIX_TIMERS }, > {NULL, 0, NULL, 0} > }; > - int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", > + int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MNo:O:p:PmqrRsSt::uUvD:wWT:x", > long_options, &option_index); > if (c == -1) > break; > @@ -1651,9 +1652,6 @@ static void process_options (int argc, char *argv[], int max_cpus) > case 'M': > case OPT_REFRESH: > refresh_on_max = 1; break; > - case 'n': > - case OPT_NANOSLEEP: > - use_nanosleep = MODE_CLOCK_NANOSLEEP; break; > case 'N': > case OPT_NSECS: > use_nsecs = 1; break; > @@ -1760,6 +1758,9 @@ static void process_options (int argc, char *argv[], int max_cpus) > case 'W': > case OPT_WAKEUPRT: > tracetype = WAKEUPRT; break; > + case 'x': > + case OPT_POSIX_TIMERS: > + use_nanosleep = MODE_CYCLIC; break; > case '?': > case OPT_HELP: > display_help(0); break; As a side-observation that does not have anything to do with your patch, it seems like there's a lovely mix of spaces and TABS in this file (i.e. starting a line with a few spaces, then TABs and then possibly more spaces for final alignment). Could be my mailclient pulling my foot though, I just found it a bit strange. > -- > 2.7.3 > A part form my minor nitpicks, nice change! -- Henrik Austad [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 181 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-23 19:14 ` Henrik Austad @ 2017-03-24 18:28 ` Patel, Vedang 2017-03-27 23:07 ` Vedang Patel 0 siblings, 1 reply; 9+ messages in thread From: Patel, Vedang @ 2017-03-24 18:28 UTC (permalink / raw) To: henrik@austad.us Cc: jkacur@redhat.com, linux-rt-users@vger.kernel.org, williams@redhat.com On Thu, 2017-03-23 at 20:14 +0100, Henrik Austad wrote: > On Tue, Mar 14, 2017 at 12:43:48PM -0700, Vedang Patel wrote: > > > > it is recommended that clock_nanosleep should be used for real-time > extreme nitpick: Captialize first word in a sentence. > > > > wherever available. So, make sure that cyclictest runs > > clock_nanosleep > > by default. Added an option to run POSIX timers. Removing the '-n' > > option because it is redundant now. > > > > Signed-off-by: Vedang Patel <vedang.patel@intel.com> > > --- > > src/cyclictest/cyclictest.c | 17 +++++++++-------- > > 1 file changed, 9 insertions(+), 8 deletions(-) > > > > diff --git a/src/cyclictest/cyclictest.c > > b/src/cyclictest/cyclictest.c > > index 3f1bef1ffca9..cf82f8e1deaa 100644 > > --- a/src/cyclictest/cyclictest.c > > +++ b/src/cyclictest/cyclictest.c > > @@ -1321,7 +1321,6 @@ static void display_help(int error) > > "-m --mlockall lock current and future > > memory allocations\n" > > "-M --refresh_on_max delay updating the > > screen until a new max\n" > > " latency is hit. Userful > > for low bandwidth.\n" > > - "-n --nanosleep use clock_nanosleep\n" > > " --notrace suppress tracing\n" > > "-N --nsecs print results in ns > > instead of us (default us)\n" > > "-o RED --oscope=RED oscilloscope mode, > > reduce verbose output by RED\n" > > @@ -1364,7 +1363,8 @@ static void display_help(int error) > > " format: n:c:v n=tasknum > > c=count v=value in us\n" > > "-w --wakeup task wakeup tracing > > (used with -b)\n" > > "-W --wakeuprt rt task wakeup tracing > > (used with -b)\n" > > - " --dbg_cyclictest print info useful for > > debugging cyclictest\n", > > + " --dbg_cyclictest print info useful for > > debugging cyclictest\n" > > + "-x --posix_timers use POSIX timers\n", > Since we are now removing all references to clock_nanosleep, perhaps > add > note here indicating that nanosleep is the default, i.e. something > like > > "use POSIX timers instead of clock_nanosleep" > > > > > tracers > > ); > > if (error) > > @@ -1372,7 +1372,7 @@ static void display_help(int error) > > exit(EXIT_SUCCESS); > > } > > > > -static int use_nanosleep; > > +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; /* use > > clock_nanosleep by default. */ > Not sure if you really need the trailing comment, but I'll leave that > up to > John (I'd drop it) > > > > > static int timermode = TIMER_ABSTIME; > > static int use_system; > > static int priority; > > @@ -1493,6 +1493,7 @@ enum option_values { > > OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, > > OPT_WAKEUP, > > OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, > > OPT_NUMOPTS, > > OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, > > OPT_TRACEMARK, > > + OPT_POSIX_TIMERS, > > }; > > > > /* Process commandline options */ > > @@ -1530,7 +1531,6 @@ static void process_options (int argc, char > > *argv[], int max_cpus) > > {"loops", required_argument, > > NULL, OPT_LOOPS }, > > {"mlockall", no_argument, NU > > LL, OPT_MLOCKALL }, > > {"refresh_on_max", no_argument, NU > > LL, OPT_REFRESH }, > > - {"nanosleep", no_argument, NU > > LL, OPT_NANOSLEEP }, > > {"nsecs", no_argument, NU > > LL, OPT_NSECS }, > > {"oscope", required_argument, > > NULL, OPT_OSCOPE }, > > {"traceopt", required_argument, > > NULL, OPT_TRACEOPT }, > > @@ -1557,9 +1557,10 @@ static void process_options (int argc, char > > *argv[], int max_cpus) > > {"dbg_cyclictest", no_argument, NU > > LL, OPT_DBGCYCLIC }, > > {"policy", required_argument, > > NULL, OPT_POLICY }, > > {"help", no_argument, NU > > LL, OPT_HELP }, > > + {"posix_timers", no_argument, N > > ULL, OPT_POSIX_TIMERS }, > > {NULL, 0, NULL, 0} > > }; > > - int c = getopt_long(argc, argv, > > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", > > + int c = getopt_long(argc, argv, > > "a::A::b:Bc:Cd:D:Efh:H:i:Il:MNo:O:p:PmqrRsSt::uUvD:wWT:x", > > long_options, &option_index); > > if (c == -1) > > break; > > @@ -1651,9 +1652,6 @@ static void process_options (int argc, char > > *argv[], int max_cpus) > > case 'M': > > case OPT_REFRESH: > > refresh_on_max = 1; break; > > - case 'n': > > - case OPT_NANOSLEEP: > > - use_nanosleep = MODE_CLOCK_NANOSLEEP; > > break; > > case 'N': > > case OPT_NSECS: > > use_nsecs = 1; break; > > @@ -1760,6 +1758,9 @@ static void process_options (int argc, char > > *argv[], int max_cpus) > > case 'W': > > case OPT_WAKEUPRT: > > tracetype = WAKEUPRT; break; > > + case 'x': > > + case OPT_POSIX_TIMERS: > > + use_nanosleep = MODE_CYCLIC; break; > > case '?': > > case OPT_HELP: > > display_help(0); break; > As a side-observation that does not have anything to do with your > patch, it > seems like there's a lovely mix of spaces and TABS in this file > (i.e. > starting a line with a few spaces, then TABs and then possibly more > spaces > for final alignment). > > Could be my mailclient pulling my foot though, I just found it a bit > strange. > > > > > -- > > 2.7.3 > > > A part form my minor nitpicks, nice change! Thanks for the review Henrik! I agree with your suggestions. Will make the changes and send out new version of the patch. -Vedang > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-24 18:28 ` Patel, Vedang @ 2017-03-27 23:07 ` Vedang Patel 2017-04-11 14:45 ` John Kacur 0 siblings, 1 reply; 9+ messages in thread From: Vedang Patel @ 2017-03-27 23:07 UTC (permalink / raw) To: jkacur, williams; +Cc: linux-rt-users, Vedang Patel It is recommended that clock_nanosleep should be used for real-time wherever available. So, make sure that cyclictest runs clock_nanosleep by default. Added an option to run POSIX timers. Removing the '-n' option because it is redundant now. Signed-off-by: Vedang Patel <vedang.patel@intel.com> --- src/cyclictest/cyclictest.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 3f1bef1ffca9..0b134410244b 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -1321,7 +1321,6 @@ static void display_help(int error) "-m --mlockall lock current and future memory allocations\n" "-M --refresh_on_max delay updating the screen until a new max\n" " latency is hit. Userful for low bandwidth.\n" - "-n --nanosleep use clock_nanosleep\n" " --notrace suppress tracing\n" "-N --nsecs print results in ns instead of us (default us)\n" "-o RED --oscope=RED oscilloscope mode, reduce verbose output by RED\n" @@ -1364,7 +1363,8 @@ static void display_help(int error) " format: n:c:v n=tasknum c=count v=value in us\n" "-w --wakeup task wakeup tracing (used with -b)\n" "-W --wakeuprt rt task wakeup tracing (used with -b)\n" - " --dbg_cyclictest print info useful for debugging cyclictest\n", + " --dbg_cyclictest print info useful for debugging cyclictest\n" + "-x --posix_timers use POSIX timers instead of clock_nanosleep.\n", tracers ); if (error) @@ -1372,7 +1372,7 @@ static void display_help(int error) exit(EXIT_SUCCESS); } -static int use_nanosleep; +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; static int timermode = TIMER_ABSTIME; static int use_system; static int priority; @@ -1493,6 +1493,7 @@ enum option_values { OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, OPT_WAKEUP, OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS, OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, OPT_TRACEMARK, + OPT_POSIX_TIMERS, }; /* Process commandline options */ @@ -1530,7 +1531,6 @@ static void process_options (int argc, char *argv[], int max_cpus) {"loops", required_argument, NULL, OPT_LOOPS }, {"mlockall", no_argument, NULL, OPT_MLOCKALL }, {"refresh_on_max", no_argument, NULL, OPT_REFRESH }, - {"nanosleep", no_argument, NULL, OPT_NANOSLEEP }, {"nsecs", no_argument, NULL, OPT_NSECS }, {"oscope", required_argument, NULL, OPT_OSCOPE }, {"traceopt", required_argument, NULL, OPT_TRACEOPT }, @@ -1557,9 +1557,10 @@ static void process_options (int argc, char *argv[], int max_cpus) {"dbg_cyclictest", no_argument, NULL, OPT_DBGCYCLIC }, {"policy", required_argument, NULL, OPT_POLICY }, {"help", no_argument, NULL, OPT_HELP }, + {"posix_timers", no_argument, NULL, OPT_POSIX_TIMERS }, {NULL, 0, NULL, 0} }; - int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", + int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MNo:O:p:PmqrRsSt::uUvD:wWT:x", long_options, &option_index); if (c == -1) break; @@ -1651,9 +1652,6 @@ static void process_options (int argc, char *argv[], int max_cpus) case 'M': case OPT_REFRESH: refresh_on_max = 1; break; - case 'n': - case OPT_NANOSLEEP: - use_nanosleep = MODE_CLOCK_NANOSLEEP; break; case 'N': case OPT_NSECS: use_nsecs = 1; break; @@ -1760,6 +1758,9 @@ static void process_options (int argc, char *argv[], int max_cpus) case 'W': case OPT_WAKEUPRT: tracetype = WAKEUPRT; break; + case 'x': + case OPT_POSIX_TIMERS: + use_nanosleep = MODE_CYCLIC; break; case '?': case OPT_HELP: display_help(0); break; -- 2.7.3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers. 2017-03-27 23:07 ` Vedang Patel @ 2017-04-11 14:45 ` John Kacur 0 siblings, 0 replies; 9+ messages in thread From: John Kacur @ 2017-04-11 14:45 UTC (permalink / raw) To: Vedang Patel; +Cc: williams, linux-rt-users On Mon, 27 Mar 2017, Vedang Patel wrote: > It is recommended that clock_nanosleep should be used for real-time > wherever available. So, make sure that cyclictest runs clock_nanosleep > by default. Added an option to run POSIX timers. Removing the '-n' > option because it is redundant now. > > Signed-off-by: Vedang Patel <vedang.patel@intel.com> > --- > src/cyclictest/cyclictest.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c > index 3f1bef1ffca9..0b134410244b 100644 > --- a/src/cyclictest/cyclictest.c > +++ b/src/cyclictest/cyclictest.c > @@ -1321,7 +1321,6 @@ static void display_help(int error) > "-m --mlockall lock current and future memory allocations\n" > "-M --refresh_on_max delay updating the screen until a new max\n" > " latency is hit. Userful for low bandwidth.\n" > - "-n --nanosleep use clock_nanosleep\n" > " --notrace suppress tracing\n" > "-N --nsecs print results in ns instead of us (default us)\n" > "-o RED --oscope=RED oscilloscope mode, reduce verbose output by RED\n" > @@ -1364,7 +1363,8 @@ static void display_help(int error) > " format: n:c:v n=tasknum c=count v=value in us\n" > "-w --wakeup task wakeup tracing (used with -b)\n" > "-W --wakeuprt rt task wakeup tracing (used with -b)\n" > - " --dbg_cyclictest print info useful for debugging cyclictest\n", > + " --dbg_cyclictest print info useful for debugging cyclictest\n" > + "-x --posix_timers use POSIX timers instead of clock_nanosleep.\n", > tracers > ); > if (error) > @@ -1372,7 +1372,7 @@ static void display_help(int error) > exit(EXIT_SUCCESS); > } > > -static int use_nanosleep; > +static int use_nanosleep = MODE_CLOCK_NANOSLEEP; > static int timermode = TIMER_ABSTIME; > static int use_system; > static int priority; > @@ -1493,6 +1493,7 @@ enum option_values { > OPT_TRIGGER_NODES, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, OPT_WAKEUP, > OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS, > OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, OPT_SMI, OPT_TRACEMARK, > + OPT_POSIX_TIMERS, > }; > > /* Process commandline options */ > @@ -1530,7 +1531,6 @@ static void process_options (int argc, char *argv[], int max_cpus) > {"loops", required_argument, NULL, OPT_LOOPS }, > {"mlockall", no_argument, NULL, OPT_MLOCKALL }, > {"refresh_on_max", no_argument, NULL, OPT_REFRESH }, > - {"nanosleep", no_argument, NULL, OPT_NANOSLEEP }, > {"nsecs", no_argument, NULL, OPT_NSECS }, > {"oscope", required_argument, NULL, OPT_OSCOPE }, > {"traceopt", required_argument, NULL, OPT_TRACEOPT }, > @@ -1557,9 +1557,10 @@ static void process_options (int argc, char *argv[], int max_cpus) > {"dbg_cyclictest", no_argument, NULL, OPT_DBGCYCLIC }, > {"policy", required_argument, NULL, OPT_POLICY }, > {"help", no_argument, NULL, OPT_HELP }, > + {"posix_timers", no_argument, NULL, OPT_POSIX_TIMERS }, > {NULL, 0, NULL, 0} > }; > - int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:", > + int c = getopt_long(argc, argv, "a::A::b:Bc:Cd:D:Efh:H:i:Il:MNo:O:p:PmqrRsSt::uUvD:wWT:x", > long_options, &option_index); > if (c == -1) > break; > @@ -1651,9 +1652,6 @@ static void process_options (int argc, char *argv[], int max_cpus) > case 'M': > case OPT_REFRESH: > refresh_on_max = 1; break; > - case 'n': > - case OPT_NANOSLEEP: > - use_nanosleep = MODE_CLOCK_NANOSLEEP; break; > case 'N': > case OPT_NSECS: > use_nsecs = 1; break; > @@ -1760,6 +1758,9 @@ static void process_options (int argc, char *argv[], int max_cpus) > case 'W': > case OPT_WAKEUPRT: > tracetype = WAKEUPRT; break; > + case 'x': > + case OPT_POSIX_TIMERS: > + use_nanosleep = MODE_CYCLIC; break; > case '?': > case OPT_HELP: > display_help(0); break; > -- > 2.7.3 > > -- Applied, thank you John ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-04-11 14:46 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-03-13 17:58 [PATCH] cyclictest: make clock_nanosleep as default and add option for POSIX timers Vedang Patel 2017-03-13 18:00 ` Patel, Vedang 2017-03-14 15:49 ` John Kacur 2017-03-14 18:42 ` Patel, Vedang 2017-03-14 19:43 ` Vedang Patel 2017-03-23 19:14 ` Henrik Austad 2017-03-24 18:28 ` Patel, Vedang 2017-03-27 23:07 ` Vedang Patel 2017-04-11 14:45 ` John Kacur
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox