Received: by 10.223.164.202 with SMTP id h10csp4496313wrb; Wed, 29 Nov 2017 07:15:52 -0800 (PST) X-Google-Smtp-Source: AGs4zMZJ+K6I09K6YpNbEk5WzTOxE+w66r8HTLT8c1vd5TOKAYesNAB6vOmMfRNorVceZdGnW7ow X-Received: by 10.99.7.143 with SMTP id 137mr3082909pgh.158.1511968552624; Wed, 29 Nov 2017 07:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511968552; cv=none; d=google.com; s=arc-20160816; b=mlChl+8B/NdN3vgNIOXt+fHqsniqGxNs2z5r+zD3A0/Zt6y0r0e1AQE5x0QOfgDOrq SFk9TjB8cwtQBebWfqitmwVZwBm0jtzTeh/d/0ud1BCoC6Ci49d1DtjATdO4p/VB9IKv QIcJGrKaeW4UDyGdXoIR+bI+RqJeetu7q0bq5q257o0hjlEmoCfrF5cRm9FGGHHu5Con fIZ6raDIh/4OCL/yXJvJotf8UJ4t33rYpQUFem+EiH7qaZHdFNNIGHlnQKFrKSRQZI7U AonudVqbPcLlqJj/6vXaie2qBk19l+FIM8cOOmrgsJkgUrciSOQnVMdve9TaPbADGW2n ROJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :organization:from:references:cc:to:subject :arc-authentication-results; bh=Rq4TNOebznQQg8XqJXmNi+90nsAIQHCoTPrr9G5oTww=; b=SWZxWpDXKycZwj6GAQOI7J2/fNAqoxl8CLMI9h7wN9YLE6iDHxHMwaO2QU6l9BcQ+o FC9rsgJY+6yPC0OzhSJQ6nqc7OudXBZvVSRXd3BZTsvIFdH5ZRn0G6xup6fgWHZb4LHG Jlft2wemQgvTMi2qHaa9imN6P1D9WXWFS0rP3gbcBz7hP572HyvU0z6zFul06pQKRrDD uE350U+iWAY4B2+34vkAzvt+jlt1dn64BWndAMbFdbjeV09ARwaTrtq7uxqK1MhRUjIn llcBtVNqp39wFs5p1wqDXYBtQXnLbZMxIeyYFCKzkwfRVjGMlgM34nckSN0YfTSAV9rX V8Og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si1378077pgp.220.2017.11.29.07.15.41; Wed, 29 Nov 2017 07:15:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755406AbdK2PNm (ORCPT + 69 others); Wed, 29 Nov 2017 10:13:42 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54146 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751668AbdK2PNl (ORCPT ); Wed, 29 Nov 2017 10:13:41 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vATF9bNw062894 for ; Wed, 29 Nov 2017 10:13:40 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ehxp1a2pk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 29 Nov 2017 10:13:39 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Nov 2017 15:03:12 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Nov 2017 15:03:08 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vATF37O038338756; Wed, 29 Nov 2017 15:03:07 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 883C011C054; Wed, 29 Nov 2017 14:57:41 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D5E511C05B; Wed, 29 Nov 2017 14:57:41 +0000 (GMT) Received: from oc3784624756.ibm.com (unknown [9.152.212.153]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 29 Nov 2017 14:57:41 +0000 (GMT) Subject: Re: [PATCH] perf annotate: Fix objdump comment parsing for Intel mov dissassembly To: Ravi Bangoria Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com References: <20171128075632.72182-1-tmricht@linux.vnet.ibm.com> <69859e3b-cb22-a536-79ca-ffc44c3f86a8@linux.vnet.ibm.com> From: Thomas-Mich Richter Organization: IBM LTC Date: Wed, 29 Nov 2017 16:03:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <69859e3b-cb22-a536-79ca-ffc44c3f86a8@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-IE Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17112915-0008-0000-0000-000004B1028F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112915-0009-0000-0000-00001E43E417 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-29_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711290198 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29/2017 02:24 PM, Ravi Bangoria wrote: > > > On 11/28/2017 01:26 PM, Thomas Richter wrote: >> The command 'perf annotate' parses the output of objdump and also >> investigates the comments produced by objdump. For example the >> output of objdump produces (on x86): >> >> 23eee: 4c 8b 3d 13 01 21 00 mov 0x210113(%rip),%r15 >> # 234008 >> >> and the function mov__parse() is called to investigate the complete >> line. Mov__parse() breaks this line into several parts and finally >> calls function comment__symbol() to parse the data after the comment >> character '#'. Comment__symbol() expects a hexadecimal address followed >> by a symbol in '<' and '>' brackets. >> >> However the 2nd parameter given to function comment__symbol() >> always points to the comment character '#'. The address parsing >> always returns 0 because the character '#' is not a digit and >> strtoull() fails without being noticed. >> >> Fix this by advancing the second parameter to function comment__symbol() >> by one byte before invocation and add an error check after strtoull() >> has been called. > > Yeah, looks like it fails to get correct value in 'addrp'. > > Can you please show the difference in perf annotate output before > and after patch. > > Thanks, > Ravi > There is no difference in output of --stdio. The adress value is not read and remains 0x0 in ops->source.addr or ops->target.addr. That is not visible because in function mov__scnprintf() that wrong address is not printed: static int mov__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops) { return scnprintf(bf, size, "%-6.6s %s,%s", ins->name, ops->source.name ?: ops->source.raw, ops->target.name ?: ops->target.raw); } -- Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany -- Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294 From 1585295770389440484@xxx Tue Nov 28 07:57:40 +0000 2017 X-GM-THRID: 1585295770389440484 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread