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


Groups > linux.kernel > #1471468

[PATCH 02/13] perf/core: Extend perf_sample_regs_intr() to include perf_arch_regs update

From Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH 02/13] perf/core: Extend perf_sample_regs_intr() to include perf_arch_regs update
Date 2016-08-28 23:10 +0200
Message-ID <sbfv4-6Ra-33@gated-at.bofh.it> (permalink)
References <sbfv3-6Ra-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Extend perf_sample_regs_intr() to support the updates needed for
perf_arch_reg structure and perf_arch_regs_mask. Also add code to
init the arch_regs_mask to zero incase of regs_user in
perf_sample_regs_user(). Ideally this should be done in perf_sample_data_init,
but due to commit 2565711fb7d7 ("perf: Improve the perf_sample_data struct layout")
moving it to this function.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Stephane Eranian <eranian@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
 kernel/events/core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2f6e6a16b117..8cf540275c34 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5398,6 +5398,9 @@ static void perf_sample_regs_user(struct perf_regs *regs_user,
 		regs_user->abi = PERF_SAMPLE_REGS_ABI_NONE;
 		regs_user->regs = NULL;
 	}
+
+	/* Init arch_regs_mask to zero */
+	regs_user->arch_regs_mask = 0;
 }
 
 static void perf_sample_regs_intr(struct perf_regs *regs_intr,
@@ -5405,6 +5408,8 @@ static void perf_sample_regs_intr(struct perf_regs *regs_intr,
 {
 	regs_intr->regs = regs;
 	regs_intr->abi  = perf_reg_abi(current);
+	regs_intr->arch_regs_mask = perf_get_arch_regs_mask();
+	regs_intr->arch_regs = perf_get_arch_reg();
 }
 
 
-- 
2.7.4

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


Thread

[PATCH 00/13] Add support for perf_arch_regs Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-08-28 23:10 +0200
  [PATCH 01/13] perf/core: Add perf_arch_regs and mask to perf_regs structure Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-08-28 23:10 +0200
    Re: [PATCH 01/13] perf/core: Add perf_arch_regs and mask to  perf_regs structure kbuild test robot <lkp@intel.com> - 2016-08-29 01:50 +0200
    Re: [PATCH 01/13] perf/core: Add perf_arch_regs and mask to  perf_regs structure Peter Zijlstra <peterz@infradead.org> - 2016-09-01 09:30 +0200
      Re: [PATCH 01/13] perf/core: Add perf_arch_regs and mask to perf_regs  structure Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-09-06 06:30 +0200
        Re: [PATCH 01/13] perf/core: Add perf_arch_regs and mask to  perf_regs structure Peter Zijlstra <peterz@infradead.org> - 2016-09-06 11:20 +0200
          Re: [PATCH 01/13] perf/core: Add perf_arch_regs and mask to perf_regs  structure Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-09-09 02:50 +0200
  [PATCH 08/13] powerpc/perf: Add support for perf_arch_regs for newer Power processor Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-08-28 23:10 +0200
  [PATCH 04/13] perf/core: Extend perf_output_sample_regs() to include perf_arch_regs Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-08-28 23:10 +0200
    Re: [PATCH 04/13] perf/core: Extend perf_output_sample_regs() to  include perf_arch_regs Nilay Vaish <nilayvaish@gmail.com> - 2016-08-30 18:20 +0200
      Re: [PATCH 04/13] perf/core: Extend perf_output_sample_regs() to  include perf_arch_regs Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-09-01 05:50 +0200
  [PATCH 02/13] perf/core: Extend perf_sample_regs_intr() to include perf_arch_regs update Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-08-28 23:10 +0200
  [PATCH 12/13] tool/perf: Add perf_arch_reg mask and arch_reg_names structure Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-08-28 23:10 +0200
  Re: [PATCH 00/13] Add support for perf_arch_regs Nilay Vaish <nilayvaish@gmail.com> - 2016-08-30 18:10 +0200
    Re: [PATCH 00/13] Add support for perf_arch_regs Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2016-09-01 05:10 +0200

csiph-web