Print this page
11083 support NFS server in zone
Portions contributed by: Dan Kruchinin <dan.kruchinin@nexenta.com>
Portions contributed by: Stepan Zastupov <stepan.zastupov@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Portions contributed by: Mike Zeller <mike@mikezeller.net>
Portions contributed by: Dan McDonald <danmcd@joyent.com>
Portions contributed by: Gordon Ross <gordon.w.ross@gmail.com>
Portions contributed by: Vitaliy Gusev <gusev.vitaliy@gmail.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Jason King <jbk@joyent.com>
Reviewed by: C Fraire <cfraire@me.com>
Change-Id: I22f289d357503f9b48a0bc2482cc4328a6d43d16

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/smbsrv/dtrace/smb2-trace.d
          +++ new/usr/src/cmd/smbsrv/dtrace/smb2-trace.d
        1 +#!/usr/sbin/dtrace -s
   1    2  /*
   2    3   * This file and its contents are supplied under the terms of the
   3    4   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    5   * You may only use this file in accordance with the terms of version
   5    6   * 1.0 of the CDDL.
   6    7   *
   7    8   * A full copy of the text of the CDDL should have accompanied this
   8    9   * source.  A copy of the CDDL is also available via the Internet at
   9   10   * http://www.illumos.org/license/CDDL.
  10   11   */
  11   12  
  12   13  /*
  13      - * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
       14 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  14   15   */
  15   16  
  16   17  /*
  17   18   * Example using the "smb2" dtrace provider.
  18   19   * Traces all SMB commands.
  19   20   *
  20   21   * All these probes provide:
  21   22   *      args[0]  conninfo_t
  22   23   *      args[1]  smb2opinfo_t
  23   24   * Some also provide one of: (not used here)
  24   25   *      args[2]  smb_open_args_t
  25   26   *      args[2]  smb_rw_args_t
       27 + *
       28 + * Usage: smb2-trace.d [<client ip>|all [<share path>|all] [<zone id>]]]
       29 + *
       30 + * example: smb2_trace.d 192.168.012.001 mypool_fs1  0
       31 + *
       32 + * It is valid to specify <client ip> or <share path> as "all" to
       33 + * print data for all clients and/or all shares.
       34 + * Omitting <zone id> will print data for all zones.
  26   35   */
  27   36  
       37 +#pragma D option defaultargs
       38 +
       39 +dtrace:::BEGIN
       40 +{
       41 +        all_clients = (($$1 == NULL) || ($$1 == "all")) ? 1 : 0;
       42 +        all_shares = (($$2 == NULL) || ($$2 == "all")) ? 1 : 0;
       43 +        all_zones = ($$3 == NULL) ? 1 : 0;
       44 +
       45 +        client = $$1;
       46 +        share = $$2;
       47 +        zoneid = $3;
       48 +
       49 +        printf("%Y - client=%s share=%s zone=%s)\n", walltimestamp,
       50 +            (all_clients) ? "all" : client,
       51 +            (all_shares) ? "all" : share,
       52 +            (all_zones) ? "all" : $$3);
       53 +}
       54 +
  28   55  smb2:::op-*-start
       56 +/ ((all_clients == 1) || (args[0]->ci_remote == client)) &&
       57 +   ((all_shares == 1) || (args[1]->soi_share == share)) &&
       58 +   ((all_zones == 1) || (args[1]->soi_zoneid == zoneid)) /
  29   59  {
  30   60          printf("clnt=%s mid=0x%x uid=0x%x tid=0x%x\n",
  31   61                 args[0]->ci_remote,
  32   62                 args[1]->soi_mid,
  33   63                 args[1]->soi_uid,
  34   64                 args[1]->soi_tid);
  35   65  }
  36   66  
  37   67  smb2:::op-*-done
       68 +/ ((all_clients == 1) || (args[0]->ci_remote == client)) &&
       69 +   ((all_shares == 1) || (args[1]->soi_share == share)) &&
       70 +   ((all_zones == 1) || (args[1]->soi_zoneid == zoneid)) /
  38   71  {
  39   72          printf("clnt=%s mid=0x%x status=0x%x\n",
  40   73                 args[0]->ci_remote,
  41   74                 args[1]->soi_mid,
  42   75                 args[1]->soi_status);
       76 +}
       77 +
       78 +dtrace:::END
       79 +{
  43   80  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX