Hi,
These are a few cleanups around idlestat commandline options while I was working on reformating the report.
Regards, Amit
Amit Kucheria (9): 'verbose' option isn't used anywhere, remove it Sort options in alphabetic order of the single-char options Adding missing 'duration' option in long_options Specify which options need arguments and which don't to help getopt_long() Stick to -d for debug according to widely used convention Make getopt_long handling more robust struct option long_options doesn't need to be global improve help - show all available options idledebug? When did we ever call it that?
README | 7 +++++-- idlestat.c | 71 +++++++++++++++++++++++++++++++++++--------------------------- 2 files changed, 45 insertions(+), 33 deletions(-)
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 3b4bd17..27000aa 100644 --- a/idlestat.c +++ b/idlestat.c @@ -960,7 +960,6 @@ static struct option long_options[] = { { "iterations", 0, 0, 'i' }, { "debug", 0, 0, 'g' }, { "output-file", 0, 0, 'o' }, - { "verbose", 0, 0, 'v' }, { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { 0, 0, 0, 0 } @@ -985,7 +984,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
int optindex = 0;
- c = getopt_long(argc, argv, "gdvVho:i:t:", + c = getopt_long(argc, argv, "gdVho:i:t:", long_options, &optindex); if (c == -1) break;
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
idlestat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 3b4bd17..27000aa 100644 --- a/idlestat.c +++ b/idlestat.c @@ -960,7 +960,6 @@ static struct option long_options[] = { { "iterations", 0, 0, 'i' }, { "debug", 0, 0, 'g' }, { "output-file", 0, 0, 'o' },
- { "verbose", 0, 0, 'v' }, { "version", 0, 0, 'V' }, { "help", 0, 0, 'h' }, { 0, 0, 0, 0 }
@@ -985,7 +984,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
int optindex = 0;
c = getopt_long(argc, argv, "gdvVho:i:t:",
if (c == -1) break;c = getopt_long(argc, argv, "gdVho:i:t:", long_options, &optindex);
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 27000aa..8e3cec0 100644 --- a/idlestat.c +++ b/idlestat.c @@ -957,11 +957,11 @@ static void version(const char *cmd)
static struct option long_options[] = { { "dump", 0, 0, 'd' }, - { "iterations", 0, 0, 'i' }, { "debug", 0, 0, 'g' }, + { "help", 0, 0, 'h' }, + { "iterations", 0, 0, 'i' }, { "output-file", 0, 0, 'o' }, { "version", 0, 0, 'V' }, - { "help", 0, 0, 'h' }, { 0, 0, 0, 0 } };
@@ -969,8 +969,8 @@ struct idledebug_options { bool debug; bool dump; int iterations; - char *filename; unsigned int duration; + char *filename; };
int getoptions(int argc, char *argv[], struct idledebug_options *options) @@ -984,30 +984,30 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
int optindex = 0;
- c = getopt_long(argc, argv, "gdVho:i:t:", + c = getopt_long(argc, argv, "dghi:o:t:V", long_options, &optindex); if (c == -1) break;
switch (c) { + case 'd': + options->dump = true; + break; case 'g': options->debug = true; break; - case 'd': - options->dump = true; + case 'h': + help(argv[0]); + exit(0); break; case 'i': options->iterations = atoi(optarg); break; - case 't': - options->duration = atoi(optarg); - break; case 'o': options->filename = optarg; break; - case 'h': - help(argv[0]); - exit(0); + case 't': + options->duration = atoi(optarg); break; case 'V': version(argv[0]);
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
commit 1e80e5eaf71b606405cbdf6751aa7446533d8b3a (idlestat: get ride of trace-cmd) seems to have missed adding this
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/idlestat.c b/idlestat.c index 8e3cec0..7de9c1d 100644 --- a/idlestat.c +++ b/idlestat.c @@ -961,6 +961,7 @@ static struct option long_options[] = { { "help", 0, 0, 'h' }, { "iterations", 0, 0, 'i' }, { "output-file", 0, 0, 'o' }, + { "duration", 0, 0, 't' }, { "version", 0, 0, 'V' }, { 0, 0, 0, 0 } };
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
commit 1e80e5eaf71b606405cbdf6751aa7446533d8b3a (idlestat: get ride of trace-cmd) seems to have missed adding this
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Good catch.
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 7de9c1d..48e4166 100644 --- a/idlestat.c +++ b/idlestat.c @@ -956,14 +956,14 @@ static void version(const char *cmd) }
static struct option long_options[] = { - { "dump", 0, 0, 'd' }, - { "debug", 0, 0, 'g' }, - { "help", 0, 0, 'h' }, - { "iterations", 0, 0, 'i' }, - { "output-file", 0, 0, 'o' }, - { "duration", 0, 0, 't' }, - { "version", 0, 0, 'V' }, - { 0, 0, 0, 0 } + { "dump", no_argument, 0, 'd' }, + { "debug", no_argument, 0, 'g' }, + { "help", no_argument, 0, 'h' }, + { "iterations", required_argument, 0, 'i' }, + { "output-file", required_argument, 0, 'o' }, + { "duration", required_argument, 0, 't' }, + { "version", no_argument, 0, 'V' }, + { 0, 0, 0, 0 } };
struct idledebug_options {
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
Switch the dump option (which might be used infrequently) to use -m
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 48e4166..a3b9363 100644 --- a/idlestat.c +++ b/idlestat.c @@ -946,7 +946,7 @@ struct cpuidle_cstates *physical_cluster_data(struct cpu_physical *s_phy) static void help(const char *cmd) { fprintf(stderr, - "%s [-d|--dump] [-t <seconds>] -o|--output-file <file>\n", + "%s [-m|--dump] [-t <seconds>] -o|--output-file <file>\n", basename(cmd)); }
@@ -956,10 +956,10 @@ static void version(const char *cmd) }
static struct option long_options[] = { - { "dump", no_argument, 0, 'd' }, - { "debug", no_argument, 0, 'g' }, + { "debug", no_argument, 0, 'd' }, { "help", no_argument, 0, 'h' }, { "iterations", required_argument, 0, 'i' }, + { "dump", no_argument, 0, 'm' }, { "output-file", required_argument, 0, 'o' }, { "duration", required_argument, 0, 't' }, { "version", no_argument, 0, 'V' }, @@ -985,16 +985,13 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
int optindex = 0;
- c = getopt_long(argc, argv, "dghi:o:t:V", + c = getopt_long(argc, argv, "dhi:mo:t:V", long_options, &optindex); if (c == -1) break;
switch (c) { case 'd': - options->dump = true; - break; - case 'g': options->debug = true; break; case 'h': @@ -1004,6 +1001,9 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) case 'i': options->iterations = atoi(optarg); break; + case 'm': + options->dump = true; + break; case 'o': options->filename = optarg; break;
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Switch the dump option (which might be used infrequently) to use -m
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
idlestat.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 48e4166..a3b9363 100644 --- a/idlestat.c +++ b/idlestat.c @@ -946,7 +946,7 @@ struct cpuidle_cstates *physical_cluster_data(struct cpu_physical *s_phy) static void help(const char *cmd) { fprintf(stderr,
"%s [-d|--dump] [-t <seconds>] -o|--output-file <file>\n",
basename(cmd)); }"%s [-m|--dump] [-t <seconds>] -o|--output-file <file>\n",
@@ -956,10 +956,10 @@ static void version(const char *cmd) }
static struct option long_options[] = {
- { "dump", no_argument, 0, 'd' },
- { "debug", no_argument, 0, 'g' },
- { "debug", no_argument, 0, 'd' }, { "help", no_argument, 0, 'h' }, { "iterations", required_argument, 0, 'i' },
- { "dump", no_argument, 0, 'm' }, { "output-file", required_argument, 0, 'o' }, { "duration", required_argument, 0, 't' }, { "version", no_argument, 0, 'V' },
@@ -985,16 +985,13 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
int optindex = 0;
c = getopt_long(argc, argv, "dghi:o:t:V",
c = getopt_long(argc, argv, "dhi:mo:t:V", long_options, &optindex);
if (c == -1) break;
switch (c) { case 'd':
options->dump = true;
break;
case 'h':case 'g': options->debug = true; break;
@@ -1004,6 +1001,9 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) case 'i': options->iterations = atoi(optarg); break;
case 'm':
options->dump = true;
case 'o': options->filename = optarg; break;break;
Adding ':' as first character of optstring to getopt_long allows separating error message for invalid option and invalid option arguments
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/idlestat.c b/idlestat.c index a3b9363..96fc1f2 100644 --- a/idlestat.c +++ b/idlestat.c @@ -985,7 +985,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
int optindex = 0;
- c = getopt_long(argc, argv, "dhi:mo:t:V", + c = getopt_long(argc, argv, ":dhi:mo:t:V", long_options, &optindex); if (c == -1) break; @@ -1014,11 +1014,16 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) version(argv[0]); exit(0); break; - case '?': - fprintf(stderr, "%s: Unknown option %c'.\n", + case 0: /* getopt_long() set a variable, just keep going */ + break; + case ':': /* missing option argument */ + fprintf(stderr, "%s: option `-%c' requires an argument\n", argv[0], optopt); - /* fall through */ + return -1; + case '?': /* invalid option */ default: + fprintf(stderr, "%s: Unknown option `-%c'.\n", + argv[0], optopt); return -1; } } @@ -1027,7 +1032,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) fprintf(stderr, "dump values must be a positive value\n");
if (NULL == options->filename) { - fprintf(stderr, "expected filename\n"); + fprintf(stderr, "expected -o <filename>\n"); return -1; }
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Adding ':' as first character of optstring to getopt_long allows separating error message for invalid option and invalid option arguments
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
idlestat.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/idlestat.c b/idlestat.c index a3b9363..96fc1f2 100644 --- a/idlestat.c +++ b/idlestat.c @@ -985,7 +985,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
int optindex = 0;
c = getopt_long(argc, argv, "dhi:mo:t:V",
if (c == -1) break;c = getopt_long(argc, argv, ":dhi:mo:t:V", long_options, &optindex);
@@ -1014,11 +1014,16 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) version(argv[0]); exit(0); break;
case '?':
fprintf(stderr, "%s: Unknown option %c'.\n",
case 0: /* getopt_long() set a variable, just keep going */
break;
case ':': /* missing option argument */
fprintf(stderr, "%s: option `-%c' requires an argument\n", argv[0], optopt);
/* fall through */
return -1;
default:case '?': /* invalid option */
fprintf(stderr, "%s: Unknown option `-%c'.\n",
} }argv[0], optopt); return -1;
@@ -1027,7 +1032,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) fprintf(stderr, "dump values must be a positive value\n");
if (NULL == options->filename) {
fprintf(stderr, "expected filename\n");
return -1; }fprintf(stderr, "expected -o <filename>\n");
Change the flag field to NULL while we're at it
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 96fc1f2..c4a405a 100644 --- a/idlestat.c +++ b/idlestat.c @@ -955,17 +955,6 @@ static void version(const char *cmd) printf("%s version %s\n", basename(cmd), IDLESTAT_VERSION); }
-static struct option long_options[] = { - { "debug", no_argument, 0, 'd' }, - { "help", no_argument, 0, 'h' }, - { "iterations", required_argument, 0, 'i' }, - { "dump", no_argument, 0, 'm' }, - { "output-file", required_argument, 0, 'o' }, - { "duration", required_argument, 0, 't' }, - { "version", no_argument, 0, 'V' }, - { 0, 0, 0, 0 } -}; - struct idledebug_options { bool debug; bool dump; @@ -983,6 +972,16 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
while (1) {
+ static struct option long_options[] = { + { "debug", no_argument, NULL, 'd' }, + { "help", no_argument, NULL, 'h' }, + { "iterations", required_argument, NULL, 'i' }, + { "dump", no_argument, NULL, 'm' }, + { "output-file", required_argument, NULL, 'o' }, + { "duration", required_argument, NULL, 't' }, + { "version", no_argument, NULL, 'V' }, + { 0, 0, 0, 0 } + }; int optindex = 0;
c = getopt_long(argc, argv, ":dhi:mo:t:V",
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Change the flag field to NULL while we're at it
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
idlestat.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 96fc1f2..c4a405a 100644 --- a/idlestat.c +++ b/idlestat.c @@ -955,17 +955,6 @@ static void version(const char *cmd) printf("%s version %s\n", basename(cmd), IDLESTAT_VERSION); }
-static struct option long_options[] = {
- { "debug", no_argument, 0, 'd' },
- { "help", no_argument, 0, 'h' },
- { "iterations", required_argument, 0, 'i' },
- { "dump", no_argument, 0, 'm' },
- { "output-file", required_argument, 0, 'o' },
- { "duration", required_argument, 0, 't' },
- { "version", no_argument, 0, 'V' },
- { 0, 0, 0, 0 }
-};
- struct idledebug_options { bool debug; bool dump;
@@ -983,6 +972,16 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
while (1) {
static struct option long_options[] = {
{ "debug", no_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ "iterations", required_argument, NULL, 'i' },
{ "dump", no_argument, NULL, 'm' },
{ "output-file", required_argument, NULL, 'o' },
{ "duration", required_argument, NULL, 't' },
{ "version", no_argument, NULL, 'V' },
{ 0, 0, 0, 0 }
};
Why not move this declaration at the beginning of the function and remove the 'static' ?
int optindex = 0; c = getopt_long(argc, argv, ":dhi:mo:t:V",
Thank for the review. I've made the requested change and pushed all these fixes with your Ack.
On Fri, May 30, 2014 at 1:13 PM, Daniel Lezcano daniel.lezcano@linaro.org wrote:
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Change the flag field to NULL while we're at it
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
idlestat.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 96fc1f2..c4a405a 100644 --- a/idlestat.c +++ b/idlestat.c @@ -955,17 +955,6 @@ static void version(const char *cmd) printf("%s version %s\n", basename(cmd), IDLESTAT_VERSION); }
-static struct option long_options[] = {
{ "debug", no_argument, 0, 'd' },
{ "help", no_argument, 0, 'h' },
{ "iterations", required_argument, 0, 'i' },
{ "dump", no_argument, 0, 'm' },
{ "output-file", required_argument, 0, 'o' },
{ "duration", required_argument, 0, 't' },
{ "version", no_argument, 0, 'V' },
{ 0, 0, 0, 0 }
-};
- struct idledebug_options { bool debug; bool dump;
@@ -983,6 +972,16 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options)
while (1) {
static struct option long_options[] = {
{ "debug", no_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ "iterations", required_argument, NULL, 'i' },
{ "dump", no_argument, NULL, 'm' },
{ "output-file", required_argument, NULL, 'o' },
{ "duration", required_argument, NULL, 't' },
{ "version", no_argument, NULL, 'V' },
{ 0, 0, 0, 0 }
};
Why not move this declaration at the beginning of the function and remove the 'static' ?
int optindex = 0; c = getopt_long(argc, argv, ":dhi:mo:t:V",
-- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- README | 7 +++++-- idlestat.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/README b/README index 3a8eb49..24485c5 100644 --- a/README +++ b/README @@ -28,14 +28,17 @@ Requirements 1. It must be run as root in order to access /sys/kernel/debug. 2. It requires tracing to be enabled in the kernel
+Help +---- +./idlestat -h will show all the options + Example Usage -------------
-./idlestat -d -o myoutput -t 10 +./idlestat -o /tmp/myoutput -t 10
where,
--d : dump the states at the end -o : output file to store the traces -t : the duration in seconds
diff --git a/idlestat.c b/idlestat.c index c4a405a..849b6dd 100644 --- a/idlestat.c +++ b/idlestat.c @@ -946,8 +946,12 @@ struct cpuidle_cstates *physical_cluster_data(struct cpu_physical *s_phy) static void help(const char *cmd) { fprintf(stderr, - "%s [-m|--dump] [-t <seconds>] -o|--output-file <file>\n", + "\nUsage:\n%s -o|--output-file <file> [-m|--dump]" + " [-t|--duration <seconds>] [-i|--iterations <number>]" + " [-d|--debug]\n", basename(cmd)); + fprintf(stderr, + "\nExample:\n%s -o /tmp/myoutput -t 30\n", basename(cmd)); }
static void version(const char *cmd) @@ -1017,12 +1021,13 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) break; case ':': /* missing option argument */ fprintf(stderr, "%s: option `-%c' requires an argument\n", - argv[0], optopt); + basename(argv[0]), optopt); return -1; case '?': /* invalid option */ default: fprintf(stderr, "%s: Unknown option `-%c'.\n", - argv[0], optopt); + basename(argv[0]), optopt); + help(argv[0]); return -1; } }
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
README | 7 +++++-- idlestat.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/README b/README index 3a8eb49..24485c5 100644 --- a/README +++ b/README @@ -28,14 +28,17 @@ Requirements
- It must be run as root in order to access /sys/kernel/debug.
- It requires tracing to be enabled in the kernel
+Help +---- +./idlestat -h will show all the options
Example Usage
-./idlestat -d -o myoutput -t 10 +./idlestat -o /tmp/myoutput -t 10
where,
--d : dump the states at the end -o : output file to store the traces -t : the duration in seconds
diff --git a/idlestat.c b/idlestat.c index c4a405a..849b6dd 100644 --- a/idlestat.c +++ b/idlestat.c @@ -946,8 +946,12 @@ struct cpuidle_cstates *physical_cluster_data(struct cpu_physical *s_phy) static void help(const char *cmd) { fprintf(stderr,
"%s [-m|--dump] [-t <seconds>] -o|--output-file <file>\n",
"\nUsage:\n%s -o|--output-file <file> [-m|--dump]"
" [-t|--duration <seconds>] [-i|--iterations <number>]"
" [-d|--debug]\n",
basename(cmd));
fprintf(stderr,
"\nExample:\n%s -o /tmp/myoutput -t 30\n", basename(cmd));
}
static void version(const char *cmd)
@@ -1017,12 +1021,13 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) break; case ':': /* missing option argument */ fprintf(stderr, "%s: option `-%c' requires an argument\n",
argv[0], optopt);
case '?': /* invalid option */ default: fprintf(stderr, "%s: Unknown option `-%c'.\n",basename(argv[0]), optopt); return -1;
argv[0], optopt);
basename(argv[0]), optopt);
} }help(argv[0]); return -1;
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org --- idlestat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 849b6dd..00b2032 100644 --- a/idlestat.c +++ b/idlestat.c @@ -959,7 +959,7 @@ static void version(const char *cmd) printf("%s version %s\n", basename(cmd), IDLESTAT_VERSION); }
-struct idledebug_options { +struct program_options { bool debug; bool dump; int iterations; @@ -967,7 +967,7 @@ struct idledebug_options { char *filename; };
-int getoptions(int argc, char *argv[], struct idledebug_options *options) +int getoptions(int argc, char *argv[], struct program_options *options) { int c;
@@ -1135,7 +1135,7 @@ static void sighandler(int sig) }
static int execute(int argc, char *argv[], char *const envp[], - struct idledebug_options *options) + struct program_options *options) { pid_t pid; int status; @@ -1192,7 +1192,7 @@ int main(int argc, char *argv[], char *const envp[]) { struct cpuidle_datas *datas; struct cpuidle_datas *cluster; - struct idledebug_options options; + struct program_options options; struct rusage rusage; int args;
On 05/29/2014 12:17 AM, Amit Kucheria wrote:
Signed-off-by: Amit Kucheria amit.kucheria@linaro.org
Yep, powerdebug => idledebug => idlestat :)
Legacy copy/paste from powerdebug.
Acked-by: Daniel Lezcano daniel.lezcano@linaro.org
idlestat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/idlestat.c b/idlestat.c index 849b6dd..00b2032 100644 --- a/idlestat.c +++ b/idlestat.c @@ -959,7 +959,7 @@ static void version(const char *cmd) printf("%s version %s\n", basename(cmd), IDLESTAT_VERSION); }
-struct idledebug_options { +struct program_options { bool debug; bool dump; int iterations; @@ -967,7 +967,7 @@ struct idledebug_options { char *filename; };
-int getoptions(int argc, char *argv[], struct idledebug_options *options) +int getoptions(int argc, char *argv[], struct program_options *options) { int c;
@@ -1135,7 +1135,7 @@ static void sighandler(int sig) }
static int execute(int argc, char *argv[], char *const envp[],
struct idledebug_options *options)
{ pid_t pid; int status;struct program_options *options)
@@ -1192,7 +1192,7 @@ int main(int argc, char *argv[], char *const envp[]) { struct cpuidle_datas *datas; struct cpuidle_datas *cluster;
- struct idledebug_options options;
- struct program_options options; struct rusage rusage; int args;