Print this page
    
NEX-18380 Catch up with illumos SMB fix 9769
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
9769 SMB domain logon fails with I18N user name
9774 libmlrpc changes in 1575 missed some things
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Approved by: Robert Mustacchi <rm@joyent.com>
SMB-114 Should deliver SMB dtrace scripts
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/cmd/smbsrv/dtrace/smbd-pipesvc.d
          +++ new/usr/src/cmd/smbsrv/dtrace/smbd-pipesvc.d
   1    1  #!/usr/sbin/dtrace -s
   2    2  /*
   3    3   * This file and its contents are supplied under the terms of the
  
    | 
      ↓ open down ↓ | 
    3 lines elided | 
    
      ↑ open up ↑ | 
  
   4    4   * Common Development and Distribution License ("CDDL"), version 1.0.
   5    5   * You may only use this file in accordance with the terms of version
   6    6   * 1.0 of the CDDL.
   7    7   *
   8    8   * A full copy of the text of the CDDL should have accompanied this
   9    9   * source.  A copy of the CDDL is also available via the Internet at
  10   10   * http://www.illumos.org/license/CDDL.
  11   11   */
  12   12  
  13   13  /*
  14      - * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       14 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  15   15   */
  16   16  
  17   17  /*
  18   18   * User-level dtrace for smbd
  19   19   * Usage: dtrace -s smbd-pipesvc.d -p `pgrep smbd`
  20   20   */
  21   21  
  22   22  #pragma D option flowindent
  23   23  
  24   24  self int trace;
  25   25  self int mask;
  26   26  
  27   27  /*
  28      - * The smbd_authsvc_work() function is a good place to start tracing
       28 + * The pipesvc_worker() function is a good place to start tracing
  29   29   * to watch RPC service actions.  This worker handles all activity
  30   30   * for a given named pipe instance, including the payload from all
  31   31   * SMB read/write requests on this endpoint.
  32   32   */
  33   33  pid$target:*smbd:pipesvc_worker:entry
  34   34  {
  35   35          self->trace++;
  36   36  }
  37   37  
  38   38  /*
  39   39   * If traced and not masked, print entry/return
  40   40   */
  41   41  pid$target:*smbd::entry,
  42   42  pid$target:libmlsvc.so.1::entry,
  43      -pid$target:libmlrpc.so.1::entry,
       43 +pid$target:libmlrpc.so.2::entry,
  44   44  pid$target:libsmbns.so.1::entry,
  45   45  pid$target:libsmb.so.1::entry
  46   46  /self->trace > 0 && self->mask == 0/
  47   47  {
  48   48          printf("\t0x%x", arg0);
  49   49          printf("\t0x%x", arg1);
  50   50          printf("\t0x%x", arg2);
  51   51          printf("\t0x%x", arg3);
  52   52          printf("\t0x%x", arg4);
  53   53          printf("\t0x%x", arg5);
  54   54  }
  55   55  
  56   56  /*
  57   57   * Mask (don't print) all function calls below these functions.
  58   58   * These make many boring, repetitive function calls like
  59   59   * smb_mbtowc, smb_msgbuf_has_space, ...
  60   60   *
  61   61   * Also, libmlrpc has rather deep call stacks, particularly under
  62   62   * ndr_encode_decode_common(), so this stops traces below there.
  63   63   * Remove that from the mask actions to see the details.
  64   64   */
  65   65  pid$target::ht_findfirst:entry,
  66   66  pid$target::ht_findnext:entry,
  67   67  pid$target::ndr_encode_decode_common:entry,
  68   68  pid$target::smb_msgbuf_decode:entry,
  69   69  pid$target::smb_msgbuf_encode:entry,
  70   70  pid$target::smb_strlwr:entry,
  71   71  pid$target::smb_strupr:entry,
  72   72  pid$target::smb_wcequiv_strlen:entry
  73   73  {
  74   74          self->mask++;
  75   75  }
  76   76  
  77   77  /*
  78   78   * Now inverses of above, unwind order.
  79   79   */
  80   80  
  81   81  pid$target::ht_findfirst:return,
  82   82  pid$target::ht_findnext:return,
  83   83  pid$target::ndr_encode_decode_common:return,
  84   84  pid$target::smb_msgbuf_decode:return,
  
    | 
      ↓ open down ↓ | 
    31 lines elided | 
    
      ↑ open up ↑ | 
  
  85   85  pid$target::smb_msgbuf_encode:return,
  86   86  pid$target::smb_strlwr:return,
  87   87  pid$target::smb_strupr:return,
  88   88  pid$target::smb_wcequiv_strlen:return
  89   89  {
  90   90          self->mask--;
  91   91  }
  92   92  
  93   93  pid$target:*smbd::return,
  94   94  pid$target:libmlsvc.so.1::return,
  95      -pid$target:libmlrpc.so.1::return,
       95 +pid$target:libmlrpc.so.2::return,
  96   96  pid$target:libsmbns.so.1::return,
  97   97  pid$target:libsmb.so.1::return
  98   98  /self->trace > 0 && self->mask == 0/
  99   99  {
 100  100          printf("\t0x%x", arg1);
 101  101  }
 102  102  
 103  103  /*
 104  104   * This function in libmlrpc prints out lots of internal state.
 105  105   * Comment it out if you don't want that noise.
 106  106   */
 107      -pid$target:libmlrpc.so.1:ndo_trace:entry
      107 +pid$target:libmlrpc.so.2:ndo_trace:entry
 108  108  /self->trace > 0 && self->mask == 0/
 109  109  {
 110  110          printf("ndo_trace: %s", copyinstr(arg0));
 111  111  }
 112  112  
 113  113  pid$target:*smbd:pipesvc_worker:return
 114  114  {
 115  115          self->trace--;
 116  116  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX