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

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

boot option "early_pt" to enable early pt

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

[-- Attachment #2: 0003-boot-option-early_pt-to-enable-early-pt.patch --]
[-- Type: application/octet-stream, Size: 1540 bytes --]

From 10e30e21dbe47702c1580ee315de6bd79fe8bcdf Mon Sep 17 00:00:00 2001
From: Luming Yu <luming.yu@intel.com>
Date: Fri, 29 Sep 2017 22:00:44 +0800
Subject: [PATCH v1 3/9] early pt: boot option to enable early pt

boot option "early_pt" to enable early pt 

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

diff --git a/arch/x86/events/intel/early_pt.c b/arch/x86/events/intel/early_pt.c
index 67513ed..16ed03c 100644
--- a/arch/x86/events/intel/early_pt.c
+++ b/arch/x86/events/intel/early_pt.c
@@ -42,6 +42,8 @@
 static int	early_pt_buffer_order = 9;
 static bool	single_range = true;
 
+static bool early_pt_enabled = false;
+
 static DEFINE_PER_CPU(bool, early_pt_running);
 static DEFINE_PER_CPU(u64, pt_offset);
 static DEFINE_PER_CPU(u64, pt_buffer_cpu);
@@ -201,6 +203,8 @@ static int early_pt_init(void)
 {
 	int err;
 
+	if (!early_pt_enabled)
+		return 0;
 	err = early_pt_cpuid_caps();
 	if (err < 0) {
 		pr_info("early_pt_init: no feature available\n");
@@ -214,6 +218,8 @@ static int late_pt_init(void)
 	int err;
 	unsigned int i;
 
+	if (!early_pt_enabled)
+		return 0;
 	for_each_online_cpu(i) {
 		if (!per_cpu(early_pt_running, i)) {
 			pr_err("late_pt_init: failed, early pt not running\n");
@@ -335,3 +341,10 @@ static struct miscdevice early_pt_miscdev = {
 	&early_pt_fops
 };
 
+static int __init early_pt_enable(char *str)
+{
+	early_pt_enabled = true;
+	return 0;
+}
+early_param("early_pt", early_pt_enable);
+
-- 
2.7.5


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

only message in thread, other threads:[~2017-09-30  3:26 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:26 [PATCH v1 3/9] early pt: boot option to enable early pt 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.