lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170203221830.22354-2-andi@firstfloor.org>
Date:   Fri,  3 Feb 2017 14:18:30 -0800
From:   Andi Kleen <andi@...stfloor.org>
To:     peterz@...radead.org
Cc:     alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>, adrian.hunter@...el.com
Subject: [PATCH 2/2] perf tools: Support end symbols with no size for filters

From: Andi Kleen <ak@...ux.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@...el.com
Signed-off-by: Andi Kleen <ak@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ