From b530ce7a1af5a9355be518557d86b33c6d2cf088 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Wed, 22 Jun 2011 16:24:08 +0200 Subject: [S390] s390: enforce HW limits for the initial sampling rate On specific configurations with hwsampler opcontrol --start returns an error on "echo 1 >/dev/oprofile/enable". Turns out that the hw sampling interval is not checked against the hardware limits. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/oprofile/init.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/s390/oprofile') diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 5995e9bc72d..5e2ab03eaff 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c @@ -151,6 +151,12 @@ static int oprofile_hwsampler_init(struct oprofile_operations *ops) if (oprofile_max_interval == 0) return -ENODEV; + /* The initial value should be sane */ + if (oprofile_hw_interval < oprofile_min_interval) + oprofile_hw_interval = oprofile_min_interval; + if (oprofile_hw_interval > oprofile_max_interval) + oprofile_hw_interval = oprofile_max_interval; + if (oprofile_timer_init(ops)) return -ENODEV; -- cgit v1.2.3 From 6815823431296082fa20c2f14007e194424660b8 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Wed, 22 Jun 2011 16:24:09 +0200 Subject: [S390] hwsampler: Set a sane default sampling rate The sampling interval for the hardware sampler is specified in cycles. (see SA23-2260-01 The Load-Program-Parameter and the CPU-Measurement Facilities) The current default value will therefore result in millions of samples. This patch changes the default sampling interval to 4M, which will result in ~1500 samples per second on a z196 reducing the overhead of sampling. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/oprofile/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/s390/oprofile') diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 5e2ab03eaff..0e358c2cffe 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c @@ -25,7 +25,7 @@ extern void s390_backtrace(struct pt_regs * const regs, unsigned int depth); #include "hwsampler.h" -#define DEFAULT_INTERVAL 4096 +#define DEFAULT_INTERVAL 4127518 #define DEFAULT_SDBT_BLOCKS 1 #define DEFAULT_SDB_BLOCKS 511 -- cgit v1.2.3