Blame SOURCES/rhbz1547238.patch

030205
commit e40b26c5bbaab6fc8068fe5c111bdfeff0963408
030205
Author: Paulo Andrade <pandrade@redhat.com>
030205
Date:   Tue Jun 12 18:48:26 2018 -0400
030205
030205
    rhbz1547238: adapt vfs.add_to_page_cache probes
030205
    
030205
    The add_to_page_cache_lru variant should also be probed, along with
030205
    kernel.function("add_to_page_cache_locked"), but if present, not the
030205
    add_to_page_cache variant.  This backward compatibility needed a
030205
    little bit of tapset probe point operator jiujitsu to go beyond
030205
    Paulo's initial patch.
030205
030205
diff --git a/tapset/linux/vfs.stp b/tapset/linux/vfs.stp
030205
index 6f5fe77..1fe71ae 100644
030205
--- a/tapset/linux/vfs.stp
030205
+++ b/tapset/linux/vfs.stp
030205
@@ -908,9 +908,16 @@ probe __vfs.ext4_mpage_readpages.return =
030205
 	size = @entry($nr_pages)
030205
 }
030205
 
030205
+
030205
+/* newer style */
030205
+probe vfs.__add_to_page_cache =
030205
+	kernel.function("add_to_page_cache_locked"),
030205
+	kernel.function("add_to_page_cache_lru")
030205
+     { }
030205
+
030205
 probe vfs.add_to_page_cache =
030205
-	kernel.function("add_to_page_cache_locked") !,
030205
-	kernel.function("add_to_page_cache")
030205
+	vfs.__add_to_page_cache !,
030205
+	kernel.function("add_to_page_cache")  /* older style */
030205
 {
030205
 	dev = $mapping->host->i_sb->s_dev
030205
 	devname = __find_bdevname(dev, $mapping->host->i_sb->s_bdev)
030205
@@ -925,9 +932,16 @@ probe vfs.add_to_page_cache =
030205
 	argstr = sprintf("%d, %d", ino, $offset)
030205
 }
030205
 
030205
+
030205
+/* newer style */
030205
+probe vfs.__add_to_page_cache.return =
030205
+	kernel.function("add_to_page_cache_locked").return,
030205
+	kernel.function("add_to_page_cache_lru").return
030205
+     { }
030205
+
030205
 probe vfs.add_to_page_cache.return =
030205
-	kernel.function("add_to_page_cache_locked").return !,
030205
-	kernel.function("add_to_page_cache").return
030205
+	vfs.__add_to_page_cache.return !,
030205
+	kernel.function("add_to_page_cache").return  /* older style */
030205
 {
030205
 	name = "vfs.add_to_page_cache"
030205
 	retstr = sprintf("%d", $return)
030205
diff --git a/testsuite/semok/vfs_add_to_page_cache.stp b/testsuite/semok/vfs_add_to_page_cache.stp
030205
new file mode 100755
030205
index 0000000..5edea75
030205
--- /dev/null
030205
+++ b/testsuite/semok/vfs_add_to_page_cache.stp
030205
@@ -0,0 +1,4 @@
030205
+#! stap -p2
030205
+
030205
+probe vfs.add_to_page_cache { println(name, argstr) }
030205
+probe vfs.add_to_page_cache.return { println(name, retstr) }