]> sourceware.org Git - systemtap.git/commitdiff
Use explicit @cast() operators for pfiles.stp and ioctl_handler.stp
authorWilliam Cohen <wcohen@redhat.com>
Wed, 17 Jun 2020 17:39:20 +0000 (13:39 -0400)
committerWilliam Cohen <wcohen@redhat.com>
Wed, 17 Jun 2020 17:39:20 +0000 (13:39 -0400)
Commit 00ee19ff030f665df7e087a579f39105256a0253 changed how @cast()
operations work and they no longer default to using the kernel
debuginfo for type information.  Need to include kernel as location for
this information for the  @cast() rather than just assuming a default.

testsuite/systemtap.examples/process/pfiles.stp
testsuite/systemtap.examples/profiling/ioctl_handler.stp

index d52a1547b22e7f6a061b3edfeef69abd8e8a5999..6344a4c8d450d30e7cc1e4fbe99a1cdd74fd1558 100755 (executable)
@@ -787,9 +787,9 @@ function print_unix_socket(sock) {
                strlen(peername) > 0 ? peername . "\n" : "")
         try { # skip line in case of null pointers
        printf("        peercred pid: %d\n",
-            @defined(@cast(sock, "socket")->sk->sk_peer_pid) ?
-           @cast(sock, "socket")->sk->sk_peer_pid->numbers[0]->nr :
-           @cast(sock, "socket")->sk->sk_peercred->pid ); } catch { }
+            @defined(@cast(sock, "socket", "kernel")->sk->sk_peer_pid) ?
+           @cast(sock, "socket", "kernel")->sk->sk_peer_pid->numbers[0]->nr :
+           @cast(sock, "socket", "kernel")->sk->sk_peercred->pid ); } catch { }
 }
 
 function print_ipv4_socket(sock) {
index 704418570c7197a59294354fbff67d0af02054ac..6f1e52c5a99837eb242e03907dd3323a16efc41a 100755 (executable)
@@ -9,7 +9,7 @@ probe syscall.ioctl {
   ioctl_requests[execname()] <<< 1
   try {
     # Dig down through the task struct to find the actual function handling ioctl.
-    ioctl_func_address = @cast(task_current(), "struct task_struct")->files->fdt->fd[fd]->f_op->unlocked_ioctl
+    ioctl_func_address = @cast(task_current(), "struct task_struct", "kernel")->files->fdt->fd[fd]->f_op->unlocked_ioctl
     if (ioctl_func_address)
       ioctl_func[execname(), ioctl_func_address] <<< 1
   } catch {
This page took 0.031015 seconds and 5 git commands to generate.