]> sourceware.org Git - systemtap.git/commitdiff
_stp_get_mm_counter: Fix kernel version check.
authorMark Wielaard <mjw@redhat.com>
Thu, 1 Dec 2011 19:26:19 +0000 (20:26 +0100)
committerMark Wielaard <mjw@redhat.com>
Thu, 1 Dec 2011 19:26:19 +0000 (20:26 +0100)
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

index 114af193dd8e6915be9f1491e6b9fa25aa67dc27..045e59912b51fc9821388ae145e53788cd390c9e 100644 (file)
@@ -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<linux/sched.h>")->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<linux/sched.h>")->rss_stat->count[member])
 %:
This page took 0.030239 seconds and 5 git commands to generate.