From cb1fb1e7aec8f68a13301d046c19e9f7886f347b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 1 Dec 2011 20:26:19 +0100 Subject: [PATCH] _stp_get_mm_counter: Fix kernel version check. The kernel version check was wrong in two ways. First it tested against kernel_v >= "3.1.0" but linux commit 172703 "mm: delete non-atomic mm counter implementation" was actually integrated for 3.0. But fedora names their 3.0 kernels 2.6.40 (and 3.1 kernels 2.6.41, depending on release). So change the test to kernel_v >= "2.6.40". The reason this wasn't found earlier was that there is another check for CONFIG_NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS which is almost always true (but not on arm tegra kernels). --- tapset/proc_mem.stp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tapset/proc_mem.stp b/tapset/proc_mem.stp index 114af193d..045e59912 100644 --- a/tapset/proc_mem.stp +++ b/tapset/proc_mem.stp @@ -65,9 +65,9 @@ function _MM_ANONPAGES:long() function _stp_get_mm_counter:long(mm:long, member:long) { - /* kernels >= 2.6.34, 3.1 and later always use atomics */ + /* kernels >= 2.6.34, 3.0 (2.6.40 fedora) and later always use atomics */ if (@defined(&@cast(mm, "mm_struct", "kernel")->rss_stat)) { -%( kernel_v >= "3.1.0" || CONFIG_NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS %? +%( kernel_v >= "2.6.40" || CONFIG_NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS %? val = atomic_long_read(&@cast(mm, "mm_struct", "kernel")->rss_stat->count[member]) %: -- 2.43.5