From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932710AbcGLCWB (ORCPT ); Mon, 11 Jul 2016 22:22:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57534 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932264AbcGLCV7 (ORCPT ); Mon, 11 Jul 2016 22:21:59 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: ravi.bangoria@linux.vnet.ibm.com Subject: Re: [PATCH v3 3/4] perf annotate: add powerpc support To: acme@kernel.org References: <1467267262-4589-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <1467267262-4589-4-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <1467267714.7296.6.camel@ellerman.id.au> <57762D2A.9040103@linux.vnet.ibm.com> <87vb0j84fb.fsf@@concordia.ellerman.id.au> <577F31D9.4050808@linux.vnet.ibm.com> <87zipsmsyd.fsf@@concordia.ellerman.id.au> Cc: Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, anton@ozlabs.org, ananth@in.ibm.com, dja@axtens.net, naveen.n.rao@linux.vnet.ibm.com, David.Laight@ACULAB.COM, Ravi Bangoria From: Ravi Bangoria Date: Tue, 12 Jul 2016 07:51:46 +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: <87zipsmsyd.fsf@@concordia.ellerman.id.au> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071202-0024-0000-0000-00001415B626 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071202-0025-0000-0000-0000429889EB Message-Id: <5784543A.9030801@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-12_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607120020 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo, On Friday 08 July 2016 02:01 PM, Michael Ellerman wrote: > Ravi Bangoria writes: > >> On Wednesday 06 July 2016 03:38 PM, Michael Ellerman wrote: >> >> I've sent v4 which enables annotate for bctr' instructions. >> >> for 'bctr', it will show down arrow(indicate jump) and 'bctrl' will show >> right arrow(indicate call). But no navigation options will be provided. >> By pressing Enter key on that, message will be shown that like >> "Invalid target" > Great thanks. I've sent v4 series. Please review it. -Ravi >>>>> It doesn't look like we have the opcode handy here? Could we get it somehow? >>>>> That would make this a *lot* more robust. >>>> objdump prints machine code, but I don't know how difficult that would >>>> be to parse to get opcode. >>> Normal objdump -d output includes the opcode, eg: >>> >>> c00000000000886c: 2c 2c 00 00 cmpdi r12,0 >>> ^^^^^^^^^^^ >>> >>> The only thing you need to know is the endian and you can reconstruct >>> the raw instruction. >>> >>> Then you can just decode the opcode, see how we do it in the kernel with >>> eg. instr_is_relative_branch(). >> I'm sorry. I was thinking that you wants to show opcodes with perf >> annotate. But you were asking to use opcode instead of parsing >> instructions. > Yeah. > >> This looks like rewrite parsing code. I don't know whether there is any >> library already available for this which we can directly use. I'm thinking >> about this. > OK don't worry about it for now. We should get this merged for starters > and we can always improve it later. > > cheers >