From: Andi Kleen <andi@firstfloor.org>
To: peterz@infradead.org
Cc: alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org,
Andi Kleen <ak@linux.intel.com>,
adrian.hunter@intel.com
Subject: [PATCH 2/2] perf tools: Support end symbols with no size for filters
Date: Fri, 3 Feb 2017 14:18:30 -0800 [thread overview]
Message-ID: <20170203221830.22354-2-andi@firstfloor.org> (raw)
In-Reply-To: <20170203221830.22354-1-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
Currently a filter like
--filter "filter _text / _end"
doesn't work because _end doesn't have a size. The
filter resolution always wants to use the end of the function
as end.
Allow this case by assuming the filter just spawns to the
start of the end symbol when there is no size. This makes
the above useful filter work.
Cc: adrian.hunter@intel.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/auxtrace.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index c5a6e0b12452..4c5ccb2b1298 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -1840,7 +1840,12 @@ static int addr_filter__resolve_kernel_syms(struct addr_filter *filt)
if (err)
return err;
filt->size = start + size - filt->addr;
- no_size = !!size;
+ /*
+ * When to has no size assume it's a end symbol.
+ * This allows filters like _text / _end
+ */
+ if (size == 0)
+ filt->size = start - filt->addr;
}
/* The very last symbol in kallsyms does not imply a particular size */
--
2.9.3
next prev parent reply other threads:[~2017-02-03 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 22:18 [PATCH 1/2] perf/core: Allow global address filtering for kernel code Andi Kleen
2017-02-03 22:18 ` Andi Kleen [this message]
2017-02-06 13:15 ` [PATCH 2/2] perf tools: Support end symbols with no size for filters Adrian Hunter
2017-02-09 22:59 ` Andi Kleen
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=20170203221830.22354-2-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/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