Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755331AbcKVItt (ORCPT ); Tue, 22 Nov 2016 03:49:49 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36970 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755219AbcKVIts (ORCPT ); Tue, 22 Nov 2016 03:49:48 -0500 Subject: Re: [PATCH] perf TUI: Don't throw error for zero length symbols To: anton@samba.org, acme@kernel.org References: <20161121172818.161639c2@kryten> <1479804050-5028-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, chris.ryder@arm.com, mhiramat@kernel.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, linuxppc-dev@lists.ozlabs.orgp, Ravi Bangoria From: Ravi Bangoria Date: Tue, 22 Nov 2016 14:19:33 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1479804050-5028-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112208-0028-0000-0000-00000616CC93 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006121; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00783804; UDB=6.00378558; IPR=6.00561423; BA=6.00004900; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013406; XFM=3.00000011; UTC=2016-11-22 08:49:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112208-0029-0000-0000-0000310ABA79 Message-Id: <5834069D.2020200@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-22_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611220160 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1523 Lines: 39 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 > Signed-off-by: Ravi Bangoria > --- > 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;