diff options
author | Alek Pinchuk <alek@nexenta.com> | 2014-02-04 17:12:51 -0800 |
---|---|---|
committer | Gordon Ross <gwr@nexenta.com> | 2015-10-26 10:17:10 -0400 |
commit | ed81dd52230eff1a7c7625caad21af232c36f6cb (patch) | |
tree | f104e8e43c9b9834f8a29847cb16adfe4712e192 | |
parent | 12b65585e720714b31036daaa2b30eb76014048e (diff) | |
download | illumos-joyent-ed81dd52230eff1a7c7625caad21af232c36f6cb.tar.gz |
6351 Update smbsrv dtrace scripts and install them
Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r-- | exception_lists/packaging | 4 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/Makefile | 5 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/cifs.d | 275 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/msrpc.d | 450 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/smbd-all.d | 136 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/smbd-authsvc.d | 104 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/smbd-doorsvc.d | 95 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/smbd-pipesvc.d | 116 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/smbsrv.d | 89 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/dtrace/stype.d | 202 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/fksmbd/README | 8 | ||||
-rw-r--r-- | usr/src/cmd/smbsrv/fksmbd/Watch-pipesvc.d | 62 | ||||
-rw-r--r-- | usr/src/pkg/manifests/service-file-system-smb.mf | 7 | ||||
-rwxr-xr-x | usr/src/tools/quick/make-smbsrv | 5 |
14 files changed, 560 insertions, 998 deletions
diff --git a/exception_lists/packaging b/exception_lists/packaging index 50d54ffca7..5ff213104e 100644 --- a/exception_lists/packaging +++ b/exception_lists/packaging @@ -748,10 +748,6 @@ usr/lib/amd64/libfakekernel.so.1 i386 usr/lib/sparcv9/libfakekernel.so sparc usr/lib/sparcv9/libfakekernel.so.1 sparc # -# Private/Internal dtrace scripts of smbsrv. Do not ship. -# -usr/lib/smbsrv/dtrace -# # Private/Internal libraries of smbsrv. Do not ship. # usr/lib/mdb/proc/libfksmbsrv.so diff --git a/usr/src/cmd/smbsrv/dtrace/Makefile b/usr/src/cmd/smbsrv/dtrace/Makefile index b0bc255933..fb892315fa 100644 --- a/usr/src/cmd/smbsrv/dtrace/Makefile +++ b/usr/src/cmd/smbsrv/dtrace/Makefile @@ -22,10 +22,11 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" +# Copyright 2014 Nexenta Systems, Inc. All rights reserved. # -SRCS= cifs.d msrpc.d smbnode.d smbvfs.d stype.d +SRCS= smbd-all.d smbd-authsvc.d smbd-doorsvc.d smbd-pipesvc.d \ + smbnode.d smbsrv.d smbvfs.d include ../../Makefile.cmd diff --git a/usr/src/cmd/smbsrv/dtrace/cifs.d b/usr/src/cmd/smbsrv/dtrace/cifs.d deleted file mode 100644 index c9748b4b40..0000000000 --- a/usr/src/cmd/smbsrv/dtrace/cifs.d +++ /dev/null @@ -1,275 +0,0 @@ -#!/usr/sbin/dtrace -s -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -/* -#pragma D option flowindent -*/ - -/* - * Usage: ./cifs.d -p `pgrep smbd` - * - * On multi-processor systems, it may be easier to follow the output - * if run on a single processor: see psradm. For example, to disable - * the second processor on a dual-processor system: psradm -f 1 - */ - -BEGIN -{ - printf("CIFS Trace Started"); - printf("\n\n"); -} - -END -{ - printf("CIFS Trace Ended"); - printf("\n\n"); -} - -sdt:smbsrv::-smb_op*-start -{ - sr = (struct smb_request *)arg0; - - printf("cmd=%d [uid=%d tid=%d]", - sr->smb_com, sr->smb_uid, sr->smb_tid); - - self->status = 0; -} - -sdt:smbsrv::-smb_op*-done -{ - sr = (struct smb_request *)arg0; - - printf("cmd[%d]: status=0x%08x (class=%d code=%d)", - sr->smb_com, sr->smb_error.status, - sr->smb_error.errcls, sr->smb_error.errcode); - - self->status = sr->smb_error.status; -} - -sdt:smbsrv::-smb_op-Negotiate-done -{ - sr = (struct smb_request *)arg0; - negprot = (smb_arg_negotiate_t *)arg1; - - printf("dialect=%s index=%u caps=0x%08x maxmpx=%u tz=%d time=%u", - stringof(negprot->ni_name), - negprot->ni_index, - negprot->ni_capabilities, - negprot->ni_maxmpxcount, - negprot->ni_tzcorrection, - negprot->ni_servertime.tv_sec); - - printf(" [status=0x%08x (class=%d code=%d)]", - sr->smb_error.status, - sr->smb_error.errcls, sr->smb_error.errcode); - - self->status = sr->smb_error.status; -} - -sdt:smbsrv::-smb_op-SessionSetupX-start -{ - sr = (struct smb_request *)arg0; - ssetup = (smb_arg_sessionsetup_t *)arg1; - - printf("[%s] %s %s %s", - (sr->session->s_local_port == 139) ? "NBT" : "TCP", - (sr->session->s_local_port == 139) ? - stringof(sr->session->workstation) : "", - stringof(ssetup->ssi_domain), - stringof(ssetup->ssi_user)); - - printf(" maxmpx=%u vc=%u maxbuf=%u", - ssetup->ssi_maxmpxcount, - sr->session->vcnumber, - sr->session->smb_msg_size); -} - -sdt:smbsrv::-smb_op-SessionSetupX-done -{ - sr = (struct smb_request *)arg0; - ssetup = (smb_arg_sessionsetup_t *)arg1; - - printf("%s/%s: smbuid=%d (%s)", - stringof(sr->uid_user->u_domain), - stringof(sr->uid_user->u_name), - sr->smb_uid, - (ssetup->ssi_guest == 0) ? "user" : "guest"); - - printf(" [status=0x%08x (class=%d code=%d)]", - sr->smb_error.status, - sr->smb_error.errcls, sr->smb_error.errcode); - - self->status = sr->smb_error.status; -} - -sdt:smbsrv::-smb_op-LogoffX-start -{ - sr = (struct smb_request *)arg0; - - printf("uid %d: %s/%s", sr->smb_uid, - stringof(sr->uid_user->u_domain), - stringof(sr->uid_user->u_name)); -} - -sdt:smbsrv::-smb_op-TreeConnectX-start -{ - tcon = (struct tcon *)arg1; - - printf("[%s] %s", - stringof(tcon->service), - stringof(tcon->path)); -} - -sdt:smbsrv::-smb_op-TreeConnectX-done -{ - sr = (struct smb_request *)arg0; - - printf("tid %d: %s", sr->smb_tid, - (sr->smb_error.status == 0) ? - stringof(sr->tid_tree->t_sharename) : ""); - - printf(" [status=0x%08x (class=%d code=%d)]", - sr->smb_error.status, - sr->smb_error.errcls, sr->smb_error.errcode); -} - -sdt:smbsrv::-smb_op-TreeDisconnect-start -{ - sr = (struct smb_request *)arg0; - - printf("tid %d: %s", sr->smb_tid, - stringof(sr->tid_tree->t_sharename)); - discard(self->status); -} - -sdt:smbsrv::-smb_op-Open-start, -sdt:smbsrv::-smb_op-OpenX-start, -sdt:smbsrv::-smb_op-Create-start, -sdt:smbsrv::-smb_op-CreateNew-start, -sdt:smbsrv::-smb_op-CreateTemporary-start, -sdt:smbsrv::-smb_op-CreateDirectory-start, -sdt:smbsrv::-smb_op-NtCreateX-start, -sdt:smbsrv::-smb_op-NtTransactCreate-start -{ - op = (struct open_param *)arg1; - - printf("%s", stringof(op->fqi.fq_path.pn_path)); -} - -sdt:smbsrv::-smb_op-Open-done, -sdt:smbsrv::-smb_op-OpenX-done, -sdt:smbsrv::-smb_op-Create-done, -sdt:smbsrv::-smb_op-CreateNew-done, -sdt:smbsrv::-smb_op-CreateTemporary-done, -sdt:smbsrv::-smb_op-CreateDirectory-done, -sdt:smbsrv::-smb_op-NtCreateX-done, -sdt:smbsrv::-smb_op-NtTransactCreate-done -{ - sr = (struct smb_request *)arg0; - - printf("%s: fid=%u", - stringof(sr->arg.open.fqi.fq_path.pn_path), sr->smb_fid); -} - -sdt:smbsrv::-smb_op-Read-start, -sdt:smbsrv::-smb_op-LockAndRead-start, -sdt:smbsrv::-smb_op-ReadX-start, -sdt:smbsrv::-smb_op-ReadRaw-start, -sdt:smbsrv::-smb_op-Write-start, -sdt:smbsrv::-smb_op-WriteAndClose-start, -sdt:smbsrv::-smb_op-WriteAndUnlock-start, -sdt:smbsrv::-smb_op-WriteX-start, -sdt:smbsrv::-smb_op-WriteRaw-start -{ - sr = (struct smb_request *)arg0; - rw = (smb_rw_param_t *)arg1; - - printf("fid=%d: %u bytes at offset %u", - sr->smb_fid, rw->rw_count, rw->rw_offset); -} - -sdt:smbsrv::-smb_op-Read-done, -sdt:smbsrv::-smb_op-LockAndRead-done, -sdt:smbsrv::-smb_op-ReadX-done, -sdt:smbsrv::-smb_op-ReadRaw-done -/self->status == 0/ -{ - sr = (struct smb_request *)arg0; - rw = (smb_rw_param_t *)arg1; - - printf("fid=%d: %u bytes at offset %u", - sr->smb_fid, rw->rw_count, rw->rw_offset); -} - -sdt:smbsrv::-smb_op-Rename-start -{ - p = (struct dirop *)arg1; - - printf("%s to %s", - stringof(p->fqi.fq_path.pn_path), - stringof(p->dst_fqi.fq_path.pn_path)); -} - -sdt:smbsrv::-smb_op-CheckDirectory-start, -sdt:smbsrv::-smb_op-CreateDirectory-start, -sdt:smbsrv::-smb_op-DeleteDirectory-start, -sdt:smbsrv::-smb_op-Delete-start -{ - p = (struct dirop *)arg1; - - printf("%s", stringof(p->fqi.fq_path.pn_path)); -} - -/* -smb_dispatch_request:entry, -smb_dispatch_request:return, -smb_pre_*:return, -smb_com_*:return, -smb_post_*:return, -smbsr_status:return, -smbsr_errno:return -{ -} - -smb_pre_*:entry, -smb_com_*:entry, -smb_post_*:entry -{ - sr = (struct smb_request *)arg0; - - printf("cmd=%d [uid=%d tid=%d]", - sr->smb_com, sr->smb_uid, sr->smb_tid); -} - -smbsr_status:entry -{ - printf("status=0x%08x class=%d, code=%d\n", arg1, arg2, arg3); -} - -smbsr_errno:entry -{ - printf("errno=%d\n", arg1); -} -*/ diff --git a/usr/src/cmd/smbsrv/dtrace/msrpc.d b/usr/src/cmd/smbsrv/dtrace/msrpc.d deleted file mode 100644 index bf744df7cc..0000000000 --- a/usr/src/cmd/smbsrv/dtrace/msrpc.d +++ /dev/null @@ -1,450 +0,0 @@ -#!/usr/sbin/dtrace -s -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -/* - * Usage: ./msrpc.d -p `pgrep smbd` - * - * On multi-processor systems, it may be easier to follow the output - * if run on a single processor: see psradm. For example, to disable - * the second processor on a dual-processor system: psradm -f 1 - * - * This script can be used to trace NDR operations and MSRPC requests. - * In order to put these operations in context, SMB session and tree - * requests are also traced. - * - * Output formatting is as follows: - * - * UI 03 ... rpc_vers get 1@0 = 5 {05} - * UI 03 ... rpc_vers_minor get 1@1 = 0 {00} - * - * U Marshalling flag (M=marshal, U=unmarshal) - * I Direction flag (I=in, O=out) - * ... Field name - * get PDU operation (get or put) - * 1@0 Bytes @ offset (i.e. 1 byte at offset 0) - * {05} Value - * - * The value formatting is limited to 10 bytes, after which an ellipsis - * will be inserted before the closing brace. If the value is 1 or 2 - * bytes, an attempt will be made to present an ASCII value but this may - * or may not be relevent. - * - * The following example shows the header from a bind response: - * - * trace:entry MO 03 ... rpc_vers put 1@0 = 5 {05} - * trace:entry MO 03 ... rpc_vers_minor put 1@1 = 0 {00} - * trace:entry MO 03 ... ptype put 1@2 = 12 {0c} - * trace:entry MO 03 ... pfc_flags put 1@3 = 3 {03} - * trace:entry MO 04 .... intg_char_rep put 1@4 = 16 {10} - * trace:entry MO 04 .... float_rep put 1@5 = 0 {00} - * trace:entry MO 04 .... _spare[0] put 1@6 = 0 {00} - * trace:entry MO 04 .... _spare[1] put 1@7 = 0 {00} - * trace:entry MO 03 ... frag_length put 2@8 = 68 {44 00} D - * trace:entry MO 03 ... auth_length put 2@10 = 0 {00 00} - * trace:entry MO 03 ... call_id put 4@12 = 1 {01 00 00 00} - * trace:entry MO 02 .. max_xmit_frag put 2@16 = 4280 {b8 10} - * trace:entry MO 02 .. max_recv_frag put 2@18 = 4280 {b8 10} - * trace:entry MO 02 .. assoc_group_id put 4@20 = 1192620711 {a7 f2 15 47} - * trace:entry MO 02 .. sec_addr.length put 2@24 = 12 {0c 00} - * trace:entry MO 02 .. sec_addr.port_spec[0] put 1@26 = 92 {5c} \ - * trace:entry MO 02 .. sec_addr.port_spec[1] put 1@27 = 80 {50} P - * trace:entry MO 02 .. sec_addr.port_spec[2] put 1@28 = 73 {49} I - * trace:entry MO 02 .. sec_addr.port_spec[3] put 1@29 = 80 {50} P - * trace:entry MO 02 .. sec_addr.port_spec[4] put 1@30 = 69 {45} E - * trace:entry MO 02 .. sec_addr.port_spec[5] put 1@31 = 92 {5c} \ - * trace:entry MO 02 .. sec_addr.port_spec[6] put 1@32 = 108 {6c} l - * trace:entry MO 02 .. sec_addr.port_spec[7] put 1@33 = 115 {73} s - * trace:entry MO 02 .. sec_addr.port_spec[8] put 1@34 = 97 {61} a - * trace:entry MO 02 .. sec_addr.port_spec[9] put 1@35 = 115 {73} s - * trace:entry MO 02 .. sec_addr.port_spec[10] put 1@36 = 115 {73} s - * trace:entry MO 02 .. sec_addr.port_spec[11] put 1@37 = 0 {00} - */ - -BEGIN -{ - printf("MSRPC Trace Started"); - printf("\n\n"); -} - -END -{ - printf("MSRPC Trace Ended"); - printf("\n\n"); -} - -/* - * SmbSessionSetupX, SmbLogoffX - * SmbTreeConnect, SmbTreeDisconnect - */ -smb_tree*:entry, -smb_com_*:entry, -smb_com_*:return, -smb_com_session_setup_andx:entry, -smb_com_logoff_andx:entry, -smb_tree_connect:return, -smb_tree_disconnect:entry, -smb_tree_disconnect:return, -smb_opipe_open:entry, -smb_opipe_door_call:entry, -smb_opipe_door_upcall:entry, -door_ki_upcall:entry -{ -} - -smb_com_session_setup_andx:return, -smb_user*:return, -smb_tree*:return, -smb_opipe_open:return, -smb_opipe_door_call:return, -smb_opipe_door_upcall:return, -door_ki_upcall:return -{ - printf("rc=0x%08x", arg1); -} - -sdt:smbsrv::smb-sessionsetup-clntinfo -{ - user_info = (smb_logon_t *)arg0; - - printf("domain\\username=%s\\%s\n\n", - stringof(user_info->lg_domain), - stringof(user_info->lg_username)); -} - -smb_tree_connect:entry -{ - sr = (smb_request_t *)arg0; - - printf("share=%s service=%s", - stringof(sr->arg.tcon.path), - stringof(sr->arg.tcon.service)); -} - -smb_com_logoff_andx:return -{ -} - -/* - * Raise error functions (no return). - */ -smbsr_status:entry -{ - printf("status=0x%08x class=%d, code=%d", arg1, arg2, arg3); -} - -smbsr_errno:entry -{ - printf("errno=%d", arg1); -} - -smbsr_status:return, -smbsr_errno:return -{ -} - -/* - * MSRPC activity. - */ -pid$target::ndr_svc_bind:entry, -pid$target::ndr_svc_bind:return, -pid$target::ndr_svc_request:entry, -pid$target::ndr_svc_request:return -{ -} - -pid$target::smb_trace:entry, -pid$target::ndo_trace:entry -{ - printf("%s", copyinstr(arg0)); -} - -/* - * LSARPC - */ -pid$target::lsarpc_s_CloseHandle:entry, -pid$target::lsarpc_s_QuerySecurityObject:entry, -pid$target::lsarpc_s_EnumAccounts:entry, -pid$target::lsarpc_s_EnumTrustedDomain:entry, -pid$target::lsarpc_s_OpenAccount:entry, -pid$target::lsarpc_s_EnumPrivsAccount:entry, -pid$target::lsarpc_s_LookupPrivValue:entry, -pid$target::lsarpc_s_LookupPrivName:entry, -pid$target::lsarpc_s_LookupPrivDisplayName:entry, -pid$target::lsarpc_s_QueryInfoPolicy:entry, -pid$target::lsarpc_s_OpenDomainHandle:entry, -pid$target::lsarpc_s_OpenDomainHandle:entry, -pid$target::lsarpc_s_LookupSids:entry, -pid$target::lsarpc_s_LookupNames:entry, -pid$target::lsarpc_s_GetConnectedUser:entry, -pid$target::lsarpc_s_LookupSids2:entry, -pid$target::lsarpc_s_LookupNames2:entry -{ -} - -pid$target::lsarpc_s_CloseHandle:return, -pid$target::lsarpc_s_QuerySecurityObject:return, -pid$target::lsarpc_s_EnumAccounts:return, -pid$target::lsarpc_s_EnumTrustedDomain:return, -pid$target::lsarpc_s_OpenAccount:return, -pid$target::lsarpc_s_EnumPrivsAccount:return, -pid$target::lsarpc_s_LookupPrivValue:return, -pid$target::lsarpc_s_LookupPrivName:return, -pid$target::lsarpc_s_LookupPrivDisplayName:return, -pid$target::lsarpc_s_QueryInfoPolicy:return, -pid$target::lsarpc_s_OpenDomainHandle:return, -pid$target::lsarpc_s_OpenDomainHandle:return, -pid$target::lsarpc_s_LookupSids:return, -pid$target::lsarpc_s_LookupNames:return, -pid$target::lsarpc_s_GetConnectedUser:return, -pid$target::lsarpc_s_LookupSids2:return, -pid$target::lsarpc_s_LookupNames2:return -{ -} - -pid$target::lsar_lookup_names:entry -{ - printf("%s", copyinstr(arg1)); -} - -pid$target::lsar_lookup_*:entry -{ -} - -pid$target::lsar_lookup_*:return -{ - printf("0x%08x", arg1); -} - -pid$target::lsar_*:entry -{ -} - -pid$target::lsar_*:return -{ - printf("0x%08x", arg1); -} - -/* - * NetLogon - */ -pid$target::netr_*:entry -{ -} - -pid$target::netr_*:return -{ - printf("0x%08x", arg1); -} - -/* - * SAMR - */ -pid$target::samr_s_Connect:entry, -pid$target::samr_s_CloseHandle:entry, -pid$target::samr_s_LookupDomain:entry, -pid$target::samr_s_EnumLocalDomains:entry, -pid$target::samr_s_OpenDomain:entry, -pid$target::samr_s_QueryDomainInfo:entry, -pid$target::samr_s_QueryInfoDomain2:entry, -pid$target::samr_s_LookupNames:entry, -pid$target::samr_s_OpenUser:entry, -pid$target::samr_s_DeleteUser:entry, -pid$target::samr_s_QueryUserInfo:entry, -pid$target::samr_s_QueryUserGroups:entry, -pid$target::samr_s_OpenGroup:entry, -pid$target::samr_s_Connect2:entry, -pid$target::samr_s_GetUserPwInfo:entry, -pid$target::samr_s_CreateUser:entry, -pid$target::samr_s_ChangeUserPasswd:entry, -pid$target::samr_s_GetDomainPwInfo:entry, -pid$target::samr_s_SetUserInfo:entry, -pid$target::samr_s_Connect4:entry, -pid$target::samr_s_Connect5:entry, -pid$target::samr_s_QueryDispInfo:entry, -pid$target::samr_s_OpenAlias:entry, -pid$target::samr_s_CreateDomainAlias:entry, -pid$target::samr_s_SetAliasInfo:entry, -pid$target::samr_s_QueryAliasInfo:entry, -pid$target::samr_s_DeleteDomainAlias:entry, -pid$target::samr_s_EnumDomainAliases:entry, -pid$target::samr_s_EnumDomainGroups:entry -{ -} - -pid$target::samr_s_Connect:return, -pid$target::samr_s_CloseHandle:return, -pid$target::samr_s_LookupDomain:return, -pid$target::samr_s_EnumLocalDomains:return, -pid$target::samr_s_OpenDomain:return, -pid$target::samr_s_QueryDomainInfo:return, -pid$target::samr_s_QueryInfoDomain2:return, -pid$target::samr_s_LookupNames:return, -pid$target::samr_s_OpenUser:return, -pid$target::samr_s_DeleteUser:return, -pid$target::samr_s_QueryUserInfo:return, -pid$target::samr_s_QueryUserGroups:return, -pid$target::samr_s_OpenGroup:return, -pid$target::samr_s_Connect2:return, -pid$target::samr_s_GetUserPwInfo:return, -pid$target::samr_s_CreateUser:return, -pid$target::samr_s_ChangeUserPasswd:return, -pid$target::samr_s_GetDomainPwInfo:return, -pid$target::samr_s_SetUserInfo:return, -pid$target::samr_s_Connect4:return, -pid$target::samr_s_Connect5:return, -pid$target::samr_s_QueryDispInfo:return, -pid$target::samr_s_OpenAlias:return, -pid$target::samr_s_CreateDomainAlias:return, -pid$target::samr_s_SetAliasInfo:return, -pid$target::samr_s_QueryAliasInfo:return, -pid$target::samr_s_DeleteDomainAlias:return, -pid$target::samr_s_EnumDomainAliases:return, -pid$target::samr_s_EnumDomainGroups:return -{ -} - -/* - * SPOOLSS - */ -pid$target::spoolss_*:entry, -pid$target::spoolss_*:return -{ -} - -/* - * SVCCTL - */ -pid$target::svcctl_s_*:entry, -pid$target::svcctl_s_*:return -{ -} - -/* - * SRVSVC - */ -pid$target::srvsvc_s_NetConnectEnum:entry, -pid$target::srvsvc_s_NetFileEnum:entry, -pid$target::srvsvc_s_NetFileClose:entry, -pid$target::srvsvc_s_NetShareGetInfo:entry, -pid$target::srvsvc_s_NetShareSetInfo:entry, -pid$target::srvsvc_s_NetSessionEnum:entry, -pid$target::srvsvc_s_NetSessionDel:entry, -pid$target::srvsvc_s_NetServerGetInfo:entry, -pid$target::srvsvc_s_NetRemoteTOD:entry, -pid$target::srvsvc_s_NetNameValidate:entry, -pid$target::srvsvc_s_NetShareAdd:entry, -pid$target::srvsvc_s_NetShareDel:entry, -pid$target::srvsvc_s_NetShareEnum:entry, -pid$target::srvsvc_s_NetShareEnumSticky:entry, -pid$target::srvsvc_s_NetGetFileSecurity:entry, -pid$target::srvsvc_s_NetSetFileSecurity:entry -{ -} - -pid$target::srvsvc_s_NetConnectEnum:return, -pid$target::srvsvc_s_NetFileEnum:return, -pid$target::srvsvc_s_NetFileClose:return, -pid$target::srvsvc_s_NetShareGetInfo:return, -pid$target::srvsvc_s_NetShareSetInfo:return, -pid$target::srvsvc_s_NetSessionEnum:return, -pid$target::srvsvc_s_NetSessionDel:return, -pid$target::srvsvc_s_NetServerGetInfo:return, -pid$target::srvsvc_s_NetRemoteTOD:return, -pid$target::srvsvc_s_NetNameValidate:return, -pid$target::srvsvc_s_NetShareAdd:return, -pid$target::srvsvc_s_NetShareDel:return, -pid$target::srvsvc_s_NetShareEnum:return, -pid$target::srvsvc_s_NetShareEnumSticky:return, -pid$target::srvsvc_s_NetGetFileSecurity:return, -pid$target::srvsvc_s_NetSetFileSecurity:return -{ -} - -/* - * WinReg - */ -pid$target::winreg_s_*:entry, -pid$target::winreg_s_*:return -{ -} - -/* - * Workstation - */ -pid$target::wkssvc_s_*:entry, -pid$target::wkssvc_s_*:return -{ -} - -/* - * SMBRDR - */ -pid$target::smbrdr_tree_connect:entry -{ - printf("%s %s %s", - copyinstr(arg0), - copyinstr(arg1), - copyinstr(arg2)); -} - -pid$target::smbrdr_open_pipe:entry -{ - printf("%s %s %s %s", - copyinstr(arg0), - copyinstr(arg1), - copyinstr(arg2), - copyinstr(arg3)); -} - -pid$target::smbrdr_tree_disconnect:entry, -pid$target::smbrdr_close_pipe:entry, -pid$target::smbrdr_ntcreatex:entry, -pid$target::smbrdr_transact:entry, -pid$target::smbrdr_readx*:entry -{ -} - -pid$target::smbrdr_tree_connect:return, -pid$target::smbrdr_tree_disconnect:return, -pid$target::smbrdr_open_pipe:return, -pid$target::smbrdr_close_pipe:return, -pid$target::smbrdr_ntcreatex:return, -pid$target::smbrdr_transact:return, -pid$target::smbrdr_readx*:return -{ - printf("%d", arg1); -} - -pid$target::ndr_clnt_get_frags:entry, -pid$target::ndr_clnt_get_frag:entry -{ -} - -pid$target::ndr_clnt_get_frags:return, -pid$target::ndr_clnt_get_frag:return -{ - printf("%d", arg1); -} diff --git a/usr/src/cmd/smbsrv/dtrace/smbd-all.d b/usr/src/cmd/smbsrv/dtrace/smbd-all.d new file mode 100644 index 0000000000..caf2426c6b --- /dev/null +++ b/usr/src/cmd/smbsrv/dtrace/smbd-all.d @@ -0,0 +1,136 @@ +#!/usr/sbin/dtrace -s +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * 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. + */ + +/* + * User-level dtrace for smbd. Watch everything it does. + * Usage: dtrace -s smbd-all.d -p `pgrep smbd` + */ + +#pragma D option flowindent + +self int trace; +self int mask; + +/* + * Trace everything in smbd + */ +pid$target:*smbd::entry, +pid$target:libmlsvc.so.1::entry, +pid$target:libmlrpc.so.1::entry, +pid$target:libsmbns.so.1::entry, +pid$target:libsmb.so.1::entry, +pid$target:libads.so.1::entry +{ + self->trace++; +} + +/* + * If traced and not masked, print entry/return + */ +pid$target:*smbd::entry, +pid$target:libmlsvc.so.1::entry, +pid$target:libmlrpc.so.1::entry, +pid$target:libsmbns.so.1::entry, +pid$target:libsmb.so.1::entry, +pid$target:libads.so.1::entry +/self->trace > 0 && self->mask == 0/ +{ + 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 + * smb_mbtowc, smb_msgbuf_has_space, ... + * + * Also, libmlrpc has rather deep call stacks, particularly under + * ndr_encode_decode_common(), so this stops traces below there. + * Remove that from the mask actions to see the details. + */ +pid$target::ht_findfirst:entry, +pid$target::ht_findnext:entry, +pid$target::ndr_encode_decode_common:entry, +pid$target::smb_msgbuf_decode:entry, +pid$target::smb_msgbuf_encode:entry, +pid$target::smb_strlwr:entry, +pid$target::smb_strupr:entry, +pid$target::smb_wcequiv_strlen:entry +{ + self->mask++; +} + +/* + * Get some of the smbd debug messages, etc. + */ +pid$target:libsmb.so.1:smb_trace:entry +/self->trace > 0 && self->mask == 0/ +{ + printf("%s", copyinstr(arg0)); +} + +pid$target:libsmb.so.1:smb_syslog:entry +/self->trace > 0 && self->mask == 0/ +{ + printf("%s", copyinstr(arg1)); +} + +pid$target:libc_hwcap1.so.1:syslog:entry +/self->trace > 0 && self->mask == 0/ +{ + printf("%s", copyinstr(arg1)); +} + +/* + * Now inverses of above, unwind order. + */ + +pid$target::ht_findfirst:return, +pid$target::ht_findnext:return, +pid$target::ndr_encode_decode_common:return, +pid$target::smb_msgbuf_decode:return, +pid$target::smb_msgbuf_encode:return, +pid$target::smb_strlwr:return, +pid$target::smb_strupr:return, +pid$target::smb_wcequiv_strlen:return +{ + self->mask--; +} + +pid$target:*smbd::return, +pid$target:libmlsvc.so.1::return, +pid$target:libmlrpc.so.1::return, +pid$target:libsmbns.so.1::return, +pid$target:libsmb.so.1::return, +pid$target:libads.so.1::return +/self->trace > 0 && self->mask == 0/ +{ + printf("\t0x%x", arg1); +} + +pid$target:*smbd::return, +pid$target:libmlsvc.so.1::return, +pid$target:libmlrpc.so.1::return, +pid$target:libsmbns.so.1::return, +pid$target:libsmb.so.1::return, +pid$target:libads.so.1::return +{ + self->trace--; +} diff --git a/usr/src/cmd/smbsrv/dtrace/smbd-authsvc.d b/usr/src/cmd/smbsrv/dtrace/smbd-authsvc.d new file mode 100644 index 0000000000..0c9cb6a0ed --- /dev/null +++ b/usr/src/cmd/smbsrv/dtrace/smbd-authsvc.d @@ -0,0 +1,104 @@ +#!/usr/sbin/dtrace -s +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * 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. + */ + +/* + * User-level dtrace for the smbd authentication service + * Usage: dtrace -s smbd-authsvc.d -p `pgrep smbd` + */ + +#pragma D option flowindent + +self int trace; +self int mask; + +/* + * The smbd_authsvc_work() function is a good place to start tracing + * to watch authentication. This function executes all the actions + * associated with a single session setup conversation (even though + * that conversation will usually involve multiple SMB requests). + */ +pid$target:*smbd:smbd_authsvc_work:entry +{ + self->trace++; +} + +/* + * If traced and not masked, print entry/return + */ +pid$target:*smbd::entry, +pid$target:libmlsvc.so.1::entry, +pid$target:libmlrpc.so.1::entry, +pid$target:libsmbns.so.1::entry, +pid$target:libsmb.so.1::entry, +pid$target:libsmbfs.so.1::entry +/self->trace > 0 && self->mask == 0/ +{ + 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 + * smb_mbtowc, smb_msgbuf_has_space, ... + * + * Also, libmlrpc has rather deep call stacks, particularly under + * ndr_encode_decode_common(), so this stops traces below there. + * Remove that from the mask actions to see the details. + */ +pid$target::ndr_encode_decode_common:entry, +pid$target::smb_msgbuf_decode:entry, +pid$target::smb_msgbuf_encode:entry, +pid$target::smb_strlwr:entry, +pid$target::smb_strupr:entry, +pid$target::smb_wcequiv_strlen:entry +{ + self->mask++; +} + +/* + * Now inverses of above, unwind order. + */ + +pid$target::ndr_encode_decode_common:return, +pid$target::smb_msgbuf_decode:return, +pid$target::smb_msgbuf_encode:return, +pid$target::smb_strlwr:return, +pid$target::smb_strupr:return, +pid$target::smb_wcequiv_strlen:return +{ + self->mask--; +} + +pid$target:*smbd::return, +pid$target:libmlsvc.so.1::return, +pid$target:libmlrpc.so.1::return, +pid$target:libsmbns.so.1::return, +pid$target:libsmb.so.1::return, +pid$target:libsmbfs.so.1::return +/self->trace > 0 && self->mask == 0/ +{ + printf("\t0x%x", arg1); +} + +pid$target:*smbd:smbd_authsvc_work:return +{ + self->trace--; +} diff --git a/usr/src/cmd/smbsrv/dtrace/smbd-doorsvc.d b/usr/src/cmd/smbsrv/dtrace/smbd-doorsvc.d new file mode 100644 index 0000000000..51ffa68ad7 --- /dev/null +++ b/usr/src/cmd/smbsrv/dtrace/smbd-doorsvc.d @@ -0,0 +1,95 @@ +#!/usr/sbin/dtrace -s +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * 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. + */ + +/* + * User-level dtrace for smbd + * Usage: dtrace -s smbd-doorsvc.d -p `pgrep smbd` + */ + +#pragma D option flowindent + +self int trace; +self int mask; + +/* + * smbd_door_dispatch_op() is the logical top of smbd door service calls. + */ +pid$target:*smbd:smbd_door_dispatch_op:entry +{ + self->trace++; +} + +/* + * If traced and not masked, print entry/return + */ +pid$target:*smbd::entry, +pid$target:libmlsvc.so.1::entry, +pid$target:libmlrpc.so.1::entry, +pid$target:libsmbns.so.1::entry, +pid$target:libsmb.so.1::entry, +pid$target:libsmbfs.so.1::entry +/self->trace > 0 && self->mask == 0/ +{ + 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 + * smb_mbtowc, smb_msgbuf_has_space, ... + */ +pid$target::smb_msgbuf_decode:entry, +pid$target::smb_msgbuf_encode:entry, +pid$target::smb_strlwr:entry, +pid$target::smb_strupr:entry, +pid$target::smb_wcequiv_strlen:entry +{ + self->mask++; +} + +/* + * Now inverses of above, unwind order. + */ + +pid$target::smb_msgbuf_decode:return, +pid$target::smb_msgbuf_encode:return, +pid$target::smb_strlwr:return, +pid$target::smb_strupr:return, +pid$target::smb_wcequiv_strlen:return +{ + self->mask--; +} + +pid$target:*smbd::return, +pid$target:libmlsvc.so.1::return, +pid$target:libmlrpc.so.1::return, +pid$target:libsmbns.so.1::return, +pid$target:libsmb.so.1::return, +pid$target:libsmbfs.so.1::return +/self->trace > 0 && self->mask == 0/ +{ + printf("\t0x%x", arg1); +} + +pid$target:*smbd:smbd_door_dispatch_op:return +{ + self->trace--; +} diff --git a/usr/src/cmd/smbsrv/dtrace/smbd-pipesvc.d b/usr/src/cmd/smbsrv/dtrace/smbd-pipesvc.d new file mode 100644 index 0000000000..1fe6ca8223 --- /dev/null +++ b/usr/src/cmd/smbsrv/dtrace/smbd-pipesvc.d @@ -0,0 +1,116 @@ +#!/usr/sbin/dtrace -s +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * 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. + */ + +/* + * User-level dtrace for smbd + * Usage: dtrace -s smbd-pipesvc.d -p `pgrep smbd` + */ + +#pragma D option flowindent + +self int trace; +self int mask; + +/* + * The smbd_authsvc_work() function is a good place to start tracing + * to watch RPC service actions. This worker handles all activity + * for a given named pipe instance, including the payload from all + * SMB read/write requests on this endpoint. + */ +pid$target:*smbd:pipesvc_worker:entry +{ + self->trace++; +} + +/* + * If traced and not masked, print entry/return + */ +pid$target:*smbd::entry, +pid$target:libmlsvc.so.1::entry, +pid$target:libmlrpc.so.1::entry, +pid$target:libsmbns.so.1::entry, +pid$target:libsmb.so.1::entry +/self->trace > 0 && self->mask == 0/ +{ + 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 + * smb_mbtowc, smb_msgbuf_has_space, ... + * + * Also, libmlrpc has rather deep call stacks, particularly under + * ndr_encode_decode_common(), so this stops traces below there. + * Remove that from the mask actions to see the details. + */ +pid$target::ht_findfirst:entry, +pid$target::ht_findnext:entry, +pid$target::ndr_encode_decode_common:entry, +pid$target::smb_msgbuf_decode:entry, +pid$target::smb_msgbuf_encode:entry, +pid$target::smb_strlwr:entry, +pid$target::smb_strupr:entry, +pid$target::smb_wcequiv_strlen:entry +{ + self->mask++; +} + +/* + * Now inverses of above, unwind order. + */ + +pid$target::ht_findfirst:return, +pid$target::ht_findnext:return, +pid$target::ndr_encode_decode_common:return, +pid$target::smb_msgbuf_decode:return, +pid$target::smb_msgbuf_encode:return, +pid$target::smb_strlwr:return, +pid$target::smb_strupr:return, +pid$target::smb_wcequiv_strlen:return +{ + self->mask--; +} + +pid$target:*smbd::return, +pid$target:libmlsvc.so.1::return, +pid$target:libmlrpc.so.1::return, +pid$target:libsmbns.so.1::return, +pid$target:libsmb.so.1::return +/self->trace > 0 && self->mask == 0/ +{ + printf("\t0x%x", arg1); +} + +/* + * This function in libmlrpc prints out lots of internal state. + * Comment it out if you don't want that noise. + */ +pid$target:libmlrpc.so.1:ndo_trace:entry +/self->trace > 0 && self->mask == 0/ +{ + printf("ndo_trace: %s", copyinstr(arg0)); +} + +pid$target:*smbd:pipesvc_worker:return +{ + self->trace--; +} diff --git a/usr/src/cmd/smbsrv/dtrace/smbsrv.d b/usr/src/cmd/smbsrv/dtrace/smbsrv.d new file mode 100644 index 0000000000..162839bd71 --- /dev/null +++ b/usr/src/cmd/smbsrv/dtrace/smbsrv.d @@ -0,0 +1,89 @@ +#!/usr/sbin/dtrace -s +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * 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. + */ + +/* + * Developer dtrace program for smbsrv + * Usage: dtrace -s smbsrv.d + */ + +#pragma D option flowindent + +self int trace; +self int mask; + +/* + * Trace almost everything + */ +fbt:smbsrv::entry +{ + self->trace++; +} + +/* + * If traced and not masked, print entry/return + */ +fbt:smbsrv::entry +/self->trace > 0 && self->mask == 0/ +{ + 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 + * smb_mbtowc, mbc_marshal_... + */ +fbt::smb_mbc_vdecodef:entry, +fbt::smb_mbc_vencodef:entry, +fbt::smb_msgbuf_decode:entry, +fbt::smb_msgbuf_encode:entry, +fbt::smb_strlwr:entry, +fbt::smb_strupr:entry, +fbt::smb_wcequiv_strlen:entry +{ + self->mask++; +} + +/* + * Now inverses of above, unwind order. + */ + +fbt::smb_mbc_vdecodef:return, +fbt::smb_mbc_vencodef:return, +fbt::smb_msgbuf_decode:return, +fbt::smb_msgbuf_encode:return, +fbt::smb_strlwr:return, +fbt::smb_strupr:return, +fbt::smb_wcequiv_strlen:return +{ + self->mask--; +} + +fbt:smbsrv::return +/self->trace > 0 && self->mask == 0/ +{ + printf("\t0x%x", arg1); +} + +fbt:smbsrv::return +{ + self->trace--; +} diff --git a/usr/src/cmd/smbsrv/dtrace/stype.d b/usr/src/cmd/smbsrv/dtrace/stype.d deleted file mode 100644 index ce157e5877..0000000000 --- a/usr/src/cmd/smbsrv/dtrace/stype.d +++ /dev/null @@ -1,202 +0,0 @@ -#!/usr/sbin/dtrace -s - -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -#pragma D option flowindent - -/* - * Usage: ./stype.d -p `pgrep smbd` - * - * On multi-processor systems, it may be easier to follow the output - * if run on a single processor: see psradm. For example, to disable - * the second processor on a dual-processor system: psradm -f 1 - */ - -BEGIN -{ - printf("CIFS Trace Started"); - printf("\n\n"); -} - -END -{ - printf("CIFS Trace Ended"); - printf("\n\n"); -} - -sdt:smbsrv::-smb_op-SessionSetupX-start -{ - sr = (struct smb_request *)arg0; - ssetup = (smb_arg_sessionsetup_t *)arg1; - - printf("[%s] %s %s %s", - (sr->session->s_local_port == 139) ? "NBT" : "TCP", - (sr->session->s_local_port == 139) ? - stringof(sr->session->workstation) : "", - stringof(ssetup->ssi_domain), - stringof(ssetup->ssi_user)); - - printf(" maxmpx=%u vc=%u maxbuf=%u", - ssetup->ssi_maxmpxcount, - sr->session->vcnumber, - sr->session->smb_msg_size); -} - -sdt:smbsrv::-smb_op-SessionSetupX-done -{ - sr = (struct smb_request *)arg0; - ssetup = (smb_arg_sessionsetup_t *)arg1; - - printf("%s/%s: smbuid=%d (%s)", - stringof(sr->uid_user->u_domain), - stringof(sr->uid_user->u_name), - sr->smb_uid, - (ssetup->ssi_guest == 0) ? "user" : "guest"); - - printf(" [status=0x%08x (class=%d code=%d)]", - sr->smb_error.status, - sr->smb_error.errcls, sr->smb_error.errcode); -} - -sdt:smbsrv::-smb_op-LogoffX-start -{ - sr = (struct smb_request *)arg0; - - printf("uid %d: %s/%s", sr->smb_uid, - stringof(sr->uid_user->u_domain), - stringof(sr->uid_user->u_name)); -} - -sdt:smbsrv::-smb_op-TreeConnectX-start -{ - tcon = (struct tcon *)arg1; - - printf("[%s] %s", - stringof(tcon->service), - stringof(tcon->path)); -} - -sdt:smbsrv::-smb_op-TreeConnectX-done -{ - sr = (struct smb_request *)arg0; - - printf("tid %d: %s", sr->smb_tid, - (sr->smb_error.status == 0) ? - stringof(sr->tid_tree->t_sharename) : ""); - - printf(" [status=0x%08x (class=%d code=%d)]", - sr->smb_error.status, - sr->smb_error.errcls, sr->smb_error.errcode); -} - -sdt:smbsrv::-smb_op-TreeDisconnect-start -{ - sr = (struct smb_request *)arg0; - - printf("tid %d: %s", sr->smb_tid, - (sr->tid_tree == 0) ? "" : - stringof(sr->tid_tree->t_sharename)); -} - -/* - * Error functions - */ -smbsr_status:entry -{ - printf("status=0x%08x class=%d, code=%d", arg1, arg2, arg3); -} - -smbsr_errno:entry -{ - printf("errno=%d", arg1); -} - -smbsr_status:return, -smbsr_errno:return -{ -} - -/* - * Share/tree connect. - */ -smb_tree_connect:entry -{ -} - -smb_tree_get_sharename:entry -{ - printf("uncpath=%s", stringof(arg0)); -} - -smb_tree_connect_disk:entry -{ - printf("sharename=%s", stringof(arg1)); - self->stype = 0; -} - -smb_tree_connect_printq:entry -{ - printf("sharename=%s", stringof(arg1)); - self->stype = 1; -} - -smb_tree_connect_ipc:entry -{ - printf("sharename=%s", stringof(arg1)); - self->stype = 3; -} - -smb_tree_connect:return, -smb_tree_get_sharename:return, -smb_tree_connect_disk:return, -smb_tree_connect_ipc:return -{ - printf("rc=0x%08x", arg1); -} - -smb_tree_alloc:entry -/self->stype == 0/ -{ - printf("share=%s service=%s", stringof(arg1), stringof(arg2)); -} - -smb_tree_alloc:return -/self->stype == 0/ -{ - printf("FS=%s flags=0x%08x", - stringof(((smb_tree_t *)arg1)->t_typename), - ((smb_tree_t *)arg1)->t_flags); -} - -smb_tree_disconnect:entry, -smb_tree_disconnect:return -{ -} - -smb_tree_log:entry -{ - printf("%s: %s", stringof(arg1), stringof(arg2)); -} diff --git a/usr/src/cmd/smbsrv/fksmbd/README b/usr/src/cmd/smbsrv/fksmbd/README index 63779932d2..da72ffd1a8 100644 --- a/usr/src/cmd/smbsrv/fksmbd/README +++ b/usr/src/cmd/smbsrv/fksmbd/README @@ -55,10 +55,14 @@ To run it under mdb (with mdb modules build here): mdb -L $ROOT/usr/lib/mdb/proc:/usr/lib/mdb/proc ... where ... is one of: fksmbd, core.nnn, -p $PID -There are also a couple dtrace scripts in here for watching -either all activity or only selected areas. (see *.d) +There are also some dtrace scripts in here, and in ../dtrace +for watching either all activity or only selected areas. Run these like: dtrace -s Watch-all.d -p $PID -o output +These two (from over in ../dtrace) also work with fksmbd: + dtrace -s smbd-authsvc.d -p `pgrep fksmbd` -o output + dtrace -s smbd-pipesvc.d -p `pgrep fksmbd` -o output + Here are a couple simple, handy tests you can try: diff --git a/usr/src/cmd/smbsrv/fksmbd/Watch-pipesvc.d b/usr/src/cmd/smbsrv/fksmbd/Watch-pipesvc.d deleted file mode 100644 index f11156001d..0000000000 --- a/usr/src/cmd/smbsrv/fksmbd/Watch-pipesvc.d +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/sbin/dtrace -s -/* - * This file and its contents are supplied under the terms of the - * Common Development and Distribution License ("CDDL"), version 1.0. - * You may only use this file in accordance with the terms of version - * 1.0 of the CDDL. - * - * A full copy of the text of the CDDL should have accompanied this - * source. A copy of the CDDL is also available via the Internet at - * http://www.illumos.org/license/CDDL. - */ - -/* - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. - */ - -/* - * User-level dtrace for smbd - * Usage: dtrace -s ThisScript.d -p PID - */ - -#pragma D option flowindent - -pid$target:fksmbd:pipesvc_worker:entry -{ - self->trace++; -} -pid$target:fksmbd:pipesvc_worker:return -{ - self->trace--; -} - -pid$target:fksmbd::entry, -pid$target:libfksmbsrv.so.1::entry, -pid$target:libmlsvc.so.1::entry, -pid$target:libmlrpc.so.1::entry, -pid$target:libsmbns.so.1::entry, -pid$target:libsmb.so.1::entry -/self->trace/ -{ - printf("\t0x%x", arg0); - printf("\t0x%x", arg1); - printf("\t0x%x", arg2); - printf("\t0x%x", arg3); -} - -pid$target:fksmbd::return, -pid$target:libfksmbsrv.so.1::return, -pid$target:libmlsvc.so.1::return, -pid$target:libmlrpc.so.1::return, -pid$target:libsmbns.so.1::return, -pid$target:libsmb.so.1::return -/self->trace/ -{ - printf("\t0x%x", arg1); -} - -pid$target:libmlrpc.so.1:ndo_trace:entry -/self->trace/ -{ - printf("ndo_trace: %s", copyinstr(arg0)); -} diff --git a/usr/src/pkg/manifests/service-file-system-smb.mf b/usr/src/pkg/manifests/service-file-system-smb.mf index 33df0fe870..3bcf91d291 100644 --- a/usr/src/pkg/manifests/service-file-system-smb.mf +++ b/usr/src/pkg/manifests/service-file-system-smb.mf @@ -52,6 +52,7 @@ dir path=usr/lib/mdb/kvm/$(ARCH64) group=sys dir path=usr/lib/reparse dir path=usr/lib/security dir path=usr/lib/smbsrv +dir path=usr/lib/smbsrv/dtrace dir path=usr/sbin dir path=usr/share/man dir path=usr/share/man/man1m @@ -78,6 +79,12 @@ file path=usr/lib/mdb/kvm/$(ARCH64)/smbsrv.so group=sys mode=0555 $(i386_ONLY)file path=usr/lib/mdb/kvm/smbsrv.so group=sys mode=0555 file path=usr/lib/reparse/libreparse_smb.so.1 file path=usr/lib/security/pam_smb_passwd.so.1 +file path=usr/lib/smbsrv/dtrace/smbd-authsvc.d mode=0555 +file path=usr/lib/smbsrv/dtrace/smbd-doorsvc.d mode=0555 +file path=usr/lib/smbsrv/dtrace/smbd-pipesvc.d mode=0555 +file path=usr/lib/smbsrv/dtrace/smbnode.d mode=0555 +file path=usr/lib/smbsrv/dtrace/smbsrv.d mode=0555 +file path=usr/lib/smbsrv/dtrace/smbvfs.d mode=0555 file path=usr/lib/smbsrv/libmlrpc.so.1 file path=usr/lib/smbsrv/libmlsvc.so.1 file path=usr/lib/smbsrv/libsmb.so.1 diff --git a/usr/src/tools/quick/make-smbsrv b/usr/src/tools/quick/make-smbsrv index 2dc2651ce6..a865e44258 100755 --- a/usr/src/tools/quick/make-smbsrv +++ b/usr/src/tools/quick/make-smbsrv @@ -264,7 +264,9 @@ do_tags() { # This creates a tarfile one can use to update a test machine. do_tar() { + git_rev=`git rev-parse --short=8 HEAD` files=" +lib/svc/manifest/network/smb/server.xml usr/kernel/drv/$arch64/smbsrv usr/kernel/drv/smbsrv usr/kernel/kmdb/$arch64/smbsrv @@ -276,6 +278,7 @@ usr/lib/mdb/kvm/$arch64/smbsrv.so usr/lib/mdb/kvm/smbsrv.so usr/lib/reparse/libreparse_smb.so.1 usr/lib/security/pam_smb_passwd.so.1 +usr/lib/smbsrv/dtrace usr/lib/smbsrv/libmlrpc.so.1 usr/lib/smbsrv/libmlsvc.so.1 usr/lib/smbsrv/libsmb.so.1 @@ -286,7 +289,7 @@ usr/sbin/smbadm usr/sbin/smbstat " - (cd $ROOT && tar cfj ../../smbsrv.tar.bz2 $files) + (cd $ROOT && tar cfj ../../smbsrv-${git_rev}.tar.bz2 $files) } ################################################################ |