Skip to contentSkip to conversation

perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()

PATCH Applied Adrian Hunter 4 participants 4 messages Mar 24, 2017 – Mar 28, 2017 perf events

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

PATCH 1/1 perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()

Address filtering with kernel symbols incorrectly resulted in the error "Cannot determine size of symbol" because the no_size logic was the wrong way around.

---

I thought I sent this ages ago, but I can't see it anywhere :-/

 tools/perf/util/auxtrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/auxtrace.c +2 -2
index c5a6e0b12452..78bd632f144d 100644
@@ -1826,7 +1826,7 @@ static int addr_filter__resolve_kernel_syms(struct addr_filter *filt)
 		filt->addr = start;
 		if (filt->range && !filt->size && !filt->sym_to) {
 			filt->size = size;
-			no_size = !!size;
+			no_size = !size;
 		}
 	}
 
@@ -1840,7 +1840,7 @@ static int addr_filter__resolve_kernel_syms(struct addr_filter *filt)
 		if (err)
 			return err;
 		filt->size = start + size - filt->addr;
-		no_size = !!size;
+		no_size = !size;
 	}
 
 	/* The very last symbol in kallsyms does not imply a particular size */
Signature · 1 line
1.9.1
maintainer Applied
#2 lore raw

Em Fri, Mar 24, 2017 at 04:20:12PM -0700, Andi Kleen escreveu:

Quoted 10 lines · Adrian Hunter
Quoted 7 lines

Address filtering with kernel symbols incorrectly resulted in the error "Cannot determine size of symbol" because the no_size logic was the wrong way around.

---

Thanks, applied.

- Arnaldo

Quoted 3 lines

Fixes my problems with tracing kernel with PT with filtering.

-Andi

#3 lore raw
In reply to Adrian Hunter
perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()
Commit-ID:  c3a0bbc7ad7598dec5a204868bdf8a2b1b51df14
Gitweb:     http://git.kernel.org/tip/c3a0bbc7ad7598dec5a204868bdf8a2b1b51df14
Author:     Adrian Hunter <[email protected]>
AuthorDate: Fri, 24 Mar 2017 14:15:52 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 27 Mar 2017 11:58:08 -0300

perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms()

Address filtering with kernel symbols incorrectly resulted in the error "Cannot determine size of symbol" because the no_size logic was the wrong way around.

---
 tools/perf/util/auxtrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/auxtrace.c +2 -2
index c5a6e0b1..78bd632 100644
@@ -1826,7 +1826,7 @@ static int addr_filter__resolve_kernel_syms(struct addr_filter *filt)
 		filt->addr = start;
 		if (filt->range && !filt->size && !filt->sym_to) {
 			filt->size = size;
-			no_size = !!size;
+			no_size = !size;
 		}
 	}
 
@@ -1840,7 +1840,7 @@ static int addr_filter__resolve_kernel_syms(struct addr_filter *filt)
 		if (err)
 			return err;
 		filt->size = start + size - filt->addr;
-		no_size = !!size;
+		no_size = !size;
 	}
 
 	/* The very last symbol in kallsyms does not imply a particular size */