All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 8/9] early pt: enable cyc packet
@ 2017-09-30  3:31 Luming Yu
  0 siblings, 0 replies; only message in thread
From: Luming Yu @ 2017-09-30  3:31 UTC (permalink / raw)
  To: LKML

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]

enable CYC packet

Signed-off-by: Luming Yu <luming.yu@intel.com>

[-- Attachment #2: 0008-early-pt-enable-cyc-packet.patch --]
[-- Type: application/octet-stream, Size: 1525 bytes --]

From 8b5d8f3150216e1b671456b60be20a3456262a0d Mon Sep 17 00:00:00 2001
From: Luming Yu <luming.yu@intel.com>
Date: Fri, 29 Sep 2017 22:10:41 +0800
Subject: [PATCH v1 8/9] early pt: enable cyc packet

enable CYC packet

Signed-off-by: Luming Yu <luming.yu@intel.com>
---
 arch/x86/events/intel/early_pt.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/x86/events/intel/early_pt.c b/arch/x86/events/intel/early_pt.c
index 645d2ca..95225d6 100644
--- a/arch/x86/events/intel/early_pt.c
+++ b/arch/x86/events/intel/early_pt.c
@@ -58,6 +58,7 @@ static unsigned addr_range_num = 0;
 
 static int mtc_freq = 0;
 static int psb_freq = 0;
+static int cyc_thresh = 0;
 
 static unsigned long pt_addr0_start = 0, pt_addr0_end = 0;
 static unsigned long pt_addr1_start = 0, pt_addr1_end = 0;
@@ -206,6 +207,9 @@ static int start_early_pt(void *arg)
 	if (psb_freq && ((1U << (psb_freq - 1)) & psb_freq_mask))
 		val |= (psb_freq -1) << 24;
 
+	if (cyc_thresh && ((1U << (cyc_thresh-1)) & cyc_thresh_mask))
+		val |= ((cyc_thresh -1) << 19) | CYC_EN;
+
 	if (wrmsrl_safe(MSR_IA32_RTIT_CTL, val) < 0) {
 		pr_info("early_pt start failed on cpu[%d]\n", cpu);
 		__this_cpu_write(early_pt_running, false);
@@ -424,3 +428,9 @@ static int __init early_pt_psb_freq_setup(char *arg)
 	return 0;
 }
 early_param("psb_freq", early_pt_psb_freq_setup);
+static int __init early_pt_cyc_thresh_setup(char *arg)
+{
+	sscanf(arg, "%d", &cyc_thresh);
+	return 0;
+}
+early_param("cyc_thresh", early_pt_cyc_thresh_setup);
-- 
2.7.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-30  3:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-30  3:31 [PATCH v1 8/9] early pt: enable cyc packet Luming Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.