diff options
author | Feng Tang <feng.tang@intel.com> | 2012-10-29 23:56:02 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-29 09:45:34 -0400 |
commit | 70cb4e963f77dae90ae2aa3dd9385a43737c469f (patch) | |
tree | 41b94acf8d0f01e93f6c214b9ee1bdae11b41538 /tools/perf/builtin-buildid-list.c | |
parent | cdd059d731eeb466f51a404ee6cbfafb0fc7c20b (diff) |
perf tools: Add a global variable "const char *input_name"
Currently many perf commands annotate/evlist/report/script/lock etc all
support "-i" option to chose a specific perf data, and all of them
create a local "input_name" to save the file name for that perf data.
Since most of these commands need it, we can add a global variable for
it, also it can some other benefits:
1. When calling script browser inside hists/annotation browser, it needs
to know the perf data file name to run that script.
2. For further feature like runtime switching to another perf data file,
this variable can also help.
Signed-off-by: Feng Tang <feng.tang@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1351569369-26732-2-git-send-email-feng.tang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-buildid-list.c')
-rw-r--r-- | tools/perf/builtin-buildid-list.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index a0e94fffa03e..a82d99fec83e 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c | |||
@@ -44,8 +44,7 @@ static int filename__fprintf_build_id(const char *name, FILE *fp) | |||
44 | return fprintf(fp, "%s\n", sbuild_id); | 44 | return fprintf(fp, "%s\n", sbuild_id); |
45 | } | 45 | } |
46 | 46 | ||
47 | static int perf_session__list_build_ids(const char *input_name, | 47 | static int perf_session__list_build_ids(bool force, bool with_hits) |
48 | bool force, bool with_hits) | ||
49 | { | 48 | { |
50 | struct perf_session *session; | 49 | struct perf_session *session; |
51 | 50 | ||
@@ -81,7 +80,6 @@ int cmd_buildid_list(int argc, const char **argv, | |||
81 | bool show_kernel = false; | 80 | bool show_kernel = false; |
82 | bool with_hits = false; | 81 | bool with_hits = false; |
83 | bool force = false; | 82 | bool force = false; |
84 | const char *input_name = NULL; | ||
85 | const struct option options[] = { | 83 | const struct option options[] = { |
86 | OPT_BOOLEAN('H', "with-hits", &with_hits, "Show only DSOs with hits"), | 84 | OPT_BOOLEAN('H', "with-hits", &with_hits, "Show only DSOs with hits"), |
87 | OPT_STRING('i', "input", &input_name, "file", "input file name"), | 85 | OPT_STRING('i', "input", &input_name, "file", "input file name"), |
@@ -101,5 +99,5 @@ int cmd_buildid_list(int argc, const char **argv, | |||
101 | if (show_kernel) | 99 | if (show_kernel) |
102 | return sysfs__fprintf_build_id(stdout); | 100 | return sysfs__fprintf_build_id(stdout); |
103 | 101 | ||
104 | return perf_session__list_build_ids(input_name, force, with_hits); | 102 | return perf_session__list_build_ids(force, with_hits); |
105 | } | 103 | } |