As mjw's aborted commit
5ab0b1b6 attempted, we can use a @cast to get
the filesystem root for the current task instead of embedded-C. I've
left it using the kernel debuginfo instead of headers for now, because
all of the neighboring @casts are doing the same.
* tapset/dentry.stp (d_path): Use @cast to get the root.
(__dentry_get_current_root): Remove, no longer needed.
* testsuite/buildok/dentry.stp: Test that dentry's functions all build.
-%{
-#include <linux/sched.h>
-#include <linux/fs_struct.h>
-%}
-
-
-function __dentry_get_current_root:long()
-%{
- THIS->__retvalue = (long)¤t->fs->root;
-%}
-
-
-
-
/**
* sfunction d_name - get the dirent name
*
*/
function d_path:string(nd:long)
{
- root = __dentry_get_current_root()
+ root = & @cast(task_current(), "task_struct")->fs->root
dentry = (@defined(@cast(nd,"nameidata")->path->dentry)
? @cast(nd,"nameidata")->path->dentry
: @cast(nd,"nameidata")->dentry)
--- /dev/null
+#! stap -p4
+
+probe begin
+{
+ println(d_name(0))
+ println(d_path(0))
+ println(reverse_path_walk(0))
+}