aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2012-10-29 23:56:02 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-29 09:45:34 -0400
commit70cb4e963f77dae90ae2aa3dd9385a43737c469f (patch)
tree41b94acf8d0f01e93f6c214b9ee1bdae11b41538 /tools/perf/builtin-annotate.c
parentcdd059d731eeb466f51a404ee6cbfafb0fc7c20b (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-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index c4bb6457b19e..cb234765ce3d 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -34,7 +34,6 @@
34 34
35struct perf_annotate { 35struct perf_annotate {
36 struct perf_tool tool; 36 struct perf_tool tool;
37 char const *input_name;
38 bool force, use_tui, use_stdio; 37 bool force, use_tui, use_stdio;
39 bool full_paths; 38 bool full_paths;
40 bool print_line; 39 bool print_line;
@@ -175,7 +174,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
175 struct perf_evsel *pos; 174 struct perf_evsel *pos;
176 u64 total_nr_samples; 175 u64 total_nr_samples;
177 176
178 session = perf_session__new(ann->input_name, O_RDONLY, 177 session = perf_session__new(input_name, O_RDONLY,
179 ann->force, false, &ann->tool); 178 ann->force, false, &ann->tool);
180 if (session == NULL) 179 if (session == NULL)
181 return -ENOMEM; 180 return -ENOMEM;
@@ -260,7 +259,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
260 }, 259 },
261 }; 260 };
262 const struct option options[] = { 261 const struct option options[] = {
263 OPT_STRING('i', "input", &annotate.input_name, "file", 262 OPT_STRING('i', "input", &input_name, "file",
264 "input file name"), 263 "input file name"),
265 OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]", 264 OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]",
266 "only consider symbols in these dsos"), 265 "only consider symbols in these dsos"),