aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-04-14 13:56:06 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-14 13:56:06 -0400
commitde446b40d5ddb2c3f1fe453ac405543663f9ac5d (patch)
tree8596b0b8376fe159dfb4973dd950d28f6f235799
parent91d7b2de318ff701451dfc7ede1c029b150ef0e9 (diff)
perf evsel: Remove symbol_conf usage
# perf test -v python 16: Try 'import perf' in python, checking link problems : --- start --- test child forked, pid 672 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /tmp/build/perf/python/perf.so: undefined symbol: symbol_conf test child finished with -1 ---- end ---- Try 'import perf' in python, checking link problems: FAILED! # To fix it just pass a parameter to perf_evsel__fprintf_sym telling if callchains should be printed. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-comrsr20bsnr8bg0n6rfwv12@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-script.c2
-rw-r--r--tools/perf/util/evsel.c6
-rw-r--r--tools/perf/util/evsel.h4
3 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 838c0bc38105..717ba0215234 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -580,6 +580,7 @@ static void print_sample_bts(struct perf_sample *sample,
580 } 580 }
581 } 581 }
582 perf_evsel__fprintf_sym(evsel, sample, al, 0, print_opts, 582 perf_evsel__fprintf_sym(evsel, sample, al, 0, print_opts,
583 symbol_conf.use_callchain,
583 scripting_max_stack, stdout); 584 scripting_max_stack, stdout);
584 } 585 }
585 586
@@ -790,6 +791,7 @@ static void process_event(struct perf_script *script,
790 791
791 perf_evsel__fprintf_sym(evsel, sample, al, 0, 792 perf_evsel__fprintf_sym(evsel, sample, al, 0,
792 output[attr->type].print_ip_opts, 793 output[attr->type].print_ip_opts,
794 symbol_conf.use_callchain,
793 scripting_max_stack, stdout); 795 scripting_max_stack, stdout);
794 } 796 }
795 797
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 38f464a4fa04..60bba67e6959 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2430,8 +2430,8 @@ next:
2430 2430
2431int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample, 2431int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample,
2432 struct addr_location *al, int left_alignment, 2432 struct addr_location *al, int left_alignment,
2433 unsigned int print_opts, unsigned int stack_depth, 2433 unsigned int print_opts, bool print_callchain,
2434 FILE *fp) 2434 unsigned int stack_depth, FILE *fp)
2435{ 2435{
2436 int printed = 0; 2436 int printed = 0;
2437 int print_ip = print_opts & EVSEL__PRINT_IP; 2437 int print_ip = print_opts & EVSEL__PRINT_IP;
@@ -2441,7 +2441,7 @@ int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample
2441 int print_srcline = print_opts & EVSEL__PRINT_SRCLINE; 2441 int print_srcline = print_opts & EVSEL__PRINT_SRCLINE;
2442 int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR; 2442 int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR;
2443 2443
2444 if (symbol_conf.use_callchain && sample->callchain) { 2444 if (print_callchain && sample->callchain) {
2445 printed += perf_evsel__fprintf_callchain(evsel, sample, al, left_alignment, 2445 printed += perf_evsel__fprintf_callchain(evsel, sample, al, left_alignment,
2446 print_opts, stack_depth, fp); 2446 print_opts, stack_depth, fp);
2447 } else if (!(al->sym && al->sym->ignore)) { 2447 } else if (!(al->sym && al->sym->ignore)) {
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 36edd3c91d5c..013f3615730b 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -403,8 +403,8 @@ int perf_evsel__fprintf_callchain(struct perf_evsel *evsel,
403 403
404int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample, 404int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample,
405 struct addr_location *al, int left_alignment, 405 struct addr_location *al, int left_alignment,
406 unsigned int print_opts, unsigned int stack_depth, 406 unsigned int print_opts, bool print_callchain,
407 FILE *fp); 407 unsigned int stack_depth, FILE *fp);
408 408
409bool perf_evsel__fallback(struct perf_evsel *evsel, int err, 409bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
410 char *msg, size_t msgsize); 410 char *msg, size_t msgsize);