mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: linux-kernel@vger.kernel.org
Cc: a.p.zijlstra@chello.nl, eranian@google.com, andi@firstfloor.org,
	"Yan, Zheng" <zheng.z.yan@intel.com>
Subject: [PATCH 08/15] perf, x86: Allocate memory for saving LBR stack
Date: Wed, 11 Dec 2013 15:10:53 +0800	[thread overview]
Message-ID: <1386745860-21143-9-git-send-email-zheng.z.yan@intel.com> (raw)
In-Reply-To: <1386745860-21143-1-git-send-email-zheng.z.yan@intel.com>

From: "Yan, Zheng" <zheng.z.yan@intel.com>

Allocate memory for perf task context, use the memory to save
LBR stack.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 arch/x86/kernel/cpu/perf_event.c | 1 +
 arch/x86/kernel/cpu/perf_event.h | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 69e2095..2e43f1b 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1879,6 +1879,7 @@ static struct pmu pmu = {
 
 	.event_idx		= x86_pmu_event_idx,
 	.sched_task		= x86_pmu_sched_task,
+	.task_ctx_size          = sizeof(struct x86_perf_task_context),
 };
 
 void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now)
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
index 3ef4b79..3ed9629 100644
--- a/arch/x86/kernel/cpu/perf_event.h
+++ b/arch/x86/kernel/cpu/perf_event.h
@@ -459,6 +459,13 @@ struct x86_pmu {
 	struct perf_guest_switch_msr *(*guest_get_msrs)(int *nr);
 };
 
+struct x86_perf_task_context {
+	u64 lbr_from[MAX_LBR_ENTRIES];
+	u64 lbr_to[MAX_LBR_ENTRIES];
+	int lbr_callstack_users;
+	int lbr_stack_state;
+};
+
 enum {
 	PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT = PERF_SAMPLE_BRANCH_MAX_SHIFT,
 	PERF_SAMPLE_BRANCH_SELECT_MAP_SIZE,
-- 
1.8.1.4


  parent reply	other threads:[~2013-12-11  7:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11  7:10 [PATCH 00/15] perf, x86: Haswell LBR call stack support Yan, Zheng
2013-12-11  7:10 ` [PATCH 01/15] perf, x86: Reduce lbr_sel_map size Yan, Zheng
2013-12-11  7:10 ` [PATCH 02/15] perf, x86: Basic Haswell LBR call stack support Yan, Zheng
2013-12-11  7:10 ` [PATCH 03/15] perf, core: Introduce pmu context switch callback Yan, Zheng
2013-12-11  7:10 ` [PATCH 04/15] perf, x86: Use context switch callback to flush LBR stack Yan, Zheng
2013-12-17 16:10   ` Ingo Molnar
2013-12-11  7:10 ` [PATCH 05/15] perf, core: Optimize context switch callback invoking Yan, Zheng
2013-12-11  7:10 ` [PATCH 06/15] perf, core: PMU specific data for perf task context Yan, Zheng
2013-12-11  7:10 ` [PATCH 07/15] perf, core: Always swtich pmu specific data during context switch Yan, Zheng
2013-12-11  7:10 ` Yan, Zheng [this message]
2013-12-11  7:10 ` [PATCH 09/15] perf: Track system-wide LBR users and LBR callstack users Yan, Zheng
2013-12-11  7:10 ` [PATCH 10/15] perf, x86: Save/resotre LBR stack during context switch Yan, Zheng
2013-12-11  7:10 ` [PATCH 11/15] perf, core: Simplify need branch stack check Yan, Zheng
2013-12-11  7:10 ` [PATCH 12/15] perf, core: Pass perf_sample_data to perf_callchain() Yan, Zheng
2013-12-11  7:10 ` [PATCH 13/15] perf, x86: Use LBR call stack to get user callchain Yan, Zheng
2013-12-11  7:10 ` [PATCH 14/15] perf, x86: Enable LBR callstack when recording callchain Yan, Zheng
2013-12-11  7:11 ` [PATCH 15/15] perf, x86: Discard zero length call entries in LBR call stack Yan, Zheng

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=1386745860-21143-9-git-send-email-zheng.z.yan@intel.com \
    --to=zheng.z.yan@intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®