Blame SOURCES/rhbz1855264.patch

fce8b1
commit 0a281a96ddf7cae9a0f0cc0eb505a752ffdd932e
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Tue Jun 16 16:02:11 2020 -0400
fce8b1
fce8b1
    Make sizeof.stp runnable with the bpf backend.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.examples/general/sizeof.meta b/testsuite/systemtap.examples/general/sizeof.meta
fce8b1
index 29713e4..b30078d 100644
fce8b1
--- a/testsuite/systemtap.examples/general/sizeof.meta
fce8b1
+++ b/testsuite/systemtap.examples/general/sizeof.meta
fce8b1
@@ -2,7 +2,7 @@ title: Print the Size of a C Type
fce8b1
 name: sizeof.stp
fce8b1
 version: 1.0
fce8b1
 author: anonymous
fce8b1
-keywords: statistics memory
fce8b1
+keywords: statistics memory bpf
fce8b1
 subsystem: any
fce8b1
 status: proposed
fce8b1
 exit: event-ended
fce8b1
@@ -11,3 +11,5 @@ scope: system-wide
fce8b1
 description: This script prints the size of a type, based on dwarf debuginfo for any kernel or userspace module, or trial-compilation of a given header file name.
fce8b1
 test_check: stap -p4 sizeof.stp task_struct 'kernel<include/linux/sched.h>'
fce8b1
 test_installcheck: stap sizeof.stp FILE '</usr/include/stdio.h>'
fce8b1
+test_check_bpf: stap -p4 --bpf sizeof.stp task_struct 'kernel<include/linux/sched.h>'
fce8b1
+test_installcheck_bpf: stap --bpf sizeof.stp FILE '</usr/include/stdio.h>'
fce8b1
diff --git a/testsuite/systemtap.examples/general/sizeof.stp b/testsuite/systemtap.examples/general/sizeof.stp
fce8b1
index 0c77dce..5aec674 100755
fce8b1
--- a/testsuite/systemtap.examples/general/sizeof.stp
fce8b1
+++ b/testsuite/systemtap.examples/general/sizeof.stp
fce8b1
@@ -7,9 +7,11 @@
fce8b1
 #          sizeof.stp TYPENAME </usr/include/someheader.h>
fce8b1
 
fce8b1
 probe oneshot {
fce8b1
-  println("type ", @1, 
fce8b1
-          %( $# > 1 %? " in ", @2, %)   /* module or header file name */
fce8b1
-          " byte-size: ",
fce8b1
-          %( $# > 1 %? @cast_module_sizeof(@2, @1) %: @cast_sizeof(@1) %)
fce8b1
-          )
fce8b1
+  %( $# > 1 %?
fce8b1
+     printf("type %s in %s byte-size: %d\n", @1, @2,
fce8b1
+	    @cast_module_sizeof(@2, @1))
fce8b1
+  %:
fce8b1
+     printf("type %s byte-size: %d\n", @1,
fce8b1
+	    @cast_sizeof(@1))
fce8b1
+  %)
fce8b1
 }
fce8b1
commit 2b2b6a622dc1d434c60d0ea159b260f660068ad1
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Wed Jun 17 11:57:18 2020 -0400
fce8b1
fce8b1
    Fix sizeof.stp to explicitly use kernel debuginfo if one not specified
fce8b1
    
fce8b1
    Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
fce8b1
    operations work and they no longer default to using the kernel
fce8b1
    debuginfo for type information.  Need to use the @cast_module_sizeof()
fce8b1
    instead of @cast_size() to use the kernel debuginfo.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.examples/general/sizeof.stp b/testsuite/systemtap.examples/general/sizeof.stp
fce8b1
index 5aec674..b45f593 100755
fce8b1
--- a/testsuite/systemtap.examples/general/sizeof.stp
fce8b1
+++ b/testsuite/systemtap.examples/general/sizeof.stp
fce8b1
@@ -12,6 +12,6 @@ probe oneshot {
fce8b1
 	    @cast_module_sizeof(@2, @1))
fce8b1
   %:
fce8b1
      printf("type %s byte-size: %d\n", @1,
fce8b1
-	    @cast_sizeof(@1))
fce8b1
+	    @cast_module_sizeof("kernel", @1))
fce8b1
   %)
fce8b1
 }
fce8b1
fce8b1
commit 717b7dddd08b66b3caa5585221472d84e40be658
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Wed Jun 17 13:08:30 2020 -0400
fce8b1
fce8b1
    Use explicit @cast() operators to fslatency-nd.stp and fsslower-nd.stp
fce8b1
    
fce8b1
    Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
fce8b1
    operations work and they no longer default to using the kernel
fce8b1
    debuginfo for type information.  Need to include kernel as location for
fce8b1
    this information for the  @cast() rather than just assuming a default.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.examples/lwtools/fslatency-nd.stp b/testsuite/systemtap.examples/lwtools/fslatency-nd.stp
fce8b1
index 6008399..0bee34f 100755
fce8b1
--- a/testsuite/systemtap.examples/lwtools/fslatency-nd.stp
fce8b1
+++ b/testsuite/systemtap.examples/lwtools/fslatency-nd.stp
fce8b1
@@ -63,8 +63,8 @@ probe __vfs_read = kprobe.function("__vfs_read")
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_read() wouldn't be called.
fce8b1
 	file = pointer_arg(1)
fce8b1
-	if (!file || @cast(file, "file")->f_op->read
fce8b1
-	    || !@cast(file, "file")->f_op->read_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->read
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->read_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
 
fce8b1
@@ -75,8 +75,8 @@ probe __vfs_write = kprobe.function("__vfs_write")
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_write() wouldn't be called.
fce8b1
 	file = pointer_arg(1)
fce8b1
-	if (!file || @cast(file, "file")->f_op->write
fce8b1
-	    || !@cast(file, "file")->f_op->write_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->write
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->write_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
 
fce8b1
@@ -102,8 +102,8 @@ probe __vfs_read.return = kprobe.function("__vfs_read").return
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_read() wouldn't be called.
fce8b1
 	file = @entry(pointer_arg(1))
fce8b1
-	if (!file || @cast(file, "file")->f_op->read
fce8b1
-	    || !@cast(file, "file")->f_op->read_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->read
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->read_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
 
fce8b1
@@ -115,8 +115,8 @@ probe __vfs_write.return = kprobe.function("__vfs_write")
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_write() wouldn't be called.
fce8b1
 	file = pointer_arg(1)
fce8b1
-	if (!file || @cast(file, "file")->f_op->write
fce8b1
-	    || !@cast(file, "file")->f_op->write_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->write
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->write_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
 
fce8b1
diff --git a/testsuite/systemtap.examples/lwtools/fsslower-nd.stp b/testsuite/systemtap.examples/lwtools/fsslower-nd.stp
fce8b1
index 64abe41..90fa9b5 100755
fce8b1
--- a/testsuite/systemtap.examples/lwtools/fsslower-nd.stp
fce8b1
+++ b/testsuite/systemtap.examples/lwtools/fsslower-nd.stp
fce8b1
@@ -65,8 +65,8 @@ probe __vfs_read = kprobe.function("__vfs_read")
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_read() wouldn't be called.
fce8b1
 	file = pointer_arg(1)
fce8b1
-	if (!file || @cast(file, "file")->f_op->read
fce8b1
-	    || !@cast(file, "file")->f_op->read_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->read
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->read_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
 
fce8b1
@@ -77,8 +77,8 @@ probe __vfs_write = kprobe.function("__vfs_write")
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_write() wouldn't be called.
fce8b1
 	file = pointer_arg(1)
fce8b1
-	if (!file || @cast(file, "file")->f_op->write
fce8b1
-	    || !@cast(file, "file")->f_op->write_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->write
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->write_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
 
fce8b1
@@ -110,8 +110,8 @@ probe __vfs_read.return = kprobe.function("__vfs_read").return
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_read() wouldn't be called.
fce8b1
 	file = @entry(pointer_arg(1))
fce8b1
-	if (!file || @cast(file, "file")->f_op->read
fce8b1
-	    || !@cast(file, "file")->f_op->read_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->read
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->read_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
 
fce8b1
@@ -123,7 +123,7 @@ probe __vfs_write.return = kprobe.function("__vfs_write")
fce8b1
 {
fce8b1
 	# Skip the call if new_sync_write() wouldn't be called.
fce8b1
 	file = pointer_arg(1)
fce8b1
-	if (!file || @cast(file, "file")->f_op->write
fce8b1
-	    || !@cast(file, "file")->f_op->write_iter)
fce8b1
+	if (!file || @cast(file, "file", "kernel")->f_op->write
fce8b1
+	    || !@cast(file, "file", "kernel")->f_op->write_iter)
fce8b1
 		next
fce8b1
 }
fce8b1
fce8b1
commit 9eb37102d48b814821b7f474986a7bfe86784192
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Wed Jun 17 13:39:20 2020 -0400
fce8b1
fce8b1
    Use explicit @cast() operators for pfiles.stp and ioctl_handler.stp
fce8b1
    
fce8b1
    Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
fce8b1
    operations work and they no longer default to using the kernel
fce8b1
    debuginfo for type information.  Need to include kernel as location for
fce8b1
    this information for the  @cast() rather than just assuming a default.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.examples/process/pfiles.stp b/testsuite/systemtap.examples/process/pfiles.stp
fce8b1
index d52a154..6344a4c 100755
fce8b1
--- a/testsuite/systemtap.examples/process/pfiles.stp
fce8b1
+++ b/testsuite/systemtap.examples/process/pfiles.stp
fce8b1
@@ -787,9 +787,9 @@ function print_unix_socket(sock) {
fce8b1
 		strlen(peername) > 0 ? peername . "\n" : "")
fce8b1
         try { # skip line in case of null pointers
fce8b1
 	printf("        peercred pid: %d\n",
fce8b1
-            @defined(@cast(sock, "socket")->sk->sk_peer_pid) ?
fce8b1
-	    @cast(sock, "socket")->sk->sk_peer_pid->numbers[0]->nr :
fce8b1
-	    @cast(sock, "socket")->sk->sk_peercred->pid ); } catch { }
fce8b1
+            @defined(@cast(sock, "socket", "kernel")->sk->sk_peer_pid) ?
fce8b1
+	    @cast(sock, "socket", "kernel")->sk->sk_peer_pid->numbers[0]->nr :
fce8b1
+	    @cast(sock, "socket", "kernel")->sk->sk_peercred->pid ); } catch { }
fce8b1
 }
fce8b1
 
fce8b1
 function print_ipv4_socket(sock) {
fce8b1
diff --git a/testsuite/systemtap.examples/profiling/ioctl_handler.stp b/testsuite/systemtap.examples/profiling/ioctl_handler.stp
fce8b1
index 7044185..6f1e52c 100755
fce8b1
--- a/testsuite/systemtap.examples/profiling/ioctl_handler.stp
fce8b1
+++ b/testsuite/systemtap.examples/profiling/ioctl_handler.stp
fce8b1
@@ -9,7 +9,7 @@ probe syscall.ioctl {
fce8b1
   ioctl_requests[execname()] <<< 1
fce8b1
   try {
fce8b1
     # Dig down through the task struct to find the actual function handling ioctl.
fce8b1
-    ioctl_func_address = @cast(task_current(), "struct task_struct")->files->fdt->fd[fd]->f_op->unlocked_ioctl
fce8b1
+    ioctl_func_address = @cast(task_current(), "struct task_struct", "kernel")->files->fdt->fd[fd]->f_op->unlocked_ioctl
fce8b1
     if (ioctl_func_address)
fce8b1
       ioctl_func[execname(), ioctl_func_address] <<< 1
fce8b1
   } catch {
fce8b1
fce8b1
commit 3040d4e8ddb6a9b1d1a57a0185206498670c3f1a
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Wed Jun 17 13:53:58 2020 -0400
fce8b1
fce8b1
    Use explicit @cast() operators for stapgames/pingpong.stp tapset.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.examples/stapgames/tapset/gmtty.stp b/testsuite/systemtap.examples/stapgames/tapset/gmtty.stp
fce8b1
index 026e4a9..f6ad2db 100644
fce8b1
--- a/testsuite/systemtap.examples/stapgames/tapset/gmtty.stp
fce8b1
+++ b/testsuite/systemtap.examples/stapgames/tapset/gmtty.stp
fce8b1
@@ -10,12 +10,12 @@ global GM_tty_ws_row, GM_tty_ws_col, GM_tty_name
fce8b1
 # Initialize current TTY -- must be called from begin
fce8b1
 function game_tty_init:long ()
fce8b1
 {
fce8b1
-	tty = @cast(task_current(), "task_struct")->signal->tty
fce8b1
+	tty = @cast(task_current(), "task_struct", "kernel")->signal->tty
fce8b1
 	if (tty) {
fce8b1
-		namep = @cast(tty,"tty_struct")->name
fce8b1
+		namep = @cast(tty,"tty_struct", "kernel")->name
fce8b1
 		GM_tty_name = kernel_string(namep)
fce8b1
-		GM_tty_ws_col = @cast(tty, "tty_struct")->winsize->ws_col
fce8b1
-		GM_tty_ws_row = @cast(tty, "tty_struct")->winsize->ws_row
fce8b1
+		GM_tty_ws_col = @cast(tty, "tty_struct", "kernel")->winsize->ws_col
fce8b1
+		GM_tty_ws_row = @cast(tty, "tty_struct", "kernel")->winsize->ws_row
fce8b1
 	}
fce8b1
 	return tty
fce8b1
 }
fce8b1
fce8b1
commit 3d922919dbe5657becf48917f1c661bf6711e956
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Thu Jun 18 13:32:50 2020 -0400
fce8b1
fce8b1
    Use explicit @cast() operators for periodic.stp
fce8b1
    
fce8b1
    Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
fce8b1
    operations work and they no longer default to using the kernel
fce8b1
    debuginfo for type information.  Need to include kernel as location for
fce8b1
    this information for the  @cast() rather than just assuming a default.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.examples/profiling/periodic.stp b/testsuite/systemtap.examples/profiling/periodic.stp
fce8b1
index f18f183..b9052e5 100755
fce8b1
--- a/testsuite/systemtap.examples/profiling/periodic.stp
fce8b1
+++ b/testsuite/systemtap.examples/profiling/periodic.stp
fce8b1
@@ -18,8 +18,8 @@ probe kernel.trace("timer_expire_entry")
fce8b1
     period[$timer] <<< elapsed
fce8b1
     funct[$timer] = $timer->function
fce8b1
     data[$timer] = @defined($timer->data) ? $timer->data : 0
fce8b1
-    proc_info[$timer] = @defined($timer->data) ? 0 : @container_of($timer, "struct process_timer", timer)->task
fce8b1
-    delayed_work_info[$timer] = @defined($timer->data) ? 0 : & @container_of($timer, "struct delayed_work", timer)
fce8b1
+    proc_info[$timer] = @defined($timer->data) ? 0 : @module_container_of($timer, "kernel", "struct process_timer", timer)->task
fce8b1
+    delayed_work_info[$timer] = @defined($timer->data) ? 0 : & @module_container_of($timer, "kernel", "struct delayed_work", timer)
fce8b1
   }
fce8b1
   last_expire[$timer] = new_expire
fce8b1
 }
fce8b1
fce8b1
commit b2d18cb3afca76536506fe4992fdd6ef091ce82f
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Thu Jun 18 15:01:40 2020 -0400
fce8b1
fce8b1
    Use explicit @cast() operators for semop-watch.stp example.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.examples/process/semop-watch.stp b/testsuite/systemtap.examples/process/semop-watch.stp
fce8b1
index ca2bf0a..bf1d632 100755
fce8b1
--- a/testsuite/systemtap.examples/process/semop-watch.stp
fce8b1
+++ b/testsuite/systemtap.examples/process/semop-watch.stp
fce8b1
@@ -3,7 +3,7 @@ global times;
fce8b1
 
fce8b1
 probe syscall.{semop,semtimedop}
fce8b1
 {
fce8b1
-  sembuf_sz = @cast_sizeof("struct sembuf");
fce8b1
+  sembuf_sz = @cast_module_sizeof("kernel", "struct sembuf");
fce8b1
   res = sprintf("set %d sems", semid)
fce8b1
 
fce8b1
   %( systemtap_v < "2.3" %? 
fce8b1
@@ -14,7 +14,7 @@ probe syscall.{semop,semtimedop}
fce8b1
   for(i = 0; i < nsops; i++) {
fce8b1
     offset = i * sembuf_sz;
fce8b1
     pointer = sops_uaddr + offset;
fce8b1
-    num_addr = & @cast(pointer, "struct sembuf")->sem_num;
fce8b1
+    num_addr = & @cast(pointer, "struct sembuf", "kernel")->sem_num;
fce8b1
     num = user_short(num_addr);
fce8b1
 
fce8b1
     res = sprintf("%s %d", res, num);
fce8b1
fce8b1
commit a948c291c9cd7320d3c9b18b5037908cbbdf70b7
fce8b1
Author: William Cohen <wcohen@redhat.com>
fce8b1
Date:   Mon Jun 22 11:28:32 2020 -0400
fce8b1
fce8b1
    Use explicit @cast() operators pointing to kernel for tapsets
fce8b1
    
fce8b1
    Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
fce8b1
    operations work and they no longer default to using the kernel
fce8b1
    debuginfo for type information.  Need to include kernel as location for
fce8b1
    this information for the  @cast() rather than just assuming a default.
fce8b1
fce8b1
diff --git a/tapset/linux/dentry.stp b/tapset/linux/dentry.stp
fce8b1
index 4e73532..d148c57 100644
fce8b1
--- a/tapset/linux/dentry.stp
fce8b1
+++ b/tapset/linux/dentry.stp
fce8b1
@@ -28,7 +28,7 @@
fce8b1
 
fce8b1
 @__private30 function __dentry_IS_ROOT:long(dentry:long)
fce8b1
 {
fce8b1
-        return (@cast(dentry, "dentry")->d_parent == dentry)
fce8b1
+        return (@cast(dentry, "dentry", "kernel")->d_parent == dentry)
fce8b1
 }
fce8b1
 
fce8b1
 
fce8b1
@@ -61,7 +61,7 @@
fce8b1
  */
fce8b1
 function d_name:string(dentry:long)
fce8b1
 {
fce8b1
-        s = & @cast(dentry, "dentry")->d_name;
fce8b1
+        s = & @cast(dentry, "dentry", "kernel")->d_name;
fce8b1
         return kernel_string_n(s->name, s->len);
fce8b1
 }
fce8b1
 
fce8b1
@@ -70,8 +70,8 @@ function d_name:string(dentry:long)
fce8b1
 {
fce8b1
         /* i_dentry is an hlist_head on 3.6+, or a list_head before that.  */
fce8b1
         d_alias = @choose_defined(
fce8b1
-                        @cast(inode, "struct inode")->i_dentry->first,
fce8b1
-                        @cast(inode, "struct inode")->i_dentry->next)
fce8b1
+                        @cast(inode, "struct inode", "kernel")->i_dentry->first,
fce8b1
+                        @cast(inode, "struct inode", "kernel")->i_dentry->next)
fce8b1
 
fce8b1
 	if (@type_member_defined("struct dentry", d_alias)) {
fce8b1
         	return & @container_of(d_alias, "struct dentry", d_alias)
fce8b1
@@ -86,8 +86,8 @@ function d_name:string(dentry:long)
fce8b1
 {
fce8b1
         /* s_mounts was added in kernel 3.6, commit b3d9b7a3c.  */
fce8b1
         if (@type_member_defined("struct super_block", s_mounts)) {
fce8b1
-                mnt_ns = @cast(task_current(), "struct task_struct")->nsproxy->mnt_ns
fce8b1
-                sb = @cast(inode, "struct inode")->i_sb
fce8b1
+                mnt_ns = @cast(task_current(), "struct task_struct", "kernel<linux/sched.h>")->nsproxy->mnt_ns
fce8b1
+                sb = @cast(inode, "struct inode", "kernel")->i_sb
fce8b1
 
fce8b1
                 /* Look for the mount which matches the current namespace */
fce8b1
                 head = &sb->s_mounts
fce8b1
@@ -141,7 +141,7 @@ function reverse_path_walk:string(dentry:long)
fce8b1
 {
fce8b1
         while(1) {
fce8b1
                 name = __dentry_prepend(dentry, name);
fce8b1
-                dentry = @cast(dentry, "dentry")->d_parent;
fce8b1
+                dentry = @cast(dentry, "dentry", "kernel")->d_parent;
fce8b1
                 if (__dentry_IS_ROOT(dentry))
fce8b1
                         return name;
fce8b1
         }
fce8b1
@@ -209,8 +209,8 @@ function task_dentry_path:string(task:long,dentry:long,vfsmnt:long)
fce8b1
 	 * dentry == vfsmnt->mnt_root.  In that case, we'll just go
fce8b1
 	 * ahead and handle them normally.
fce8b1
 	 */
fce8b1
-	dentry = & @cast(dentry, "dentry")
fce8b1
-	vfsmnt = & @cast(vfsmnt, "vfsmount")
fce8b1
+	dentry = & @cast(dentry, "dentry", "kernel")
fce8b1
+	vfsmnt = & @cast(vfsmnt, "vfsmount", "kernel")
fce8b1
 
fce8b1
 	if (@type_member_defined("dentry", d_op->d_dname)
fce8b1
 	    && dentry->d_op && dentry->d_op->d_dname
fce8b1
@@ -230,7 +230,7 @@ function task_dentry_path:string(task:long,dentry:long,vfsmnt:long)
fce8b1
 			return sprintf("ANON_INODE:%s", d_name(dentry))
fce8b1
 		}
fce8b1
 		else if (vfsmnt->mnt_sb->s_magic == @const("NSFS_MAGIC")) {
fce8b1
-			ns_ops = &@cast(dentry->d_fsdata, "proc_ns_operations")
fce8b1
+			ns_ops = &@cast(dentry->d_fsdata, "proc_ns_operations", "kernel")
fce8b1
 			return sprintf("%s:[%lu]", kernel_string(ns_ops->name),
fce8b1
 				       dentry->d_inode->i_ino)
fce8b1
 		}
fce8b1
@@ -239,16 +239,16 @@ function task_dentry_path:string(task:long,dentry:long,vfsmnt:long)
fce8b1
 
fce8b1
 	# Handle old-school vs. new-school fs_structs.
fce8b1
 	if (@type_member_defined("fs_struct", rootmnt)) {
fce8b1
-		root_dentry = & @cast(task, "task_struct")->fs->root
fce8b1
-		root_vfsmnt = & @cast(task, "task_struct")->fs->rootmnt
fce8b1
+		root_dentry = & @cast(task, "task_struct", "kernel")->fs->root
fce8b1
+		root_vfsmnt = & @cast(task, "task_struct", "kernel")->fs->rootmnt
fce8b1
 	}
fce8b1
 	else {
fce8b1
-		root_dentry = @cast(task, "task_struct")->fs->root->dentry
fce8b1
-		root_vfsmnt = @cast(task, "task_struct")->fs->root->mnt
fce8b1
+		root_dentry = @cast(task, "task_struct", "kernel")->fs->root->dentry
fce8b1
+		root_vfsmnt = @cast(task, "task_struct", "kernel")->fs->root->mnt
fce8b1
 	}
fce8b1
 
fce8b1
 	if (@type_member_defined("mount", mnt_parent)) {
fce8b1
-		mnt = &@cast(real_mount(vfsmnt), "mount")
fce8b1
+		mnt = &@cast(real_mount(vfsmnt), "mount", "kernel")
fce8b1
 		if (mnt == 0)
fce8b1
 			return "<unknown>"
fce8b1
 	}
fce8b1
@@ -305,10 +305,10 @@ function task_dentry_path:string(task:long,dentry:long,vfsmnt:long)
fce8b1
  */
fce8b1
 function d_path:string(nd:long)
fce8b1
 {
fce8b1
-	dentry = @choose_defined(@cast(nd,"nameidata")->path->dentry,
fce8b1
-			         @cast(nd,"nameidata")->dentry)
fce8b1
-	vfsmnt = @choose_defined(@cast(nd,"nameidata")->path->mnt,
fce8b1
-			         @cast(nd,"nameidata")->mnt)
fce8b1
+	dentry = @choose_defined(@cast(nd,"nameidata", "kernel")->path->dentry,
fce8b1
+			         @cast(nd,"nameidata", "kernel")->dentry)
fce8b1
+	vfsmnt = @choose_defined(@cast(nd,"nameidata", "kernel")->path->mnt,
fce8b1
+			         @cast(nd,"nameidata", "kernel")->mnt)
fce8b1
 
fce8b1
 	return sprintf("%s/", task_dentry_path(task_current(), dentry, vfsmnt))
fce8b1
 }
fce8b1
@@ -353,8 +353,8 @@ function fullpath_struct_path:string(path:long)
fce8b1
 function fullpath_struct_file:string(task:long, file:long)
fce8b1
 {
fce8b1
   return task_dentry_path(task,
fce8b1
-			  @choose_defined(@cast(file, "file")->f_path->dentry,
fce8b1
-					  @cast(file, "file")->f_dentry),
fce8b1
-			  @choose_defined(@cast(file, "file")->f_path->mnt,
fce8b1
-					  @cast(file, "file")->f_vfsmnt))
fce8b1
+			  @choose_defined(@cast(file, "file", "kernel")->f_path->dentry,
fce8b1
+					  @cast(file, "file", "kernel")->f_dentry),
fce8b1
+			  @choose_defined(@cast(file, "file", "kernel")->f_path->mnt,
fce8b1
+					  @cast(file, "file", "kernel")->f_vfsmnt))
fce8b1
 }
fce8b1
diff --git a/tapset/linux/dev.stp b/tapset/linux/dev.stp
fce8b1
index 0232fc9..079ce1c 100644
fce8b1
--- a/tapset/linux/dev.stp
fce8b1
+++ b/tapset/linux/dev.stp
fce8b1
@@ -56,8 +56,8 @@ function usrdev2kerndev:long(dev:long)
fce8b1
 function disk_name:string(hd:long, partno:long)
fce8b1
 {
fce8b1
 	if (!partno)
fce8b1
-		return kernel_string(@cast(hd, "gendisk")->disk_name)
fce8b1
-	disk_name = kernel_string(@cast(hd, "gendisk")->disk_name)
fce8b1
+		return kernel_string(@cast(hd, "gendisk", "kernel")->disk_name)
fce8b1
+	disk_name = kernel_string(@cast(hd, "gendisk", "kernel")->disk_name)
fce8b1
 	if (isdigit(substr(disk_name, strlen(disk_name)-1, 1)))
fce8b1
 		return sprintf("%sp%d", disk_name, partno)
fce8b1
 	else
fce8b1
@@ -66,7 +66,7 @@ function disk_name:string(hd:long, partno:long)
fce8b1
 
fce8b1
 function bdevname:string(bdev:long)
fce8b1
 {
fce8b1
-	bdev = & @cast(bdev, "block_device")
fce8b1
+	bdev = & @cast(bdev, "block_device", "kernel")
fce8b1
 	if (bdev == 0)
fce8b1
 		return "N/A"
fce8b1
 
fce8b1
diff --git a/tapset/linux/ioblock.stp b/tapset/linux/ioblock.stp
fce8b1
index ad3603c..9d8f57b 100644
fce8b1
--- a/tapset/linux/ioblock.stp
fce8b1
+++ b/tapset/linux/ioblock.stp
fce8b1
@@ -107,12 +107,12 @@ function bio_rw_str(rw:long)
fce8b1
 @__private30 function __bio_start_sect:long(bio:long)
fce8b1
 {
fce8b1
     try {
fce8b1
-	if (@defined(@cast(bio, "bio")->bi_dev)) {
fce8b1
-	    return @cast(bio, "bio")->bi_bdev->bd_part->start_sect
fce8b1
+	if (@defined(@cast(bio, "bio", "kernel")->bi_dev)) {
fce8b1
+	    return @cast(bio, "bio", "kernel")->bi_bdev->bd_part->start_sect
fce8b1
 	}
fce8b1
-	else if (@defined(@cast(bio, "bio")->bi_disk)) {
fce8b1
- 	    return disk_get_part_start_sect(@cast(bio, "bio")->bi_disk,
fce8b1
-					    @cast(bio, "bio")->bi_partno)
fce8b1
+	else if (@defined(@cast(bio, "bio", "kernel")->bi_disk)) {
fce8b1
+	    return disk_get_part_start_sect(@cast(bio, "bio", "kernel")->bi_disk,
fce8b1
+					    @cast(bio, "bio", "kernel")->bi_partno)
fce8b1
 	}
fce8b1
     } catch {
fce8b1
         return -1
fce8b1
@@ -122,12 +122,12 @@ function bio_rw_str(rw:long)
fce8b1
 /* returns the block device name */
fce8b1
 @__private30 function __bio_devname:string(bio:long)
fce8b1
 {
fce8b1
-    if (@defined(@cast(bio, "bio")->bi_bdev)) {
fce8b1
-	return bdevname(@cast(bio, "bio")->bi_bdev)
fce8b1
+    if (@defined(@cast(bio, "bio", "kernel")->bi_bdev)) {
fce8b1
+	return bdevname(@cast(bio, "bio", "kernel")->bi_bdev)
fce8b1
     }
fce8b1
     else {
fce8b1
-	return disk_name(@cast(bio, "bio")->bi_disk,
fce8b1
-			 @cast(bio, "bio")->bi_partno)
fce8b1
+	return disk_name(@cast(bio, "bio", "kernel")->bi_disk,
fce8b1
+			 @cast(bio, "bio", "kernel")->bi_partno)
fce8b1
     }
fce8b1
 }
fce8b1
 
fce8b1
diff --git a/tapset/linux/task.stp b/tapset/linux/task.stp
fce8b1
index 4afc458..b542b61 100644
fce8b1
--- a/tapset/linux/task.stp
fce8b1
+++ b/tapset/linux/task.stp
fce8b1
@@ -40,7 +40,7 @@ function task_current:long () {
fce8b1
         return -1;
fce8b1
     }
fce8b1
     sig = @task(task)->signal;
fce8b1
-    return @cast(sig, "signal_struct")->rlim[nd_limit]->rlim_cur;
fce8b1
+    return @cast(sig, "signal_struct", "kernel")->rlim[nd_limit]->rlim_cur;
fce8b1
 }
fce8b1
 
fce8b1
 /* sfunction task_rlimit - The current resource limit of the task
fce8b1
fce8b1
commit 403e927796c3008ad5d5fed9bd97dc7cbad424bb
fce8b1
Author: Martin Cermak <mcermak@redhat.com>
fce8b1
Date:   Mon Jun 29 16:30:34 2020 +0200
fce8b1
fce8b1
    PR26181: Use explicit @cast() within get_ip_from_client()
fce8b1
    
fce8b1
    Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
fce8b1
    operations work and they no longer default to using the kernel
fce8b1
    debuginfo for type information.  Need to include kernel as location for
fce8b1
    this information for the  @cast() rather than just assuming a default.
fce8b1
    
fce8b1
    Also, fix the type of server_ip, which historically had been a long,
fce8b1
    but since systemtap_v >= "4.3", it is a string.
fce8b1
fce8b1
diff --git a/tapset/linux/nfs_proc.stp b/tapset/linux/nfs_proc.stp
fce8b1
index 8da3f6b..2579074 100644
fce8b1
--- a/tapset/linux/nfs_proc.stp
fce8b1
+++ b/tapset/linux/nfs_proc.stp
fce8b1
@@ -77,11 +77,11 @@ function get_ip_from_client:string(clnt:long)
fce8b1
 	 * inside that buffer. */
fce8b1
 	if (@cast(addr, "sockaddr")->sa_family
fce8b1
 		== @const("AF_INET")) {
fce8b1
-		return format_ipaddr(&@cast(addr, "sockaddr_in")->sin_addr->s_addr, @const("AF_INET"))
fce8b1
+		return format_ipaddr(&@cast(addr, "sockaddr_in", "kernel:sunrpc")->sin_addr->s_addr, @const("AF_INET"))
fce8b1
 	}
fce8b1
 	else if (@cast(addr, "sockaddr")->sa_family 
fce8b1
 		== @const("AF_INET6"))  {
fce8b1
-		return format_ipaddr(&@cast(addr, "sockaddr_in6")->sin6_addr, @const("AF_INET6"))
fce8b1
+		return format_ipaddr(&@cast(addr, "sockaddr_in6", "kernel:sunrpc")->sin6_addr, @const("AF_INET6"))
fce8b1
 	}
fce8b1
 	return ""	
fce8b1
 }
fce8b1
@@ -90,12 +90,12 @@ function get_ip_from_client:long(clnt:long)
fce8b1
 {
fce8b1
 	cl_xprt = @cast(clnt, "rpc_clnt", "kernel:sunrpc")->cl_xprt
fce8b1
         addr = &@cast(cl_xprt, "rpc_xprt", "kernel:sunrpc")->addr
fce8b1
-	if (@cast(addr, "sockaddr_in")->sin_family
fce8b1
+	if (@cast(addr, "sockaddr_in", "kernel:sunrpc")->sin_family
fce8b1
 		!= @const("AF_INET")) {
fce8b1
                /* Now consider ipv4 only */
fce8b1
                return 0
fce8b1
 	}
fce8b1
-	return @cast(addr, "sockaddr_in")->sin_addr->s_addr
fce8b1
+	return @cast(addr, "sockaddr_in", "kernel:sunrpc")->sin_addr->s_addr
fce8b1
 }
fce8b1
 %)
fce8b1
 
fce8b1
@@ -758,7 +758,11 @@ probe _nfs.proc2.missing_read_setup = never
fce8b1
 {
fce8b1
 	inode = 0
fce8b1
 	client = 0
fce8b1
+%( systemtap_v >= "4.3" %?
fce8b1
+	server_ip = "0"
fce8b1
+%:
fce8b1
 	server_ip = 0
fce8b1
+%)
fce8b1
 	prot = 0
fce8b1
 
fce8b1
 	count = 0
fce8b1
fce8b1
commit f1a9bb064d11319a7eca4f4233c9edcc4a03af7e
fce8b1
Author: Martin Cermak <mcermak@redhat.com>
fce8b1
Date:   Thu Jul 9 09:19:01 2020 +0200
fce8b1
fce8b1
    Tapset and testsuite updates against @cast() change 00ee19ff03
fce8b1
    
fce8b1
    Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
fce8b1
    operations work and they no longer default to using the kernel
fce8b1
    debuginfo for type information.  Need to include kernel as location for
fce8b1
    this information for the  @cast() rather than just assuming a default.
fce8b1
    
fce8b1
    These are respective tapset and testsuite minor updates.
fce8b1
fce8b1
diff --git a/tapset/linux/networking.stp b/tapset/linux/networking.stp
fce8b1
index 69843a7..0b52cbc 100644
fce8b1
--- a/tapset/linux/networking.stp
fce8b1
+++ b/tapset/linux/networking.stp
fce8b1
@@ -69,7 +69,7 @@
fce8b1
 
fce8b1
 /* A function that returns the device name given the net_device struct */
fce8b1
 function get_netdev_name:string (addr:long) {
fce8b1
-	return kernel_string(@cast(addr, "net_device")->name)
fce8b1
+	return kernel_string(@cast(addr, "net_device", "kernel")->name)
fce8b1
 }
fce8b1
 
fce8b1
 /**
fce8b1
diff --git a/tapset/linux/scsi.stp b/tapset/linux/scsi.stp
fce8b1
index 3577942..5359fe8 100644
fce8b1
--- a/tapset/linux/scsi.stp
fce8b1
+++ b/tapset/linux/scsi.stp
fce8b1
@@ -179,8 +179,8 @@ probe scsi.iocompleted
fce8b1
 
fce8b1
 function timer_pending:long(timer:long)
fce8b1
 {
fce8b1
-	return (@choose_defined(@cast(timer, "timer_list")->entry->next,
fce8b1
-				@cast(timer, "timer_list")->base) != 0)
fce8b1
+	return (@choose_defined(@cast(timer, "timer_list", "kernel")->entry->next,
fce8b1
+				@cast(timer, "timer_list", "kernel")->base) != 0)
fce8b1
 }
fce8b1
 
fce8b1
 function scsi_timer_pending:long(cmd:long)
fce8b1
diff --git a/testsuite/buildok/pretty.stp b/testsuite/buildok/pretty.stp
fce8b1
index 85c9cd9..a2fc781 100755
fce8b1
--- a/testsuite/buildok/pretty.stp
fce8b1
+++ b/testsuite/buildok/pretty.stp
fce8b1
@@ -6,14 +6,14 @@ global i = 1
fce8b1
 # pretty-printing with @cast
fce8b1
 probe begin {
fce8b1
     t = task_current()
fce8b1
-    log(@cast(t, "task_struct")->fs$)
fce8b1
-    log(@cast(t, "task_struct")->fs$$)
fce8b1
-    log(@cast(t, "task_struct")->comm$)
fce8b1
-    log(@cast(t, "task_struct")->comm$$)
fce8b1
-    log(@cast(t, "task_struct")->comm[0]$)
fce8b1
-    log(@cast(t, "task_struct")->comm[0]$$)
fce8b1
-    log(@cast(t, "task_struct")->comm[i]$)
fce8b1
-    log(@cast(t, "task_struct")->comm[i]$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->fs$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->fs$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[0]$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[0]$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[i]$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[i]$$)
fce8b1
 }
fce8b1
 
fce8b1
 # pretty-printing in dwarf kernel context
fce8b1
diff --git a/testsuite/semok/cast.stp b/testsuite/semok/cast.stp
fce8b1
index d72763c..fe78e36 100755
fce8b1
--- a/testsuite/semok/cast.stp
fce8b1
+++ b/testsuite/semok/cast.stp
fce8b1
@@ -2,7 +2,7 @@
fce8b1
 
fce8b1
 probe begin {
fce8b1
     // basic @cast test, with and without specifying kernel
fce8b1
-    println(@cast(0, "task_struct")->tgid)
fce8b1
+    println(@cast(0, "task_struct", "kernel")->tgid)
fce8b1
     println(@cast(0, "task_struct", "kernel")->tgid)
fce8b1
 
fce8b1
     // check module-search paths
fce8b1
@@ -25,5 +25,5 @@ probe begin {
fce8b1
     @cast(0, "task_struct", "no_such_module")->tgid
fce8b1
 
fce8b1
     // PR11556: we should be able to treat the initial pointer like an array too
fce8b1
-    println(@cast(0, "task_struct")[42]->tgid)
fce8b1
+    println(@cast(0, "task_struct", "kernel")[42]->tgid)
fce8b1
 }
fce8b1
diff --git a/testsuite/semok/pretty.stp b/testsuite/semok/pretty.stp
fce8b1
index 0211d86..25490e7 100755
fce8b1
--- a/testsuite/semok/pretty.stp
fce8b1
+++ b/testsuite/semok/pretty.stp
fce8b1
@@ -12,16 +12,16 @@ global i = 1
fce8b1
 # pretty-printing with @cast
fce8b1
 probe begin {
fce8b1
     t = task_current()
fce8b1
-    log(@cast(t, "task_struct")$)
fce8b1
-    log(@cast(t, "task_struct")$$)
fce8b1
-    log(@cast(t, "task_struct")->fs$)
fce8b1
-    log(@cast(t, "task_struct")->fs$$)
fce8b1
-    log(@cast(t, "task_struct")->comm$)
fce8b1
-    log(@cast(t, "task_struct")->comm$$)
fce8b1
-    log(@cast(t, "task_struct")->comm[0]$)
fce8b1
-    log(@cast(t, "task_struct")->comm[0]$$)
fce8b1
-    log(@cast(t, "task_struct")->comm[i]$)
fce8b1
-    log(@cast(t, "task_struct")->comm[i]$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->fs$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->fs$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[0]$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[0]$$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[i]$)
fce8b1
+    log(@cast(t, "task_struct", "kernel")->comm[i]$$)
fce8b1
 }
fce8b1
 
fce8b1
 # pretty-printing in dwarf kernel context
fce8b1
diff --git a/testsuite/semok/sizeof.stp b/testsuite/semok/sizeof.stp
fce8b1
index 8e35e29..a5a6bbb 100755
fce8b1
--- a/testsuite/semok/sizeof.stp
fce8b1
+++ b/testsuite/semok/sizeof.stp
fce8b1
@@ -1,7 +1,7 @@
fce8b1
 #! stap -p2
fce8b1
 
fce8b1
 probe begin {
fce8b1
-    println("task_struct: ", @cast_sizeof("task_struct"))
fce8b1
+    # println("task_struct: ", @cast_sizeof("task_struct"))
fce8b1
     println("task_struct: ", @cast_module_sizeof("kernel", "task_struct"))
fce8b1
     println("task_struct: ", @cast_module_sizeof("kernel<linux/sched.h>", "task_struct"))
fce8b1
     println("FILE: ", @cast_module_sizeof("<stdio.h>", "FILE"))
fce8b1
diff --git a/testsuite/semok/thirtyeight.stp b/testsuite/semok/thirtyeight.stp
fce8b1
index 15189b7..5018795 100755
fce8b1
--- a/testsuite/semok/thirtyeight.stp
fce8b1
+++ b/testsuite/semok/thirtyeight.stp
fce8b1
@@ -7,4 +7,4 @@
fce8b1
 probe kernel.function("do_sys_open") { println(@defined($mode) ? 1 : $nosuchvar) }
fce8b1
 probe kernel.trace("sched_switch")? { println(@defined($next->pid) ? 1 : $nosuchvar) }
fce8b1
 probe procfs.write { println(@defined($value) ? 1 : $nosuchvar) }
fce8b1
-probe begin { println(@defined(@cast(0, "task_struct")->pid) ? 1 : $nosuchvar) }
fce8b1
+probe begin { println(@defined(@cast(0, "task_struct", "kernel")->pid) ? 1 : $nosuchvar) }
fce8b1
diff --git a/testsuite/semok/thirtysix.stp b/testsuite/semok/thirtysix.stp
fce8b1
index 14f10c1..0adae14 100755
fce8b1
--- a/testsuite/semok/thirtysix.stp
fce8b1
+++ b/testsuite/semok/thirtysix.stp
fce8b1
@@ -17,17 +17,17 @@ probe begin,end,error,never { println(@defined($nosuchvar)?$nosuchvar:0) } # inv
fce8b1
 probe timer.s(1),timer.jiffies(1) { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid
fce8b1
 probe timer.profile { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid
fce8b1
 
fce8b1
-probe begin { println(@defined(@cast(0, "task_struct")->foo)?$nosuchvar:0) } # invalid
fce8b1
-probe begin { println(@defined(@cast(0, "task_struct")->pid)?1:$nosuchvar) } # valid
fce8b1
-probe kernel.function("do_sys_open") { println(@defined(@cast(0, "task_struct")->foo)?$nosuchvar:0) } # invalid
fce8b1
-probe kernel.function("do_sys_open") { println(@defined(@cast(0, "task_struct")->pid)?1:$nosuchvar) } # valid
fce8b1
+probe begin { println(@defined(@cast(0, "task_struct", "kernel")->foo)?$nosuchvar:0) } # invalid
fce8b1
+probe begin { println(@defined(@cast(0, "task_struct", "kernel")->pid)?1:$nosuchvar) } # valid
fce8b1
+probe kernel.function("do_sys_open") { println(@defined(@cast(0, "task_struct", "kernel")->foo)?$nosuchvar:0) } # invalid
fce8b1
+probe kernel.function("do_sys_open") { println(@defined(@cast(0, "task_struct", "kernel")->pid)?1:$nosuchvar) } # valid
fce8b1
 
fce8b1
-function foo1() { println(@defined(@cast(0, "task_struct")->foo)?$nosuchvar:0) } # invalid
fce8b1
-function foo2() { println(@defined(@cast(0, "task_struct")->pid)?1:$nosuchvar) } # valid
fce8b1
+function foo1() { println(@defined(@cast(0, "task_struct", "kernel")->foo)?$nosuchvar:0) } # invalid
fce8b1
+function foo2() { println(@defined(@cast(0, "task_struct", "kernel")->pid)?1:$nosuchvar) } # valid
fce8b1
 probe begin { foo1(); foo2(); }
fce8b1
 
fce8b1
 # PR11598: support @defined(&...)
fce8b1
-probe begin { println(@defined(@cast(0, "task_struct")->rcu)?$nosuchvar:0) } # invalid
fce8b1
-probe begin { println(@defined(&@cast(0, "task_struct")->rcu)?1:$nosuchvar) } # valid
fce8b1
+probe begin { println(@defined(@cast(0, "task_struct", "kernel")->rcu)?$nosuchvar:0) } # invalid
fce8b1
+probe begin { println(@defined(&@cast(0, "task_struct", "kernel")->rcu)?1:$nosuchvar) } # valid
fce8b1
 probe kernel.function("release_task") { println(@defined($p->rcu)?$nosuchvar:0) } # invalid
fce8b1
 probe kernel.function("release_task") { println(@defined(&$p->rcu)?1:$nosuchvar) } # valid
fce8b1
diff --git a/testsuite/systemtap.base/bitfield.stp b/testsuite/systemtap.base/bitfield.stp
fce8b1
index 0208108..b5f7b89 100644
fce8b1
--- a/testsuite/systemtap.base/bitfield.stp
fce8b1
+++ b/testsuite/systemtap.base/bitfield.stp
fce8b1
@@ -11,8 +11,8 @@ function check:long(ack:long, urg:long) {
fce8b1
   ptr = get_ptr()
fce8b1
 
fce8b1
   /* set the bits with cast */
fce8b1
-  @cast(ptr, "tcphdr")->ack = ack
fce8b1
-  @cast(ptr, "tcphdr")->urg = urg
fce8b1
+  @cast(ptr, "tcphdr", "kernel")->ack = ack
fce8b1
+  @cast(ptr, "tcphdr", "kernel")->urg = urg
fce8b1
 
fce8b1
   /* check that reading with embedded-C is ok */
fce8b1
   real_ack = get_ack()
fce8b1
@@ -20,8 +20,8 @@ function check:long(ack:long, urg:long) {
fce8b1
   errors = (ack != real_ack) + (urg != real_urg)
fce8b1
 
fce8b1
   /* check that reading with a cast is ok */
fce8b1
-  cast_ack = @cast(ptr, "tcphdr")->ack
fce8b1
-  cast_urg = @cast(ptr, "tcphdr")->urg
fce8b1
+  cast_ack = @cast(ptr, "tcphdr", "kernel")->ack
fce8b1
+  cast_urg = @cast(ptr, "tcphdr", "kernel")->urg
fce8b1
   errors += (ack != cast_ack) + (urg != cast_urg)
fce8b1
 
fce8b1
   if (errors)
fce8b1
diff --git a/testsuite/systemtap.base/target_set.stp b/testsuite/systemtap.base/target_set.stp
fce8b1
index ad4dca6..7c458cb 100644
fce8b1
--- a/testsuite/systemtap.base/target_set.stp
fce8b1
+++ b/testsuite/systemtap.base/target_set.stp
fce8b1
@@ -19,13 +19,13 @@ probe begin
fce8b1
 probe syscall.nanosleep
fce8b1
 {
fce8b1
     if (target_set_pid(pid())
fce8b1
-	&& user_long(&@cast(req_uaddr, "struct timespec")->tv_sec) == $1)
fce8b1
+	&& user_long(&@cast(req_uaddr, "struct timespec", "kernel")->tv_sec) == $1)
fce8b1
 	target_set_report()
fce8b1
 }
fce8b1
 probe syscall.compat_nanosleep ?
fce8b1
 {
fce8b1
     if (target_set_pid(pid())
fce8b1
-	&& user_long(&@cast(req_uaddr, "struct compat_timespec")->tv_sec) == $1)
fce8b1
+	&& user_long(&@cast(req_uaddr, "struct compat_timespec", "kernel")->tv_sec) == $1)
fce8b1
 	target_set_report()
fce8b1
 }
fce8b1
 
fce8b1
diff --git a/testsuite/systemtap.context/usymbols.exp b/testsuite/systemtap.context/usymbols.exp
fce8b1
index f53c1cd..e12f067 100644
fce8b1
--- a/testsuite/systemtap.context/usymbols.exp
fce8b1
+++ b/testsuite/systemtap.context/usymbols.exp
fce8b1
@@ -20,7 +20,7 @@ set testscript {
fce8b1
     probe syscall.rt_sigaction {
fce8b1
       if (pid() == target() && execname() == "%s") {
fce8b1
 	// Note user address.
fce8b1
-	handler = user_long(&@cast(act_uaddr, "struct sigaction")->sa_handler);
fce8b1
+	handler = user_long(&@cast(act_uaddr, "struct sigaction", "kernel")->sa_handler);
fce8b1
 	try {
fce8b1
 		printf("handler: %%s (%%s)\n", usymname(handler), umodname(handler));
fce8b1
 	} catch {
fce8b1
@@ -31,9 +31,9 @@ set testscript {
fce8b1
     probe syscall.rt_sigaction32 ? {
fce8b1
       if (pid() == target() && execname() == "%s") {
fce8b1
 	// Note user address.
fce8b1
-	handler = user_long(@defined(@cast(0, "compat_sigaction")->sa_handler)
fce8b1
-			    ? &@cast(act_uaddr, "compat_sigaction")->sa_handler
fce8b1
-			    : &@cast(act_uaddr, "sigaction32")->sa_handler);
fce8b1
+	handler = user_long(@defined(@cast(0, "compat_sigaction", "kernel")->sa_handler)
fce8b1
+			    ? &@cast(act_uaddr, "compat_sigaction", "kernel")->sa_handler
fce8b1
+			    : &@cast(act_uaddr, "sigaction32", "kernel")->sa_handler);
fce8b1
 	try {
fce8b1
 		printf("handler: %%s (%%s)\n", usymname(handler), umodname(handler));
fce8b1
 	} catch {
fce8b1
fce8b1
commit c6831f14e043f88096b2219828c0124cf2549b77
fce8b1
Author: Frank Ch. Eigler <fche@redhat.com>
fce8b1
Date:   Thu Jul 9 21:41:51 2020 -0400
fce8b1
fce8b1
    testuite: More @cast() fallout
fce8b1
    
fce8b1
    Adjust another test case that uses the deprecated
fce8b1
    
fce8b1
       probe begin { @cast(PTR, "type") }
fce8b1
    
fce8b1
    construct.  Now "kernel" is formally required to specify context.
fce8b1
fce8b1
diff --git a/testsuite/systemtap.base/cast.stp b/testsuite/systemtap.base/cast.stp
fce8b1
index cc44a36..0e191eb 100644
fce8b1
--- a/testsuite/systemtap.base/cast.stp
fce8b1
+++ b/testsuite/systemtap.base/cast.stp
fce8b1
@@ -4,7 +4,7 @@ probe begin
fce8b1
 
fce8b1
     // Compare PIDs
fce8b1
     pid = pid()
fce8b1
-    cast_pid = @cast(curr, "task_struct")->tgid
fce8b1
+    cast_pid = @cast(curr, "task_struct", "kernel")->tgid
fce8b1
     if (pid == cast_pid)
fce8b1
         println("PID OK")
fce8b1
     else
fce8b1
@@ -18,7 +18,7 @@ probe begin
fce8b1
         printf("PID2 %d != %d\n", pid, cast_pid)
fce8b1
 
fce8b1
     // Compare PIDs with an array access (PR11556)
fce8b1
-    cast_pid = @cast(curr, "task_struct")[0]->tgid
fce8b1
+    cast_pid = @cast(curr, "task_struct", "kernel")[0]->tgid
fce8b1
     if (pid == cast_pid)
fce8b1
         println("PID3 OK")
fce8b1
     else
fce8b1
@@ -26,16 +26,16 @@ probe begin
fce8b1
 
fce8b1
     // Compare execnames
fce8b1
     name = execname()
fce8b1
-    cast_name = kernel_string(@cast(curr, "task_struct")->comm)
fce8b1
+    cast_name = kernel_string(@cast(curr, "task_struct", "kernel")->comm)
fce8b1
     if (name == cast_name)
fce8b1
         println("execname OK")
fce8b1
     else
fce8b1
         printf("execname \"%s\" != \"%s\"\n", name, cast_name)
fce8b1
 
fce8b1
     // Compare usage counter values through a struct address
fce8b1
-    usage = @cast(curr, "task_struct")->usage->counter
fce8b1
-    pusage = & @cast(curr, "task_struct")->usage
fce8b1
-    cast_usage = @cast(pusage, "atomic_t")->counter
fce8b1
+    usage = @cast(curr, "task_struct", "kernel")->usage->counter
fce8b1
+    pusage = & @cast(curr, "task_struct", "kernel")->usage
fce8b1
+    cast_usage = @cast(pusage, "atomic_t", "kernel")->counter
fce8b1
     if (usage == cast_usage)
fce8b1
         println("usage OK")
fce8b1
     else