linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anju T <anju@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
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
Subject: Re: [PATCH V3 2/3] perf/powerpc :add support for sampling intr machine state
Date: Wed, 4 Nov 2015 10:48:33 +0530	[thread overview]
Message-ID: <56399529.5030804@linux.vnet.ibm.com> (raw)
In-Reply-To: <1446542195.23081.5.camel@ellerman.id.au>

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 <linux/errno.h>
>> +#include <linux/kernel.h>
>> +#include <linux/sched.h>
>> +#include <linux/perf_event.h>
>> +#include <linux/bug.h>
>> +#include <linux/stddef.h>
>> +#include <asm/ptrace.h>
>> +#include <asm/perf_regs.h>
>> +
>> +#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]),
> <snip>
>
> 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

  parent reply	other threads:[~2015-11-04  5:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03  6:09 [PATCH V3 0/3] perf/powerpc:Add ability to sample intr machine state in powerpc Anju T
2015-11-03  6:10 ` [PATCH V3 1/3] perf/powerpc:add ability to sample intr machine state in power Anju T
2015-11-03  6:10 ` [PATCH V3 2/3] perf/powerpc :add support for sampling intr machine state Anju T
2015-11-03  9:16   ` Michael Ellerman
2015-11-04  5:08     ` Anju T
2015-11-04  5:18     ` Anju T [this message]
2015-11-04  5:45     ` Madhavan Srinivasan
2015-11-03  6:10 ` [PATCH V3 3/3] tools/perf:Map the ID values with register names Anju T
2015-11-04  8:56 ` [PATCH V3 0/3] perf/powerpc:Add ability to sample intr machine state in powerpc Denis Kirjanov
2015-11-06  6:59   ` Anju T
2015-11-06  7:39     ` Denis Kirjanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56399529.5030804@linux.vnet.ibm.com \
    --to=anju@linux.vnet.ibm.com \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=sukadev@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).