Skip to content

Commit

Permalink
[S390] s390: enforce HW limits for the initial sampling rate
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Borntraeger authored and Martin Schwidefsky committed Jun 22, 2011
1 parent 80629b0 commit b530ce7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/s390/oprofile/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b530ce7

Please sign in to comment.