aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/oprofile/hwsampler.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-12-20 12:10:29 +0100
committerIngo Molnar <mingo@elte.hu>2011-12-20 12:10:29 +0100
commit124ba9403318d834ef21bcd899c22c870708d2c4 (patch)
tree2ac84214085de8780dfa565be7e3ef0d675f6a68 /arch/s390/oprofile/hwsampler.c
parentperf tools: Add ability to synthesize event according to a sample (diff)
parentoprofile, s390: Add event interface to the System z hardware sampling module (diff)
downloadlinux-dev-124ba9403318d834ef21bcd899c22c870708d2c4.tar.xz
linux-dev-124ba9403318d834ef21bcd899c22c870708d2c4.zip
Merge branch 'for-tip' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile into perf/core
Diffstat (limited to 'arch/s390/oprofile/hwsampler.c')
-rw-r--r--arch/s390/oprofile/hwsampler.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index f43c0e4282af..9daee91e6c3f 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -22,6 +22,7 @@
#include <asm/irq.h>
#include "hwsampler.h"
+#include "op_counter.h"
#define MAX_NUM_SDB 511
#define MIN_NUM_SDB 1
@@ -896,6 +897,8 @@ static void add_samples_to_oprofile(unsigned int cpu, unsigned long *sdbt,
if (sample_data_ptr->P == 1) {
/* userspace sample */
unsigned int pid = sample_data_ptr->prim_asn;
+ if (!counter_config.user)
+ goto skip_sample;
rcu_read_lock();
tsk = pid_task(find_vpid(pid), PIDTYPE_PID);
if (tsk)
@@ -903,6 +906,8 @@ static void add_samples_to_oprofile(unsigned int cpu, unsigned long *sdbt,
rcu_read_unlock();
} else {
/* kernelspace sample */
+ if (!counter_config.kernel)
+ goto skip_sample;
regs = task_pt_regs(current);
}
@@ -910,7 +915,7 @@ static void add_samples_to_oprofile(unsigned int cpu, unsigned long *sdbt,
oprofile_add_ext_hw_sample(sample_data_ptr->ia, regs, 0,
!sample_data_ptr->P, tsk);
mutex_unlock(&hws_sem);
-
+ skip_sample:
sample_data_ptr++;
}
}