diff options
author | David Ahern <dsahern@gmail.com> | 2013-10-30 12:15:06 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-05 12:25:26 -0500 |
commit | 8e00ddc9dfe09ee131144fdaf6c96ebe95bbbbcb (patch) | |
tree | 01e79dbe4b5a7ea998f5f3c5a1e38d2bf63b1006 /tools | |
parent | 5febff0066b8111785d58903b54d414e9ec6a3d0 (diff) |
perf list: Remove a level of indentation
With a return after the if check an indentation level can be removed.
Indentation shift only; no functional changes.
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1383149707-1008-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-list.c | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c index e79f423cc302..45000e7d4398 100644 --- a/tools/perf/builtin-list.c +++ b/tools/perf/builtin-list.c | |||
@@ -17,48 +17,49 @@ | |||
17 | 17 | ||
18 | int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) | 18 | int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) |
19 | { | 19 | { |
20 | int i; | ||
21 | |||
20 | setup_pager(); | 22 | setup_pager(); |
21 | 23 | ||
22 | if (argc == 1) | 24 | if (argc == 1) { |
23 | print_events(NULL, false); | 25 | print_events(NULL, false); |
24 | else { | 26 | return 0; |
25 | int i; | 27 | } |
26 | |||
27 | for (i = 1; i < argc; ++i) { | ||
28 | if (i > 2) | ||
29 | putchar('\n'); | ||
30 | if (strncmp(argv[i], "tracepoint", 10) == 0) | ||
31 | print_tracepoint_events(NULL, NULL, false); | ||
32 | else if (strcmp(argv[i], "hw") == 0 || | ||
33 | strcmp(argv[i], "hardware") == 0) | ||
34 | print_events_type(PERF_TYPE_HARDWARE); | ||
35 | else if (strcmp(argv[i], "sw") == 0 || | ||
36 | strcmp(argv[i], "software") == 0) | ||
37 | print_events_type(PERF_TYPE_SOFTWARE); | ||
38 | else if (strcmp(argv[i], "cache") == 0 || | ||
39 | strcmp(argv[i], "hwcache") == 0) | ||
40 | print_hwcache_events(NULL, false); | ||
41 | else if (strcmp(argv[i], "pmu") == 0) | ||
42 | print_pmu_events(NULL, false); | ||
43 | else if (strcmp(argv[i], "--raw-dump") == 0) | ||
44 | print_events(NULL, true); | ||
45 | else { | ||
46 | char *sep = strchr(argv[i], ':'), *s; | ||
47 | int sep_idx; | ||
48 | 28 | ||
49 | if (sep == NULL) { | 29 | for (i = 1; i < argc; ++i) { |
50 | print_events(argv[i], false); | 30 | if (i > 2) |
51 | continue; | 31 | putchar('\n'); |
52 | } | 32 | if (strncmp(argv[i], "tracepoint", 10) == 0) |
53 | sep_idx = sep - argv[i]; | 33 | print_tracepoint_events(NULL, NULL, false); |
54 | s = strdup(argv[i]); | 34 | else if (strcmp(argv[i], "hw") == 0 || |
55 | if (s == NULL) | 35 | strcmp(argv[i], "hardware") == 0) |
56 | return -1; | 36 | print_events_type(PERF_TYPE_HARDWARE); |
37 | else if (strcmp(argv[i], "sw") == 0 || | ||
38 | strcmp(argv[i], "software") == 0) | ||
39 | print_events_type(PERF_TYPE_SOFTWARE); | ||
40 | else if (strcmp(argv[i], "cache") == 0 || | ||
41 | strcmp(argv[i], "hwcache") == 0) | ||
42 | print_hwcache_events(NULL, false); | ||
43 | else if (strcmp(argv[i], "pmu") == 0) | ||
44 | print_pmu_events(NULL, false); | ||
45 | else if (strcmp(argv[i], "--raw-dump") == 0) | ||
46 | print_events(NULL, true); | ||
47 | else { | ||
48 | char *sep = strchr(argv[i], ':'), *s; | ||
49 | int sep_idx; | ||
57 | 50 | ||
58 | s[sep_idx] = '\0'; | 51 | if (sep == NULL) { |
59 | print_tracepoint_events(s, s + sep_idx + 1, false); | 52 | print_events(argv[i], false); |
60 | free(s); | 53 | continue; |
61 | } | 54 | } |
55 | sep_idx = sep - argv[i]; | ||
56 | s = strdup(argv[i]); | ||
57 | if (s == NULL) | ||
58 | return -1; | ||
59 | |||
60 | s[sep_idx] = '\0'; | ||
61 | print_tracepoint_events(s, s + sep_idx + 1, false); | ||
62 | free(s); | ||
62 | } | 63 | } |
63 | } | 64 | } |
64 | return 0; | 65 | return 0; |