From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Wed, 25 Jan 2017 13:32:01 +0000 Subject: [PATCH 2/2 v2] perf tools: Enable bpf prologue for arm64 In-Reply-To: <20170125072311.22922-1-hekuang@huawei.com> References: <20170124190908.GG10340@kernel.org> <20170125072311.22922-1-hekuang@huawei.com> Message-ID: <20170125133201.GC27026@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Jan 25, 2017 at 07:23:11AM +0000, He Kuang wrote: > Since HAVE_KPROBES can be enabled in arm64, this patch introduces > regs_query_register_offset() to convert register name to offset for > arm64, so the BPF prologue feature is ready to use. > > This patch also changes the 'dwarfnum' to 'offset' in register table, > so the related functions are consistent with x86. Wouldn't it be an awful lot simpler just to leave the code as-is, and implement regs_query_register_offset in the same way that we implement get_arch_regstr but return the dwarfnum? I don't really see the point of all the refactoring. Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751545AbdAYNcC (ORCPT ); Wed, 25 Jan 2017 08:32:02 -0500 Received: from foss.arm.com ([217.140.101.70]:36710 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbdAYNcB (ORCPT ); Wed, 25 Jan 2017 08:32:01 -0500 Date: Wed, 25 Jan 2017 13:32:01 +0000 From: Will Deacon To: He Kuang Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, mhiramat@kernel.org, wangnan0@huawei.com, bintian.wang@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2 v2] perf tools: Enable bpf prologue for arm64 Message-ID: <20170125133201.GC27026@arm.com> References: <20170124190908.GG10340@kernel.org> <20170125072311.22922-1-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170125072311.22922-1-hekuang@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 25, 2017 at 07:23:11AM +0000, He Kuang wrote: > Since HAVE_KPROBES can be enabled in arm64, this patch introduces > regs_query_register_offset() to convert register name to offset for > arm64, so the BPF prologue feature is ready to use. > > This patch also changes the 'dwarfnum' to 'offset' in register table, > so the related functions are consistent with x86. Wouldn't it be an awful lot simpler just to leave the code as-is, and implement regs_query_register_offset in the same way that we implement get_arch_regstr but return the dwarfnum? I don't really see the point of all the refactoring. Will