Received: by 10.223.164.202 with SMTP id h10csp4698820wrb; Wed, 29 Nov 2017 10:21:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMYC/wbbK9dmTNsggwszHONXZg2P3h+V37CVLPvGgWFdpXhsetLnS7Hc+PUOwk06IQkomKWY X-Received: by 10.84.218.72 with SMTP id f8mr3820831plm.143.1511979694996; Wed, 29 Nov 2017 10:21:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511979694; cv=none; d=google.com; s=arc-20160816; b=WP4MDmqcLbvoQ36eGCozawGKiz2ih1xr8JwRyzfiEeC47INlA6oaDBN5gwZqWEJMIG 5/7/h8UPTkxVurS1A5NfzghWzHIdQ32bCYTE/DUEMBB2yTySHnehjaj+y6jZGLZLVWcQ rMHCzTXqnJtBlrr6i1tpATil6+Rf/YpQ1fBpUK3EYyuCmTzlizcz/i6TWFfOGHSt/smV LpUTJPnHftvDyXnGuI5UDFrytpP63eWlo9o+gRvWeDrIOD4iuFbkVZgcO33G773IauS5 zgx9ob4RX8zSG6814YNWPervBRXB/g/nE7wNtOiYsJoItoUvVGygQWligaS6tHVi/WYe Vs9w== 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-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=MpXepJprIwZA9JHLmn01qhcX5yMcF1trpL7Xzp7duoI=; b=cBozmHQC1xLbMAzUMrjVBwtaQNOXL+Y+wAHqdf6iD+MaAxrnolNZwYKyXNO/nIKY8c MwQR/Jx2l+DwlUuObjRcCBUCItnYLKOvH/1cnNi+CQIGuZSWfhWMxIE0XqoXWknS39Ul inKJiyoGJA/GX+oeCraF5QNg9qXKZFvIgrOmW1srR9+fyk4ivMPPDkEmyJWmBPo0MFUZ Em6X6CzVupvbfL97B1zqmPvRrKo8Vb4llyYa257CGmWulYJ70/WeAgpW1/03Mk+HXpTy ZLAjQOXWsEisDb5rqntwiQl6ADilfZc2jK5tog7RMZe1qSmnSGslk3oUQsNxGugzJ8gp P8wQ== 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 d12si1635327plo.388.2017.11.29.10.21.24; Wed, 29 Nov 2017 10:21:34 -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 S933005AbdK2PVu (ORCPT + 69 others); Wed, 29 Nov 2017 10:21:50 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53788 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932079AbdK2PVs (ORCPT ); Wed, 29 Nov 2017 10:21:48 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vATFKg6v075091 for ; Wed, 29 Nov 2017 10:21:48 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ehwkhp78g-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 29 Nov 2017 10:21:47 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Nov 2017 15:21:45 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Nov 2017 15:21:43 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vATFLgJ066191572; Wed, 29 Nov 2017 15:21:42 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE7A9A405F; Wed, 29 Nov 2017 15:16:14 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AC05A405D; Wed, 29 Nov 2017 15:16:12 +0000 (GMT) Received: from [9.79.222.201] (unknown [9.79.222.201]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 29 Nov 2017 15:16:11 +0000 (GMT) Subject: Re: [PATCH] perf annotate: Fix objdump comment parsing for Intel mov dissassembly To: Thomas-Mich Richter , acme@kernel.org Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, Ravi Bangoria References: <20171128075632.72182-1-tmricht@linux.vnet.ibm.com> <69859e3b-cb22-a536-79ca-ffc44c3f86a8@linux.vnet.ibm.com> From: Ravi Bangoria Date: Wed, 29 Nov 2017 20:52:13 +0530 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 17112915-0016-0000-0000-0000050700C1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112915-0017-0000-0000-00002842E968 Message-Id: <9c33e7e2-9101-27fa-d1f4-cbdb4777fcc5@linux.vnet.ibm.com> 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=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711290200 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29/2017 08:33 PM, Thomas-Mich Richter wrote: > 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); > } Looks good.  Ack-by: Ravi Bangoria Thanks, Ravi From 1585425337684572787@xxx Wed Nov 29 18:17:05 +0000 2017 X-GM-THRID: 1585295770389440484 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread