mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 03/15] perf evsel: Remove symbol_conf usage
Date: Fri, 15 Apr 2016 18:50:49 -0300	[thread overview]
Message-ID: <1460757061-3283-4-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1460757061-3283-1-git-send-email-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

  # 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>
---
 tools/perf/builtin-script.c | 2 ++
 tools/perf/util/evsel.c     | 6 +++---
 tools/perf/util/evsel.h     | 4 ++--
 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,
 			}
 		}
 		perf_evsel__fprintf_sym(evsel, sample, al, 0, print_opts,
+					symbol_conf.use_callchain,
 					scripting_max_stack, stdout);
 	}
 
@@ -790,6 +791,7 @@ static void process_event(struct perf_script *script,
 
 		perf_evsel__fprintf_sym(evsel, sample, al, 0,
 					output[attr->type].print_ip_opts,
+					symbol_conf.use_callchain,
 					scripting_max_stack, stdout);
 	}
 
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:
 
 int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample,
 			    struct addr_location *al, int left_alignment,
-			    unsigned int print_opts, unsigned int stack_depth,
-			    FILE *fp)
+			    unsigned int print_opts, bool print_callchain,
+			    unsigned int stack_depth, FILE *fp)
 {
 	int printed = 0;
 	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
 	int print_srcline = print_opts & EVSEL__PRINT_SRCLINE;
 	int print_unknown_as_addr = print_opts & EVSEL__PRINT_UNKNOWN_AS_ADDR;
 
-	if (symbol_conf.use_callchain && sample->callchain) {
+	if (print_callchain && sample->callchain) {
 		printed += perf_evsel__fprintf_callchain(evsel, sample, al, left_alignment,
 							 print_opts, stack_depth, fp);
 	} 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,
 
 int perf_evsel__fprintf_sym(struct perf_evsel *evsel, struct perf_sample *sample,
 			    struct addr_location *al, int left_alignment,
-			    unsigned int print_opts, unsigned int stack_depth,
-			    FILE *fp);
+			    unsigned int print_opts, bool print_callchain,
+			    unsigned int stack_depth, FILE *fp);
 
 bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
 			  char *msg, size_t msgsize);
-- 
2.5.5

  parent reply	other threads:[~2016-04-15 21:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 21:50 [GIT PULL 00/15] perf/core improvements Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 01/15] perf trace: Move socket_type beautifier to tools/perf/trace/beauty/ Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 02/15] perf callchain: Start moving away from global per thread cursors Arnaldo Carvalho de Melo
2016-04-15 21:50 ` Arnaldo Carvalho de Melo [this message]
2016-04-15 21:50 ` [PATCH 04/15] perf symbols: Move fprintf routines to separate object file Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 05/15] perf evsel: Require that callchains be resolved before calling fprintf_{sym,callchain} Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 06/15] perf tools: Remove addr_location argument to sample__fprintf_callchain Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 07/15] perf script: Add --max-stack knob Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 08/15] perf trace: " Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 09/15] perf evsel: Move fprintf methods to separate source file Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 10/15] perf trace: Do not print interrupted syscalls when using --duration Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 11/15] perf trace: Introduce --min-stack filter Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 12/15] perf record: Export record_opts based callchain parsing helper Arnaldo Carvalho de Melo
2016-04-15 21:50 ` [PATCH 13/15] perf trace: Make --(min,max}-stack imply "--call-graph dwarf" Arnaldo Carvalho de Melo
2016-04-15 21:51 ` [PATCH 14/15] perf evlist: Expose perf_event_mlock_kb_in_pages() helper Arnaldo Carvalho de Melo
2016-04-15 21:51 ` [PATCH 15/15] perf trace: Bump --mmap-pages when --call-graph is used by the root user Arnaldo Carvalho de Melo
2016-04-16  9:12 ` [GIT PULL 00/15] perf/core improvements Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460757061-3283-4-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome