1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  14  */
  15 
  16 /*
  17  * Example using the "smb2" dtrace provider.
  18  * Traces all SMB commands.
  19  *
  20  * All these probes provide:
  21  *      args[0]  conninfo_t
  22  *      args[1]  smb2opinfo_t
  23  * Some also provide one of: (not used here)
  24  *      args[2]  smb_open_args_t
  25  *      args[2]  smb_rw_args_t
  26  */
  27 
  28 smb2:::op-*-start
  29 {
  30         printf("clnt=%s mid=0x%x uid=0x%x tid=0x%x\n",
  31                args[0]->ci_remote,
  32                args[1]->soi_mid,
  33                args[1]->soi_uid,
  34                args[1]->soi_tid);
  35 }
  36 
  37 smb2:::op-*-done
  38 {
  39         printf("clnt=%s mid=0x%x status=0x%x\n",
  40                args[0]->ci_remote,
  41                args[1]->soi_mid,
  42                args[1]->soi_status);
  43 }