All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mathieu.poirier@linaro.org, hpa@zytor.com, mingo@kernel.org,
	linux-kernel@vger.kernel.org, jolsa@redhat.com,
	mhiramat@kernel.org, adrian.hunter@intel.com, tglx@linutronix.de,
	acme@redhat.com
Subject: [tip:perf/core] perf auxtrace: Alter addr_filter__entire_dso() to work if there are no symbols
Date: Thu, 20 Dec 2018 09:58:29 -0800	[thread overview]
Message-ID: <tip-571766010ea6bf9726b288eb2db1abb59b1841af@git.kernel.org> (raw)
In-Reply-To: <20181127084634.12469-1-adrian.hunter@intel.com>

Commit-ID:  571766010ea6bf9726b288eb2db1abb59b1841af
Gitweb:     https://git.kernel.org/tip/571766010ea6bf9726b288eb2db1abb59b1841af
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Tue, 27 Nov 2018 10:46:34 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 18 Dec 2018 12:21:44 -0300

perf auxtrace: Alter addr_filter__entire_dso() to work if there are no symbols

addr_filter__entire_dso() uses the first and last symbols from a dso,
and so does not work when there are no symbols.  Alter it to filter the
whole file instead.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Fixes: 1b36c03e3569 ("perf record: Add support for using symbols in address filters")
Link: http://lkml.kernel.org/r/20181127084634.12469-1-adrian.hunter@intel.com
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/auxtrace.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 72d5ba2479bf..f69961c4a4f3 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -1983,17 +1983,14 @@ static int find_dso_sym(struct dso *dso, const char *sym_name, u64 *start,
 
 static int addr_filter__entire_dso(struct addr_filter *filt, struct dso *dso)
 {
-	struct symbol *first_sym = dso__first_symbol(dso);
-	struct symbol *last_sym = dso__last_symbol(dso);
-
-	if (!first_sym || !last_sym) {
-		pr_err("Failed to determine filter for %s\nNo symbols found.\n",
+	if (dso__data_file_size(dso, NULL)) {
+		pr_err("Failed to determine filter for %s\nCannot determine file size.\n",
 		       filt->filename);
 		return -EINVAL;
 	}
 
-	filt->addr = first_sym->start;
-	filt->size = last_sym->end - first_sym->start;
+	filt->addr = 0;
+	filt->size = dso->data.file_size;
 
 	return 0;
 }

      parent reply	other threads:[~2018-12-20 17:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27  8:46 [PATCH] perf auxtrace: Alter addr_filter__entire_dso() to work if there are no symbols Adrian Hunter
2018-11-27 12:42 ` Arnaldo Carvalho de Melo
2018-12-10 13:17   ` Adrian Hunter
2018-12-10 13:39     ` Arnaldo Carvalho de Melo
2018-12-20 17:57 ` [tip:perf/core] perf dso: Export data_file_size() method " tip-bot for Adrian Hunter
2018-12-20 17:58 ` tip-bot for Adrian Hunter [this message]

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=tip-571766010ea6bf9726b288eb2db1abb59b1841af@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.