Print this page
NEX-1643 dtrace provider for smbsrv
Also illumos 1841:
 DTrace smb provider was mis-implemented, doesn't exist.
Add back handlers for read/write raw, so that
 legacy dtrace consumers can find the probes.
Kill extra arg in smb_negotiate
Fix missing "done" probe with smb_notify
Add example consumer: smb-trace.d
fix soi_pid

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbsrv/smb_dispatch.c
          +++ new/usr/src/uts/common/fs/smbsrv/smb_dispatch.c
↓ open down ↓ 187 lines elided ↑ open up ↑
 188  188              0x12, PC_NETWORK_PROGRAM_1_0 },
 189  189          { "SmbLockAndRead", SMB_SDT_OPS(lock_and_read),         /* 0x13 019 */
 190  190              0x13, LANMAN1_0, SDDF_READOP},
 191  191          { "SmbWriteAndUnlock", SMB_SDT_OPS(write_and_unlock),   /* 0x14 020 */
 192  192              0x14, LANMAN1_0, SDDF_WRITEOP },
 193  193          { "Invalid", SMB_SDT_OPS(invalid), 0x15, 0 },           /* 0x15 021 */
 194  194          { "Invalid", SMB_SDT_OPS(invalid), 0x16, 0 },           /* 0x16 022 */
 195  195          { "Invalid", SMB_SDT_OPS(invalid), 0x17, 0 },           /* 0x17 023 */
 196  196          { "Invalid", SMB_SDT_OPS(invalid), 0x18, 0 },           /* 0x18 024 */
 197  197          { "Invalid", SMB_SDT_OPS(invalid), 0x19, 0 },           /* 0x19 025 */
 198      -        { "SmbReadRaw", SMB_SDT_OPS(invalid), 0x1A, 0 },        /* 0x1A 026 */
      198 +        { "SmbReadRaw", SMB_SDT_OPS(read_raw),                  /* 0x1A 026 */
      199 +            0x1A, LANMAN1_0 },
 199  200          { "Invalid", SMB_SDT_OPS(invalid), 0x1B, 0 },           /* 0x1B 027 */
 200  201          { "Invalid", SMB_SDT_OPS(invalid), 0x1C, 0 },           /* 0x1C 028 */
 201      -        { "SmbWriteRaw", SMB_SDT_OPS(invalid), 0x1D, 0 },       /* 0x1D 029 */
      202 +        { "SmbWriteRaw", SMB_SDT_OPS(write_raw),                /* 0x1D 029 */
      203 +            0x1D, LANMAN1_0 },
 202  204          { "Invalid", SMB_SDT_OPS(invalid), 0x1E, 0 },           /* 0x1E 030 */
 203  205          { "Invalid", SMB_SDT_OPS(invalid), 0x1F, 0 },           /* 0x1F 031 */
 204  206          { "Invalid", SMB_SDT_OPS(invalid), 0x20, 0 },           /* 0x20 032 */
 205  207          { "Invalid", SMB_SDT_OPS(invalid), 0x21, 0 },           /* 0x21 033 */
 206  208          { "SmbSetInformation2", SMB_SDT_OPS(set_information2),  /* 0x22 034 */
 207  209              0x22, LANMAN1_0 },
 208  210          { "SmbQueryInformation2",
 209  211              SMB_SDT_OPS(query_information2),                    /* 0x23 035 */
 210  212              0x23, LANMAN1_0 },
 211  213          { "SmbLockingX", SMB_SDT_OPS(locking_andx),             /* 0x24 036 */
↓ open down ↓ 614 lines elided ↑ open up ↑
 826  828                  if (sr->tid_tree == NULL) {
 827  829                          smbsr_error(sr, 0, ERRSRV, ERRinvnid);
 828  830                          smbsr_cleanup(sr);
 829  831                          goto report_error;
 830  832                  }
 831  833          }
 832  834  
 833  835          sr->sr_time_start = gethrtime();
 834  836          if ((sdrc = (*sdd->sdt_pre_op)(sr)) == SDRC_SUCCESS)
 835  837                  sdrc = (*sdd->sdt_function)(sr);
 836      -
      838 +        (*sdd->sdt_post_op)(sr);
 837  839          if (sdrc != SDRC_SR_KEPT) {
 838      -                (*sdd->sdt_post_op)(sr);
 839  840                  smbsr_cleanup(sr);
 840  841          }
 841  842  
 842  843          /* Record latency and rx/tx bytes per:  server, session, share. */
 843  844          {
 844  845                  hrtime_t        dt;
 845  846                  int64_t         rxb, txb;
 846  847                  smb_disp_stats_t        *client_sds;    /* session */
 847  848                  smb_disp_stats_t        *share_sds;  /* kshare */
 848  849                  int     cmd_type;
↓ open down ↓ 513 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX