linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] fix the broken 'e' command line argument of cyclictest
@ 2014-08-14 17:21 Joakim Hernberg
  2014-08-15 12:38 ` John Kacur
  0 siblings, 1 reply; 2+ messages in thread
From: Joakim Hernberg @ 2014-08-14 17:21 UTC (permalink / raw)
  To: linux-rt-users; +Cc: Clark Williams, John Kacur

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 4547831..c54972b 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1232,7 +1232,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
                        {"help",             no_argument,       NULL, OPT_HELP },
                        {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:e:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:",
                                    long_options, &option_index);
                if (c == -1)
                        break;
@@ -1280,6 +1280,14 @@ static void process_options (int argc, char *argv[], int max_cpus)
                case 'D':
                case OPT_DURATION:
                        duration = parse_time_string(optarg); break;
+               case 'e':
+               case OPT_LATENCY:
+                       /* power management latency target value */
+                       /* note: default is 0 (zero) */
+                       latency_target_value = atoi(optarg);
+                       if (latency_target_value < 0)
+                               latency_target_value = 0;
+                       break;
                case 'E':
                case OPT_EVENT:
                        enable_events = 1; break;
@@ -1421,13 +1429,6 @@ static void process_options (int argc, char *argv[], int max_cpus)
                /* long only options */
                case OPT_PRIOSPREAD:
                        priospread = 1; break;
-               case OPT_LATENCY:
-                          /* power management latency target value */
-                         /* note: default is 0 (zero) */
-                       latency_target_value = atoi(optarg);
-                       if (latency_target_value < 0)
-                               latency_target_value = 0;
-                       break;
                case OPT_NOTRACE:
                        notrace = 1; break;
                case OPT_POLICY:

--

   Joakim

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH] fix the broken 'e' command line argument of cyclictest
  2014-08-14 17:21 [RFC PATCH] fix the broken 'e' command line argument of cyclictest Joakim Hernberg
@ 2014-08-15 12:38 ` John Kacur
  0 siblings, 0 replies; 2+ messages in thread
From: John Kacur @ 2014-08-15 12:38 UTC (permalink / raw)
  To: Joakim Hernberg; +Cc: linux-rt-users, Clark Williams, John Kacur



On Thu, 14 Aug 2014, Joakim Hernberg wrote:

> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 4547831..c54972b 100644
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -1232,7 +1232,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
>                         {"help",             no_argument,       NULL, OPT_HELP },
>                         {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:e:Efh:H:i:Il:MnNo:O:p:PmqrRsSt::uUvD:wWT:",
>                                     long_options, &option_index);
>                 if (c == -1)
>                         break;
> @@ -1280,6 +1280,14 @@ static void process_options (int argc, char *argv[], int max_cpus)
>                 case 'D':
>                 case OPT_DURATION:
>                         duration = parse_time_string(optarg); break;
> +               case 'e':
> +               case OPT_LATENCY:
> +                       /* power management latency target value */
> +                       /* note: default is 0 (zero) */
> +                       latency_target_value = atoi(optarg);
> +                       if (latency_target_value < 0)
> +                               latency_target_value = 0;
> +                       break;
>                 case 'E':
>                 case OPT_EVENT:
>                         enable_events = 1; break;
> @@ -1421,13 +1429,6 @@ static void process_options (int argc, char *argv[], int max_cpus)
>                 /* long only options */
>                 case OPT_PRIOSPREAD:
>                         priospread = 1; break;
> -               case OPT_LATENCY:
> -                          /* power management latency target value */
> -                         /* note: default is 0 (zero) */
> -                       latency_target_value = atoi(optarg);
> -                       if (latency_target_value < 0)
> -                               latency_target_value = 0;
> -                       break;
>                 case OPT_NOTRACE:
>                         notrace = 1; break;
>                 case OPT_POLICY:
> 
> --

As you noticed yourself and mentioned to me on IRC - this patch isn't 
necessary. The problem here is because we tried to removed a bunch of
short options to simplify cyclictest, so the fix is to remove the 
short option from the help instead of trying to put it back. :)
(and I sent a patch that doesn this)

Thanks

John

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-15 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 17:21 [RFC PATCH] fix the broken 'e' command line argument of cyclictest Joakim Hernberg
2014-08-15 12:38 ` John Kacur

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).