projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[S390] hwsampler: Set a sane default sampling rate
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
arch
/
s390
/
oprofile
/
init.c
diff --git
a/arch/s390/oprofile/init.c
b/arch/s390/oprofile/init.c
index
5995e9b
..
0e358c2
100644
(file)
--- 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"
#include "hwsampler.h"
-#define DEFAULT_INTERVAL 4
096
+#define DEFAULT_INTERVAL 4
127518
#define DEFAULT_SDBT_BLOCKS 1
#define DEFAULT_SDB_BLOCKS 511
#define DEFAULT_SDBT_BLOCKS 1
#define DEFAULT_SDB_BLOCKS 511
@@
-151,6
+151,12
@@
static int oprofile_hwsampler_init(struct oprofile_operations *ops)
if (oprofile_max_interval == 0)
return -ENODEV;
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;
if (oprofile_timer_init(ops))
return -ENODEV;