Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751866AbbKDFSp (ORCPT ); Wed, 4 Nov 2015 00:18:45 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:49308 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbbKDFSo (ORCPT ); Wed, 4 Nov 2015 00:18:44 -0500 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: anju@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 2/3] perf/powerpc :add support for sampling intr machine state To: Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <1446531002-16582-1-git-send-email-anju@linux.vnet.ibm.com> <1446531002-16582-3-git-send-email-anju@linux.vnet.ibm.com> <1446542195.23081.5.camel@ellerman.id.au> Cc: maddy@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com, sukadev@linux.vnet.ibm.com, acme@redhat.com, dsahern@gmail.com, jolsa@redhat.com, hemant@linux.vnet.ibm.com, naveen.n.rao@linux.vnet.ibm.com From: Anju T Message-ID: <56399529.5030804@linux.vnet.ibm.com> Date: Wed, 4 Nov 2015 10:48:33 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1446542195.23081.5.camel@ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15110405-0005-0000-0000-0000198788A5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1979 Lines: 64 Hi Michael, On Tuesday 03 November 2015 02:46 PM, Michael Ellerman wrote: > On Tue, 2015-11-03 at 11:40 +0530, Anju T wrote: > >> The perf infrastructure uses a bit mask to find out >> valid registers to display. Define a register mask >> for supported registers defined in asm/perf_regs.h. >> The bit positions also correspond to register IDs >> which is used by perf infrastructure to fetch the register >> values.CONFIG_HAVE_PERF_REGS enables >> sampling of the interrupted machine state. >> diff --git a/arch/powerpc/perf/perf_regs.c b/arch/powerpc/perf/perf_regs.c >> new file mode 100644 >> index 0000000..0520492 >> --- /dev/null >> +++ b/arch/powerpc/perf/perf_regs.c >> @@ -0,0 +1,92 @@ >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#define PT_REGS_OFFSET(id, r) [id] = offsetof(struct pt_regs, r) >> + >> +#define REG_RESERVED (~((1ULL << PERF_REG_POWERPC_MAX) - 1)) >> + >> +static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = { >> + PT_REGS_OFFSET(PERF_REG_POWERPC_GPR0, gpr[0]), >> + PT_REGS_OFFSET(PERF_REG_POWERPC_GPR1, gpr[1]), >> + PT_REGS_OFFSET(PERF_REG_POWERPC_GPR2, gpr[2]), > > > I realise you're following the example of other architectures, but we have > almost this exact same structure in ptrace.c, see regoffset_table. > > It would be really nice if we could share them between ptrace and perf. > > cheers > Thank you for reviewing the patch. That is a great suggestion. In ptrace.c the structure doesn't include ORIG_R3. So,in that case what should we do? Thanks and Regards Anju -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/