[PATCH] perf list: Fix raw-dump arg

From: David Ahern
Date: Wed Dec 11 2013 - 16:00:20 EST


Ramkumar reported that perf list --raw-dump was broken by 44d742e.
Fix by making raw-dump a proper argument.

Signed-off-by: David Ahern <dsahern@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Ramkumar Ramachandra <artagnon@xxxxxxxxx>
---
tools/perf/builtin-list.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 011195e38f21..b553d0c4ca82 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -19,7 +19,9 @@
int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
{
int i;
+ bool raw_dump = false;
const struct option list_options[] = {
+ OPT_BOOLEAN(0, "raw-dump", &raw_dump, "raw dump for completion"),
OPT_END()
};
const char * const list_usage[] = {
@@ -36,6 +38,10 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
print_events(NULL, false);
return 0;
}
+ if (raw_dump) {
+ print_events(NULL, true);
+ return 0;
+ }

for (i = 0; i < argc; ++i) {
if (i)
@@ -53,8 +59,6 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
print_hwcache_events(NULL, false);
else if (strcmp(argv[i], "pmu") == 0)
print_pmu_events(NULL, false);
- else if (strcmp(argv[i], "--raw-dump") == 0)
- print_events(NULL, true);
else {
char *sep = strchr(argv[i], ':'), *s;
int sep_idx;
--
1.8.3.4 (Apple Git-47)


--------------080000000604010104080007--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/