From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752262AbbINViJ (ORCPT ); Mon, 14 Sep 2015 17:38:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51355 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbbINViH (ORCPT ); Mon, 14 Sep 2015 17:38:07 -0400 Date: Mon, 14 Sep 2015 18:37:53 -0300 From: Arnaldo Carvalho de Melo To: Wang Nan Cc: ast@plumgrid.com, masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, brendan.d.gregg@gmail.com, acme@kernel.org, daniel@iogearbox.net, dsahern@gmail.com, hekuang@huawei.com, jolsa@kernel.org, lizefan@huawei.com, paulus@samba.org, xiakaixu@huawei.com, pi3orama@163.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 19/27] perf tools: Introduce regs_query_register_offset() for x86 Message-ID: <20150914213753.GA2834@redhat.com> References: <1441523623-152703-1-git-send-email-wangnan0@huawei.com> <1441523623-152703-20-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1441523623-152703-20-git-send-email-wangnan0@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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