Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526403 > unrolled thread

Re: perf TUI fails with "failed to process type: 64"

Started byAnton Blanchard <anton@samba.org>
First post2016-11-21 07:30 +0100
Last post2016-11-22 10:00 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: perf TUI fails with "failed to process type: 64" Anton Blanchard <anton@samba.org> - 2016-11-21 07:30 +0100
    [PATCH] perf TUI: Don't throw error for zero length symbols Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-11-22 09:50 +0100
      Re: [PATCH] perf TUI: Don't throw error for zero length symbols Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-11-22 09:50 +0100
        Re: [PATCH] perf TUI: Don't throw error for zero length symbols Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-11-22 10:00 +0100

#1526403 — Re: perf TUI fails with "failed to process type: 64"

FromAnton Blanchard <anton@samba.org>
Date2016-11-21 07:30 +0100
SubjectRe: perf TUI fails with "failed to process type: 64"
Message-ID<sFQh4-5YA-9@gated-at.bofh.it>
Hi,

I forgot about the set of issues below. Michael had a suggested powerpc
fix for 3, but it it would be nice to fix the perf bugs in 1 and 2.

Anton
--

> Updating to mainline as of last night, I started seeing the following
> error when running the perf report TUI:
> 
> 0x46068 [0x8]: failed to process type: 68
> 
> This event is just PERF_RECORD_FINISHED_ROUND:
> 
> 0x46068 [0x8]: event: 68
> .
> . ... raw event: size 8 bytes
> .  0000:  44 00 00 00 00 00 08 00
> D.......        
> 
> 0x46068 [0x8]: PERF_RECORD_FINISHED_ROUND
> 
> Which of course is not our error. It took me a while to find the real
> culprit:
> 
>  14c00-14c00 g exc_virt_0x4c00_system_call
> 
> A zero length symbol, which __symbol__inc_addr_samples() barfs on:
> 
>         if (addr < sym->start || addr >= sym->end) {
> ...
> 		return -ERANGE;
> 
> Seems like we have 3 bugs here:
> 
> 1. Output the real source of the error instead of
> PERF_RECORD_FINISHED_ROUND
> 
> 2. Don't exit the TUI if we find a sample on a zero length symbol
> 
> 3. Why do we have zero length symbols in the first place? Does the
> recent ppc64 exception clean up have something to do with it?
> 
> Anton

[toc] | [next] | [standalone]


#1527310 — [PATCH] perf TUI: Don't throw error for zero length symbols

FromRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Date2016-11-22 09:50 +0100
Subject[PATCH] perf TUI: Don't throw error for zero length symbols
Message-ID<sGeW5-4Pc-13@gated-at.bofh.it>
In reply to#1526403
perf report (with TUI) exits with error when it finds a sample of zero
length symbol(i.e. addr == sym->start == sym->end). Actually these are
valid samples. Don't exit TUI and show report with such symbols.

Link: https://lkml.org/lkml/2016/10/8/189

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/perf/util/annotate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index aeb5a44..430d039 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -593,7 +593,8 @@ static int __symbol__inc_addr_samples(struct symbol *sym, struct map *map,
 
 	pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map->unmap_ip(map, addr));
 
-	if (addr < sym->start || addr >= sym->end) {
+	if ((addr < sym->start || addr >= sym->end) &&
+	    (addr != sym->end || sym->start != sym->end)) {
 		pr_debug("%s(%d): ERANGE! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 "\n",
 		       __func__, __LINE__, sym->name, sym->start, addr, sym->end);
 		return -ERANGE;
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1527313 — Re: [PATCH] perf TUI: Don't throw error for zero length symbols

FromRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Date2016-11-22 09:50 +0100
SubjectRe: [PATCH] perf TUI: Don't throw error for zero length symbols
Message-ID<sGeW6-4Pc-35@gated-at.bofh.it>
In reply to#1527310
Hi Anton,

On Tuesday 22 November 2016 02:10 PM, Ravi Bangoria wrote:
> perf report (with TUI) exits with error when it finds a sample of zero
> length symbol(i.e. addr == sym->start == sym->end). Actually these are
> valid samples. Don't exit TUI and show report with such symbols.
>
> Link: https://lkml.org/lkml/2016/10/8/189

This will solve 2nd issue.

3rd doesn't sound simple to fix. I tried to fix it by replacing pr_debug to
pr_err when addr is out of symbol address range. But error message will
get overwritten every time when subsequent pr_err gets executed.

Arnaldo, any suggestions?

-Ravi

> Reported-by: Anton Blanchard <anton@samba.org>
> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
> ---
>  tools/perf/util/annotate.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index aeb5a44..430d039 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -593,7 +593,8 @@ static int __symbol__inc_addr_samples(struct symbol *sym, struct map *map,
>
>  	pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map->unmap_ip(map, addr));
>
> -	if (addr < sym->start || addr >= sym->end) {
> +	if ((addr < sym->start || addr >= sym->end) &&
> +	    (addr != sym->end || sym->start != sym->end)) {
>  		pr_debug("%s(%d): ERANGE! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 "\n",
>  		       __func__, __LINE__, sym->name, sym->start, addr, sym->end);
>  		return -ERANGE;

[toc] | [prev] | [next] | [standalone]


#1527318 — Re: [PATCH] perf TUI: Don't throw error for zero length symbols

FromRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Date2016-11-22 10:00 +0100
SubjectRe: [PATCH] perf TUI: Don't throw error for zero length symbols
Message-ID<sGf5M-4SF-15@gated-at.bofh.it>
In reply to#1527313

On Tuesday 22 November 2016 02:19 PM, Ravi Bangoria wrote:
> Hi Anton,
>
> On Tuesday 22 November 2016 02:10 PM, Ravi Bangoria wrote:
>> perf report (with TUI) exits with error when it finds a sample of zero
>> length symbol(i.e. addr == sym->start == sym->end). Actually these are
>> valid samples. Don't exit TUI and show report with such symbols.
>>
>> Link: https://lkml.org/lkml/2016/10/8/189
> This will solve 2nd issue.
>
> 3rd doesn't sound simple to fix.

Sorry, I mean 1st doesn't sound ...

>  I tried to fix it by replacing pr_debug to
> pr_err when addr is out of symbol address range. But error message will
> get overwritten every time when subsequent pr_err gets executed.
>
> Arnaldo, any suggestions?
>
> -Ravi
>
>> Reported-by: Anton Blanchard <anton@samba.org>
>> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
>> ---
>>  tools/perf/util/annotate.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
>> index aeb5a44..430d039 100644
>> --- a/tools/perf/util/annotate.c
>> +++ b/tools/perf/util/annotate.c
>> @@ -593,7 +593,8 @@ static int __symbol__inc_addr_samples(struct symbol *sym, struct map *map,
>>
>>  	pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map->unmap_ip(map, addr));
>>
>> -	if (addr < sym->start || addr >= sym->end) {
>> +	if ((addr < sym->start || addr >= sym->end) &&
>> +	    (addr != sym->end || sym->start != sym->end)) {
>>  		pr_debug("%s(%d): ERANGE! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 "\n",
>>  		       __func__, __LINE__, sym->name, sym->start, addr, sym->end);
>>  		return -ERANGE;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web