perf diff: Fix usage array, it must end with a NULL entry
PATCH v2 1/1 perf diff: Fix usage array, it must end with a NULL entry
From: Arnaldo Carvalho de Melo <[email protected]>
Fixing this:
[acme@doppio linux-2.6-tip]$ perf diff --hell
Error: unknown option `hell'
usage: perf diff [<options>] [old_file] [new_file]
Segmentation fault
[acme@doppio linux-2.6-tip]$
Also go over the other such arrays to check if they all were OK, they are, but there were some minor changes to do like making one static and renaming another to match the command it refers to.
--- tools/perf/builtin-buildid-list.c | 2 +- tools/perf/builtin-diff.c | 3 ++- tools/perf/builtin-report.c | 3 +-- tools/perf/builtin-trace.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/builtin-buildid-list.c +1 -1
@@ -17,7 +17,7 @@static char const *input_name ="perf.data" ;static int force; -static const char *const buildid_list_usage[] = { +static const char *const buildid_list_usage[] = {"perf buildid-list [<options>]" ,NULL };
tools/perf/builtin-diff.c +2 -1
@@ -189,8 +189,9 @@ out_delete:return ret; } -static const char *const diff_usage[] = { +static const char *const diff_usage[] = {"perf diff [<options>] [old_file] [new_file]" , +NULL , };static const struct option options[] = {
tools/perf/builtin-report.c +1 -2
@@ -294,8 +294,7 @@ setup:return 0 ; } -//static const char * const report_usage[] = { -const char *const report_usage[] = { +static const char *const report_usage[] = {"perf report [<options>] <command>" ,NULL };
tools/perf/builtin-trace.c +2 -2
@@ -512,7 +512,7 @@ static char *get_script_path(const char *script_root, const char *suffix)return path; } -static const char *const annotate_usage[] = { +static const char *const trace_usage[] = {"perf trace [<options>] <command>" ,NULL };
@@ -581,7 +581,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)setup_scripting (); - argc =parse_options (argc, argv, options, annotate_usage, + argc =parse_options (argc, argv, options, trace_usage,PARSE_OPT_STOP_AT_NON_OPTION );if (symbol__init () <0 )
Signature · 1 line
1.6.2.5
Commit-ID: 0422a4fc2c6a41c3d4184984797512af2650014e Gitweb: http://git.kernel.org/tip/0422a4fc2c6a41c3d4184984797512af2650014e Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Fri, 18 Dec 2009 16:35:58 -0200 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 18 Dec 2009 20:01:52 +0100
perf diff: Fix usage array, it must end with a NULL entry
Fixing this:
[acme@doppio linux-2.6-tip]$ perf diff --hell
Error: unknown option `hell'
usage: perf diff [<options>] [old_file] [new_file]
Segmentation fault
[acme@doppio linux-2.6-tip]$
Also go over the other such arrays to check if they all were OK, they are, but there were some minor changes to do like making one static and renaming another to match the command it refers to.
LKML-Reference: <[email protected]>
--- tools/perf/builtin-buildid-list.c | 2 +- tools/perf/builtin-diff.c | 3 ++- tools/perf/builtin-report.c | 3 +-- tools/perf/builtin-trace.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)
tools/perf/builtin-buildid-list.c +1 -1
@@ -17,7 +17,7 @@static char const *input_name ="perf.data" ;static int force; -static const char *const buildid_list_usage[] = { +static const char *const buildid_list_usage[] = {"perf buildid-list [<options>]" ,NULL };
tools/perf/builtin-diff.c +2 -1
@@ -189,8 +189,9 @@ out_delete:return ret; } -static const char *const diff_usage[] = { +static const char *const diff_usage[] = {"perf diff [<options>] [old_file] [new_file]" , +NULL , };static const struct option options[] = {
tools/perf/builtin-report.c +1 -2
@@ -294,8 +294,7 @@ setup:return 0 ; } -//static const char * const report_usage[] = { -const char *const report_usage[] = { +static const char *const report_usage[] = {"perf report [<options>] <command>" ,NULL };
tools/perf/builtin-trace.c +2 -2
@@ -512,7 +512,7 @@ static char *get_script_path(const char *script_root, const char *suffix)return path; } -static const char *const annotate_usage[] = { +static const char *const trace_usage[] = {"perf trace [<options>] <command>" ,NULL };
@@ -581,7 +581,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)setup_scripting (); - argc =parse_options (argc, argv, options, annotate_usage, + argc =parse_options (argc, argv, options, trace_usage,PARSE_OPT_STOP_AT_NON_OPTION );if (symbol__init () <0 )