Skip to contentSkip to conversation

fix the broken 'e' command line argument of cyclictest

RFC PATCH In review Joakim Hernberg 2 participants 2 messages Aug 14, 2014 – Aug 15, 2014

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 fix the broken 'e' command line argument of cyclictest

src/cyclictest/cyclictest.c +9 -8
index 4547831..c54972b 100644
@@ -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

#1 lore raw
Quoted 34 lines · Joakim Hernberg
src/cyclictest/cyclictest.c +9 -3
index 4547831..c54972b 100644
@@ -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 */

src/cyclictest/cyclictest.c static void process_options (int argc, char *argv[], int max_cpus)

Quoted 10 lines
src/cyclictest/cyclictest.c +0 -6
-                         /* 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