Print this page
NEX-15682 Update dtrace scripts
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-15682 Update dtrace scripts
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-3620 need upstream cleanups for smbsrv
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
SMB-95 improve smbsrv developer tools
SMB-50 User-mode SMB server
 Includes work by these authors:
 Thomas Keiser <thomas.keiser@nexenta.com>
 Albert Lee <trisk@nexenta.com>
        
@@ -9,20 +9,18 @@
  * source.  A copy of the CDDL is also available via the Internet at
  * http://www.illumos.org/license/CDDL.
  */
 
 /*
- * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
  * User-level dtrace for fksmbd
  * Usage: dtrace -s Watch-all.d -p $PID
  */
 
-#pragma D option flowindent
-
 self int trace;
 self int mask;
 
 /*
  * Trace almost everything
@@ -50,10 +48,12 @@
 {
   printf("\t0x%x", arg0);
   printf("\t0x%x", arg1);
   printf("\t0x%x", arg2);
   printf("\t0x%x", arg3);
+        printf("\t0x%x", arg4);
+        printf("\t0x%x", arg5);
 }
 
 /*
  * Mask (don't print) all function calls below these functions.
  * These make many boring, repetitive function calls like
@@ -106,6 +106,56 @@
 pid$target:libmlrpc.so.1::return,
 pid$target:libsmbns.so.1::return,
 pid$target:libsmb.so.1::return
 {
   self->trace--;
+}
+
+/*
+ * fksmb dtrace provder
+ */
+
+fksmb$target:::smb_start
+{
+        this->pn = copyinstr(arg0);
+        this->sr = (userland pid`smb_request_t *)arg1;
+
+        printf(" %s mid=0x%x uid=0x%x tid=0x%x\n",
+            this->pn,
+            this->sr->smb_mid,
+            this->sr->smb_uid,
+            this->sr->smb_tid);
+}
+
+fksmb$target:::smb_done
+{
+        this->pn = copyinstr(arg0);
+        this->sr = (userland pid`smb_request_t *)arg1;
+
+        printf(" %s mid=0x%x status=0x%x\n",
+            this->pn,
+            this->sr->smb_mid,
+            this->sr->smb_error.status);
+}
+
+fksmb$target:::smb2_start
+{
+        this->pn = copyinstr(arg0);
+        this->sr = (userland pid`smb_request_t *)arg1;
+
+        printf(" %s mid=0x%x uid=0x%x tid=0x%x\n",
+            this->pn,
+            this->sr->smb2_messageid,
+            this->sr->smb2_ssnid,
+            this->sr->smb_tid);
+}
+
+fksmb$target:::smb2_done
+{
+        this->pn = copyinstr(arg0);
+        this->sr = (userland pid`smb_request_t *)arg1;
+
+        printf(" %s mid=0x%x status=0x%x\n",
+            this->pn,
+            this->sr->smb2_messageid,
+            this->sr->smb2_status);
 }