From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751939AbbIOBg5 (ORCPT ); Mon, 14 Sep 2015 21:36:57 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:55741 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbbIOBg4 (ORCPT ); Mon, 14 Sep 2015 21:36:56 -0400 Message-ID: <55F77611.4010203@huawei.com> Date: Tue, 15 Sep 2015 09:36:17 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: , , , , , , , , , , , , , , Subject: Re: [PATCH 19/27] perf tools: Introduce regs_query_register_offset() for x86 References: <1441523623-152703-1-git-send-email-wangnan0@huawei.com> <1441523623-152703-20-git-send-email-wangnan0@huawei.com> <20150914213753.GA2834@redhat.com> In-Reply-To: <20150914213753.GA2834@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A150202.55F77624.003E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 5e098963f15137743dcd37b6d7b56c06 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/9/15 5:37, Arnaldo Carvalho de Melo wrote: > Em Sun, Sep 06, 2015 at 07:13:35AM +0000, Wang Nan escreveu: >> regs_query_register_offset() is a helper function which converts >> register name like "%rax" to offset of a register in 'struct pt_regs', >> which is required by BPF prologue generator. Since the function is >> identical, try to reuse the code in arch/x86/kernel/ptrace.c. >> >> Comment inside dwarf-regs.c list the differences between this >> implementation and kernel code. >> >> get_arch_regstr() switches to regoffset_table and the old string table >> is dropped. > Trying to cherry pick this one, but found this problem, trying to fix by > adding the prototype somewhere... > > > [acme@zoo linux]$ m > make: Entering directory '/home/git/linux/tools/perf' > BUILD: Doing 'make -j4' parallel build > CC /tmp/build/perf/arch/x86/util/dwarf-regs.o > CC /tmp/build/perf/arch/x86/util/intel-pt.o > arch/x86/util/dwarf-regs.c:122:5: error: no previous prototype for > ‘regs_query_register_offset’ [-Werror=missing-prototypes] > int regs_query_register_offset(const char *name) > ^ > cc1: all warnings being treated as errors > /home/git/linux/tools/build/Makefile.build:70: recipe for target > '/tmp/build/perf/arch/x86/util/dwarf-regs.o' failed > make[5]: *** [/tmp/build/perf/arch/x86/util/dwarf-regs.o] Error 1 This patch depends on patch 18/27: "perf tools: Add BPF_PROLOGUE config options for further patches" because I wanted to first create the infrastructure then add regs_qurey_register_offset() arch by arch. I think split 18/27 into two patch should be better. First one adds HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET, let the second one consider bpf prologue. Thanks.