From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752272AbcF1Lsl (ORCPT ); Tue, 28 Jun 2016 07:48:41 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42946 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751331AbcF1Lsj (ORCPT ); Tue, 28 Jun 2016 07:48:39 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: ravi.bangoria@linux.vnet.ibm.com Subject: Re: [RFC 3/6] perf annotate: Enable cross arch annotate To: Arnaldo Carvalho de Melo References: <1466769240-12376-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <1466769240-12376-4-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <20160627171626.GD3324@kernel.org> Cc: linux-kernel@vger.kernel.org, anton@ozlabs.org, mpe@ellerman.id.au, ananth@in.ibm.com, dja@axtens.net From: Ravi Bangoria Date: Tue, 28 Jun 2016 17:17:32 +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: <20160627171626.GD3324@kernel.org> 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: 16062811-0016-0000-0000-0000040EB6F3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062811-0017-0000-0000-0000309DF8FB Message-Id: <577263D4.8040606@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-28_08:,, 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-1604210000 definitions=main-1606280109 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 27 June 2016 10:46 PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Jun 24, 2016 at 05:23:57PM +0530, Ravi Bangoria escreveu: >> Change current data structures and function to enable cross arch annotate >> and add support for x86 and arm instructions. >> >> Current implementation does not contain logic of recording on one arch >> and annotating on other. This remote annotate is partially possible with >> current implementation for x86 (or may be arm as well) only. But, to make >> remote annotation work properly, all architecture instruction tables need >> to be included in the perf binary. And while annotating, look for >> instruction table where perf.data was recorded. ... >> >> +static struct arch_instructions { >> + const char *arch; >> + int nmemb; >> + struct ins *instructions; >> + struct ins *(*ins__find)(const char *); > Why do we need arch specific find functions? Why not pass the > instructions pointer to it, just like you did with ins__sort(). > > Probably it is not needed to be global, you just pick the right > instructions table + its ARRAY_SIZE and pass it around, again, like you > did in ins__sort(). > > - Arnaldo Thanks Arnaldo for suggestion. To determine arch in ins__find, I need to pass 'arch' till ins__find and which requires changes in definition of many functions. So, I thought about global var. Anyway, I've prepared a patch as you suggested and sent it as a [PATCH]. Please review it. -Ravi