aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/oprofile
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2011-06-22 10:24:08 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-06-22 10:24:20 -0400
commitb530ce7a1af5a9355be518557d86b33c6d2cf088 (patch)
tree6c648c5f2085976be8d53afbad60696288296bec /arch/s390/oprofile
parent80629b0b0fd5ca868dc8eced28e6101e39ac2ef6 (diff)
[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 <borntraeger@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/oprofile')
-rw-r--r--arch/s390/oprofile/init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c
index 5995e9bc72d9..5e2ab03eaffd 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)
151 if (oprofile_max_interval == 0) 151 if (oprofile_max_interval == 0)
152 return -ENODEV; 152 return -ENODEV;
153 153
154 /* The initial value should be sane */
155 if (oprofile_hw_interval < oprofile_min_interval)
156 oprofile_hw_interval = oprofile_min_interval;
157 if (oprofile_hw_interval > oprofile_max_interval)
158 oprofile_hw_interval = oprofile_max_interval;
159
154 if (oprofile_timer_init(ops)) 160 if (oprofile_timer_init(ops))
155 return -ENODEV; 161 return -ENODEV;
156 162