diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-01 14:20:58 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-02 17:36:39 -0400 |
commit | 94d668d0732d469e3237da0990b3512dc0f23d09 (patch) | |
tree | 79fc946a3c6b7ffd8cba4695df2af5d79ce1ea67 /tools | |
parent | be77284226374c75583f36dbbf43203039f6a44c (diff) |
perf evlist: Don't use globals where not needed to
Some variables were global but used in just one function, so move it to
where it belongs.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-p80wec3z0vafe8dd0kz6ynyz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-evlist.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index 1fb164164fd0..997afb82691b 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c | |||
@@ -108,23 +108,20 @@ static int __cmd_evlist(const char *input_name, struct perf_attr_details *detail | |||
108 | return 0; | 108 | return 0; |
109 | } | 109 | } |
110 | 110 | ||
111 | static const char * const evlist_usage[] = { | ||
112 | "perf evlist [<options>]", | ||
113 | NULL | ||
114 | }; | ||
115 | |||
116 | int cmd_evlist(int argc, const char **argv, const char *prefix __maybe_unused) | 111 | int cmd_evlist(int argc, const char **argv, const char *prefix __maybe_unused) |
117 | { | 112 | { |
118 | struct perf_attr_details details = { .verbose = false, }; | 113 | struct perf_attr_details details = { .verbose = false, }; |
119 | const char *input_name = NULL; | 114 | const char *input_name = NULL; |
120 | const struct option options[] = { | 115 | const struct option options[] = { |
121 | OPT_STRING('i', "input", &input_name, "file", | 116 | OPT_STRING('i', "input", &input_name, "file", "Input file name"), |
122 | "Input file name"), | 117 | OPT_BOOLEAN('F', "freq", &details.freq, "Show the sample frequency"), |
123 | OPT_BOOLEAN('F', "freq", &details.freq, | 118 | OPT_BOOLEAN('v', "verbose", &details.verbose, |
124 | "Show the sample frequency"), | 119 | "Show all event attr details"), |
125 | OPT_BOOLEAN('v', "verbose", &details.verbose, | 120 | OPT_END() |
126 | "Show all event attr details"), | 121 | }; |
127 | OPT_END() | 122 | const char * const evlist_usage[] = { |
123 | "perf evlist [<options>]", | ||
124 | NULL | ||
128 | }; | 125 | }; |
129 | 126 | ||
130 | argc = parse_options(argc, argv, options, evlist_usage, 0); | 127 | argc = parse_options(argc, argv, options, evlist_usage, 0); |