perf kmem: Respect -i option
authorJiri Olsa <[email protected]>
Mon, 6 Apr 2015 05:36:08 +0000 (14:36 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 8 Apr 2015 12:07:14 +0000 (09:07 -0300)
Currently the perf kmem does not respect -i option.

Initializing the file.path properly after options get parsed.

Signed-off-by: Jiri Olsa <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-kmem.c

index ac303ef9f2f0938f4264a97a0058c64d8f943868..4ebf65c7943443291db80f3f3cd36aa9f17e85e6 100644 (file)
@@ -663,7 +663,6 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
 {
        const char * const default_sort_order = "frag,hit,bytes";
        struct perf_data_file file = {
-               .path = input_name,
                .mode = PERF_DATA_MODE_READ,
        };
        const struct option kmem_options[] = {
@@ -701,6 +700,8 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)
                return __cmd_record(argc, argv);
        }
 
+       file.path = input_name;
+
        session = perf_session__new(&file, false, &perf_kmem);
        if (session == NULL)
                return -1;