Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1261325

Re: [PATCH V3 2/3] perf/powerpc :add support for sampling intr machine state

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH V3 2/3] perf/powerpc :add support for sampling intr machine state
Date 2015-11-03 10:20 +0100
Message-ID <qqFUZ-JW-11@gated-at.bofh.it> (permalink)
References <qqD6O-7mQ-3@gated-at.bofh.it> <qqD6R-7mQ-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V3 0/3] perf/powerpc:Add ability to sample intr machine state in powerpc Anju T <anju@linux.vnet.ibm.com> - 2015-11-03 07:20 +0100
  [PATCH V3 2/3] perf/powerpc :add support for sampling intr machine state Anju T <anju@linux.vnet.ibm.com> - 2015-11-03 07:20 +0100
    Re: [PATCH V3 2/3] perf/powerpc :add support for sampling intr  machine state Michael Ellerman <mpe@ellerman.id.au> - 2015-11-03 10:20 +0100
      Re: [PATCH V3 2/3] perf/powerpc :add support for sampling intr  machine state Anju T <anju@linux.vnet.ibm.com> - 2015-11-04 06:20 +0100
      Re: [PATCH V3 2/3] perf/powerpc :add support for sampling intr  machine state Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2015-11-04 06:50 +0100
  Re: [PATCH V3 0/3] perf/powerpc:Add ability to sample intr machine  state in powerpc Denis Kirjanov <kda@linux-powerpc.org> - 2015-11-04 10:00 +0100
    Re: [PATCH V3 0/3] perf/powerpc:Add ability to sample intr machine  state in powerpc Anju T <anju@linux.vnet.ibm.com> - 2015-11-06 08:00 +0100
      Re: [PATCH V3 0/3] perf/powerpc:Add ability to sample intr machine  state in powerpc Denis Kirjanov <kda@linux-powerpc.org> - 2015-11-06 08:50 +0100

csiph-web