[patch 4/4] Handle memory unmap while hardware sampling is running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: graalfs@xxxxxxxxxxxxxxxxxx

During memory unmap hardware sampling is deactivated.
After all samples have been collected hardware sampling is reactivated again.
 
Signed-off-by: Mahesh Salgaonkar <mahesh@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Maran Pakkirisamy <maranp@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Heinz Graalfs <graalfs@xxxxxxxxxxxxxxxxxx>
---
 arch/s390/oprofile/hwsampler_files.c |    2 +-
 drivers/oprofile/buffer_sync.c       |   13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/oprofile/buffer_sync.c
===================================================================
--- linux-2.6.orig/drivers/oprofile/buffer_sync.c
+++ linux-2.6/drivers/oprofile/buffer_sync.c
@@ -32,6 +32,11 @@
 #include <linux/sched.h>
 #include <linux/gfp.h>
 
+#ifdef CONFIG_OPROFILE_HWSAMPLING_MODE
+#include <asm/hwsampler.h>
+extern unsigned long oprofile_hwsampler;
+#endif
+
 #include "oprofile_stats.h"
 #include "event_buffer.h"
 #include "cpu_buffer.h"
@@ -513,6 +518,10 @@ void sync_buffer(int cpu)
 
 	mutex_lock(&buffer_mutex);
 
+#ifdef CONFIG_OPROFILE_HWSAMPLING_MODE
+	if (oprofile_hwsampler)
+		hwsampler_deactivate(cpu);
+#endif
 	add_cpu_switch(cpu);
 
 	op_cpu_buffer_reset(cpu);
@@ -569,6 +578,10 @@ void sync_buffer(int cpu)
 
 	mark_done(cpu);
 
+#ifdef CONFIG_OPROFILE_HWSAMPLING_MODE
+	if (oprofile_hwsampler)
+		hwsampler_activate(cpu);
+#endif
 	mutex_unlock(&buffer_mutex);
 }
 
Index: linux-2.6/arch/s390/oprofile/hwsampler_files.c
===================================================================
--- linux-2.6.orig/arch/s390/oprofile/hwsampler_files.c
+++ linux-2.6/arch/s390/oprofile/hwsampler_files.c
@@ -22,7 +22,7 @@ unsigned long oprofile_max_interval;
 static unsigned long oprofile_sdbt_blocks = DEFAULT_SDBT_BLOCKS;
 static unsigned long oprofile_sdb_blocks = DEFAULT_SDB_BLOCKS;
 
-static unsigned long oprofile_hwsampler;
+unsigned long oprofile_hwsampler;
 
 static int oprofile_hwsampler_start(void)
 {

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux