Skip to content

Commit

Permalink
perf diff: Fix usage array, it must end with a NULL entry
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1261161358-23959-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Dec 18, 2009
1 parent b5b60fd commit 0422a4f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/perf/builtin-buildid-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
3 changes: 2 additions & 1 deletion tools/perf/builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ static int __cmd_diff(void)
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[] = {
Expand Down
3 changes: 1 addition & 2 deletions tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ parse_callchain_opt(const struct option *opt __used, const char *arg,
return 0;
}

//static const char * const report_usage[] = {
const char * const report_usage[] = {
static const char * const report_usage[] = {
"perf report [<options>] <command>",
NULL
};
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0422a4f

Please sign in to comment.