summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.maps/pmap_agg_overflow.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.maps/pmap_agg_overflow.stp')
-rwxr-xr-xtestsuite/systemtap.maps/pmap_agg_overflow.stp14
1 files changed, 10 insertions, 4 deletions
diff --git a/testsuite/systemtap.maps/pmap_agg_overflow.stp b/testsuite/systemtap.maps/pmap_agg_overflow.stp
index aa54c6a9..314cf13b 100755
--- a/testsuite/systemtap.maps/pmap_agg_overflow.stp
+++ b/testsuite/systemtap.maps/pmap_agg_overflow.stp
@@ -1,20 +1,26 @@
# try to induce overflow of pmap aggregation
# (this will only work on smp machines)
-global stat, count, max_count
+global stat, count, pcpu_count, max_count
probe begin {
if (num_online_cpus() < 2) {
warn("This test only applies to smp systems...")
exit()
}
- max_count = num_online_cpus() * max_map_entries()
+ max_count = max_map_entries() + 1
}
probe kernel.function("scheduler_tick") {
+ # Be sure not to overflow the percpu array
+ if (++pcpu_count[cpu()] > max_map_entries())
+ next
+
i = ++count
- if (i >= max_count) exit()
- stat[i] <<< i
+ if (i <= max_count)
+ stat[i] <<< i
+ else
+ exit()
}
probe end {