utils/status.c

ソースコードを見る。

関数

BOOL status_profile_dump (BOOL be_verbose)
BOOL status_profile_rates (BOOL be_verbose)
static void Ucrit_addUid (uid_t uid)
static unsigned int Ucrit_checkUid (uid_t uid)
static unsigned int Ucrit_checkPid (pid_t pid)
static BOOL Ucrit_addPid (pid_t pid)
static void print_share_mode (const struct share_mode_entry *e, const char *sharepath, const char *fname, void *dummy)
static void print_brl (SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, enum brl_type lock_type, enum brl_flavour lock_flav, br_off start, br_off size)
static int traverse_fn1 (TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state)
static int traverse_sessionid (TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state)
int main (int argc, char *argv[])

変数

static uid_t Ucrit_uid = 0
static pid_t Ucrit_pid [SMB_MAXPIDS]
static int Ucrit_MaxPid = 0
static unsigned int Ucrit_IsActive = 0
static int verbose
static int brief
static int shares_only = 0
static int locks_only = 0
static BOOL processes_only = False
static int show_brl
static BOOL numeric_only = False
const char * username = NULL


関数

BOOL status_profile_dump ( BOOL  be_verbose  ) 

status_profile.c47 行で定義されています。

参照先 d_printf()fprintf()profile_pprofile_separator()profile_setup()profile_stats::smb_countprofile_stats::statcache_hitsprofile_stats::statcache_lookupsprofile_stats::statcache_missesprofile_stats::syscall_pread_bytesprofile_stats::syscall_pwrite_bytesprofile_stats::syscall_read_bytesprofile_stats::syscall_sendfile_bytesprofile_stats::syscall_write_bytesprofile_stats::uid_changesprofile_stats::writecache_abutted_writesprofile_stats::writecache_allocated_write_cachesprofile_stats::writecache_direct_writesprofile_stats::writecache_flushed_writesprofile_stats::writecache_init_writesprofile_stats::writecache_non_oplock_writesprofile_stats::writecache_num_perfect_writesprofile_stats::writecache_num_write_cachesprofile_stats::writecache_read_hitsprofile_stats::writecache_total_writes.

参照元 main().

00048 {
00049 #ifdef WITH_PROFILE
00050         if (!profile_setup(True)) {
00051                 fprintf(stderr,"Failed to initialise profile memory\n");
00052                 return False;
00053         }
00054 
00055         d_printf("smb_count:                      %u\n", profile_p->smb_count);
00056         d_printf("uid_changes:                    %u\n", profile_p->uid_changes);
00057 
00058         profile_separator("System Calls");
00059         d_printf("opendir_count:                  %u\n", profile_p->syscall_opendir_count);
00060         d_printf("opendir_time:                   %u\n", profile_p->syscall_opendir_time);
00061         d_printf("readdir_count:                  %u\n", profile_p->syscall_readdir_count);
00062         d_printf("readdir_time:                   %u\n", profile_p->syscall_readdir_time);
00063         d_printf("mkdir_count:                    %u\n", profile_p->syscall_mkdir_count);
00064         d_printf("mkdir_time:                     %u\n", profile_p->syscall_mkdir_time);
00065         d_printf("rmdir_count:                    %u\n", profile_p->syscall_rmdir_count);
00066         d_printf("rmdir_time:                     %u\n", profile_p->syscall_rmdir_time);
00067         d_printf("closedir_count:                 %u\n", profile_p->syscall_closedir_count);
00068         d_printf("closedir_time:                  %u\n", profile_p->syscall_closedir_time);
00069         d_printf("open_count:                     %u\n", profile_p->syscall_open_count);
00070         d_printf("open_time:                      %u\n", profile_p->syscall_open_time);
00071         d_printf("close_count:                    %u\n", profile_p->syscall_close_count);
00072         d_printf("close_time:                     %u\n", profile_p->syscall_close_time);
00073         d_printf("read_count:                     %u\n", profile_p->syscall_read_count);
00074         d_printf("read_time:                      %u\n", profile_p->syscall_read_time);
00075         d_printf("read_bytes:                     %u\n", profile_p->syscall_read_bytes);
00076         d_printf("write_count:                    %u\n", profile_p->syscall_write_count);
00077         d_printf("write_time:                     %u\n", profile_p->syscall_write_time);
00078         d_printf("write_bytes:                    %u\n", profile_p->syscall_write_bytes);
00079         d_printf("pread_count:                    %u\n", profile_p->syscall_pread_count);
00080         d_printf("pread_time:                     %u\n", profile_p->syscall_pread_time);
00081         d_printf("pread_bytes:                    %u\n", profile_p->syscall_pread_bytes);
00082         d_printf("pwrite_count:                   %u\n", profile_p->syscall_pwrite_count);
00083         d_printf("pwrite_time:                    %u\n", profile_p->syscall_pwrite_time);
00084         d_printf("pwrite_bytes:                   %u\n", profile_p->syscall_pwrite_bytes);
00085 #ifdef WITH_SENDFILE
00086         d_printf("sendfile_count:                 %u\n", profile_p->syscall_sendfile_count);
00087         d_printf("sendfile_time:                  %u\n", profile_p->syscall_sendfile_time);
00088         d_printf("sendfile_bytes:                 %u\n", profile_p->syscall_sendfile_bytes);
00089 #endif
00090         d_printf("lseek_count:                    %u\n", profile_p->syscall_lseek_count);
00091         d_printf("lseek_time:                     %u\n", profile_p->syscall_lseek_time);
00092         d_printf("rename_count:                   %u\n", profile_p->syscall_rename_count);
00093         d_printf("rename_time:                    %u\n", profile_p->syscall_rename_time);
00094         d_printf("fsync_count:                    %u\n", profile_p->syscall_fsync_count);
00095         d_printf("fsync_time:                     %u\n", profile_p->syscall_fsync_time);
00096         d_printf("stat_count:                     %u\n", profile_p->syscall_stat_count);
00097         d_printf("stat_time:                      %u\n", profile_p->syscall_stat_time);
00098         d_printf("fstat_count:                    %u\n", profile_p->syscall_fstat_count);
00099         d_printf("fstat_time:                     %u\n", profile_p->syscall_fstat_time);
00100         d_printf("lstat_count:                    %u\n", profile_p->syscall_lstat_count);
00101         d_printf("lstat_time:                     %u\n", profile_p->syscall_lstat_time);
00102         d_printf("unlink_count:                   %u\n", profile_p->syscall_unlink_count);
00103         d_printf("unlink_time:                    %u\n", profile_p->syscall_unlink_time);
00104         d_printf("chmod_count:                    %u\n", profile_p->syscall_chmod_count);
00105         d_printf("chmod_time:                     %u\n", profile_p->syscall_chmod_time);
00106         d_printf("fchmod_count:                   %u\n", profile_p->syscall_fchmod_count);
00107         d_printf("fchmod_time:                    %u\n", profile_p->syscall_fchmod_time);
00108         d_printf("chown_count:                    %u\n", profile_p->syscall_chown_count);
00109         d_printf("chown_time:                     %u\n", profile_p->syscall_chown_time);
00110         d_printf("fchown_count:                   %u\n", profile_p->syscall_fchown_count);
00111         d_printf("fchown_time:                    %u\n", profile_p->syscall_fchown_time);
00112         d_printf("chdir_count:                    %u\n", profile_p->syscall_chdir_count);
00113         d_printf("chdir_time:                     %u\n", profile_p->syscall_chdir_time);
00114         d_printf("getwd_count:                    %u\n", profile_p->syscall_getwd_count);
00115         d_printf("getwd_time:                     %u\n", profile_p->syscall_getwd_time);
00116         d_printf("ntimes_count:                   %u\n", profile_p->syscall_ntimes_count);
00117         d_printf("ntimes_time:                    %u\n", profile_p->syscall_ntimes_time);
00118         d_printf("ftruncate_count:                %u\n", profile_p->syscall_ftruncate_count);
00119         d_printf("ftruncate_time:                 %u\n", profile_p->syscall_ftruncate_time);
00120         d_printf("fcntl_lock_count:               %u\n", profile_p->syscall_fcntl_lock_count);
00121         d_printf("fcntl_lock_time:                %u\n", profile_p->syscall_fcntl_lock_time);
00122         d_printf("readlink_count:                 %u\n", profile_p->syscall_readlink_count);
00123         d_printf("readlink_time:                  %u\n", profile_p->syscall_readlink_time);
00124         d_printf("symlink_count:                  %u\n", profile_p->syscall_symlink_count);
00125         d_printf("symlink_time:                   %u\n", profile_p->syscall_symlink_time);
00126 
00127         profile_separator("Stat Cache");
00128         d_printf("lookups:                        %u\n", profile_p->statcache_lookups);
00129         d_printf("misses:                         %u\n", profile_p->statcache_misses);
00130         d_printf("hits:                           %u\n", profile_p->statcache_hits);
00131 
00132         profile_separator("Write Cache");
00133         d_printf("read_hits:                      %u\n", profile_p->writecache_read_hits);
00134         d_printf("abutted_writes:                 %u\n", profile_p->writecache_abutted_writes);
00135         d_printf("total_writes:                   %u\n", profile_p->writecache_total_writes);
00136         d_printf("non_oplock_writes:              %u\n", profile_p->writecache_non_oplock_writes);
00137         d_printf("direct_writes:                  %u\n", profile_p->writecache_direct_writes);
00138         d_printf("init_writes:                    %u\n", profile_p->writecache_init_writes);
00139         d_printf("flushed_writes[SEEK]:           %u\n", profile_p->writecache_flushed_writes[SEEK_FLUSH]);
00140         d_printf("flushed_writes[READ]:           %u\n", profile_p->writecache_flushed_writes[READ_FLUSH]);
00141         d_printf("flushed_writes[WRITE]:          %u\n", profile_p->writecache_flushed_writes[WRITE_FLUSH]);
00142         d_printf("flushed_writes[READRAW]:        %u\n", profile_p->writecache_flushed_writes[READRAW_FLUSH]);
00143         d_printf("flushed_writes[OPLOCK_RELEASE]: %u\n", profile_p->writecache_flushed_writes[OPLOCK_RELEASE_FLUSH]);
00144         d_printf("flushed_writes[CLOSE]:          %u\n", profile_p->writecache_flushed_writes[CLOSE_FLUSH]);
00145         d_printf("flushed_writes[SYNC]:           %u\n", profile_p->writecache_flushed_writes[SYNC_FLUSH]);
00146         d_printf("flushed_writes[SIZECHANGE]:     %u\n", profile_p->writecache_flushed_writes[SIZECHANGE_FLUSH]);
00147         d_printf("num_perfect_writes:             %u\n", profile_p->writecache_num_perfect_writes);
00148         d_printf("num_write_caches:               %u\n", profile_p->writecache_num_write_caches);
00149         d_printf("allocated_write_caches:         %u\n", profile_p->writecache_allocated_write_caches);
00150 
00151         profile_separator("SMB Calls");
00152         d_printf("mkdir_count:                    %u\n", profile_p->SMBmkdir_count);
00153         d_printf("mkdir_time:                     %u\n", profile_p->SMBmkdir_time);
00154         d_printf("rmdir_count:                    %u\n", profile_p->SMBrmdir_count);
00155         d_printf("rmdir_time:                     %u\n", profile_p->SMBrmdir_time);
00156         d_printf("open_count:                     %u\n", profile_p->SMBopen_count);
00157         d_printf("open_time:                      %u\n", profile_p->SMBopen_time);
00158         d_printf("create_count:                   %u\n", profile_p->SMBcreate_count);
00159         d_printf("create_time:                    %u\n", profile_p->SMBcreate_time);
00160         d_printf("close_count:                    %u\n", profile_p->SMBclose_count);
00161         d_printf("close_time:                     %u\n", profile_p->SMBclose_time);
00162         d_printf("flush_count:                    %u\n", profile_p->SMBflush_count);
00163         d_printf("flush_time:                     %u\n", profile_p->SMBflush_time);
00164         d_printf("unlink_count:                   %u\n", profile_p->SMBunlink_count);
00165         d_printf("unlink_time:                    %u\n", profile_p->SMBunlink_time);
00166         d_printf("mv_count:                       %u\n", profile_p->SMBmv_count);
00167         d_printf("mv_time:                        %u\n", profile_p->SMBmv_time);
00168         d_printf("getatr_count:                   %u\n", profile_p->SMBgetatr_count);
00169         d_printf("getatr_time:                    %u\n", profile_p->SMBgetatr_time);
00170         d_printf("setatr_count:                   %u\n", profile_p->SMBsetatr_count);
00171         d_printf("setatr_time:                    %u\n", profile_p->SMBsetatr_time);
00172         d_printf("read_count:                     %u\n", profile_p->SMBread_count);
00173         d_printf("read_time:                      %u\n", profile_p->SMBread_time);
00174         d_printf("write_count:                    %u\n", profile_p->SMBwrite_count);
00175         d_printf("write_time:                     %u\n", profile_p->SMBwrite_time);
00176         d_printf("lock_count:                     %u\n", profile_p->SMBlock_count);
00177         d_printf("lock_time:                      %u\n", profile_p->SMBlock_time);
00178         d_printf("unlock_count:                   %u\n", profile_p->SMBunlock_count);
00179         d_printf("unlock_time:                    %u\n", profile_p->SMBunlock_time);
00180         d_printf("ctemp_count:                    %u\n", profile_p->SMBctemp_count);
00181         d_printf("ctemp_time:                     %u\n", profile_p->SMBctemp_time);
00182         d_printf("mknew_count:                    %u\n", profile_p->SMBmknew_count);
00183         d_printf("mknew_time:                     %u\n", profile_p->SMBmknew_time);
00184         d_printf("checkpath_count:                %u\n", profile_p->SMBcheckpath_count);
00185         d_printf("checkpath_time:                 %u\n", profile_p->SMBcheckpath_time);
00186         d_printf("exit_count:                     %u\n", profile_p->SMBexit_count);
00187         d_printf("exit_time:                      %u\n", profile_p->SMBexit_time);
00188         d_printf("lseek_count:                    %u\n", profile_p->SMBlseek_count);
00189         d_printf("lseek_time:                     %u\n", profile_p->SMBlseek_time);
00190         d_printf("lockread_count:                 %u\n", profile_p->SMBlockread_count);
00191         d_printf("lockread_time:                  %u\n", profile_p->SMBlockread_time);
00192         d_printf("writeunlock_count:              %u\n", profile_p->SMBwriteunlock_count);
00193         d_printf("writeunlock_time:               %u\n", profile_p->SMBwriteunlock_time);
00194         d_printf("readbraw_count:                 %u\n", profile_p->SMBreadbraw_count);
00195         d_printf("readbraw_time:                  %u\n", profile_p->SMBreadbraw_time);
00196         d_printf("readBmpx_count:                 %u\n", profile_p->SMBreadBmpx_count);
00197         d_printf("readBmpx_time:                  %u\n", profile_p->SMBreadBmpx_time);
00198         d_printf("readBs_count:                   %u\n", profile_p->SMBreadBs_count);
00199         d_printf("readBs_time:                    %u\n", profile_p->SMBreadBs_time);
00200         d_printf("writebraw_count:                %u\n", profile_p->SMBwritebraw_count);
00201         d_printf("writebraw_time:                 %u\n", profile_p->SMBwritebraw_time);
00202         d_printf("writeBmpx_count:                %u\n", profile_p->SMBwriteBmpx_count);
00203         d_printf("writeBmpx_time:                 %u\n", profile_p->SMBwriteBmpx_time);
00204         d_printf("writeBs_count:                  %u\n", profile_p->SMBwriteBs_count);
00205         d_printf("writeBs_time:                   %u\n", profile_p->SMBwriteBs_time);
00206         d_printf("writec_count:                   %u\n", profile_p->SMBwritec_count);
00207         d_printf("writec_time:                    %u\n", profile_p->SMBwritec_time);
00208         d_printf("setattrE_count:                 %u\n", profile_p->SMBsetattrE_count);
00209         d_printf("setattrE_time:                  %u\n", profile_p->SMBsetattrE_time);
00210         d_printf("getattrE_count:                 %u\n", profile_p->SMBgetattrE_count);
00211         d_printf("getattrE_time:                  %u\n", profile_p->SMBgetattrE_time);
00212         d_printf("lockingX_count:                 %u\n", profile_p->SMBlockingX_count);
00213         d_printf("lockingX_time:                  %u\n", profile_p->SMBlockingX_time);
00214         d_printf("trans_count:                    %u\n", profile_p->SMBtrans_count);
00215         d_printf("trans_time:                     %u\n", profile_p->SMBtrans_time);
00216         d_printf("transs_count:                   %u\n", profile_p->SMBtranss_count);
00217         d_printf("transs_time:                    %u\n", profile_p->SMBtranss_time);
00218         d_printf("ioctl_count:                    %u\n", profile_p->SMBioctl_count);
00219         d_printf("ioctl_time:                     %u\n", profile_p->SMBioctl_time);
00220         d_printf("ioctls_count:                   %u\n", profile_p->SMBioctls_count);
00221         d_printf("ioctls_time:                    %u\n", profile_p->SMBioctls_time);
00222         d_printf("copy_count:                     %u\n", profile_p->SMBcopy_count);
00223         d_printf("copy_time:                      %u\n", profile_p->SMBcopy_time);
00224         d_printf("move_count:                     %u\n", profile_p->SMBmove_count);
00225         d_printf("move_time:                      %u\n", profile_p->SMBmove_time);
00226         d_printf("echo_count:                     %u\n", profile_p->SMBecho_count);
00227         d_printf("echo_time:                      %u\n", profile_p->SMBecho_time);
00228         d_printf("writeclose_count:               %u\n", profile_p->SMBwriteclose_count);
00229         d_printf("writeclose_time:                %u\n", profile_p->SMBwriteclose_time);
00230         d_printf("openX_count:                    %u\n", profile_p->SMBopenX_count);
00231         d_printf("openX_time:                     %u\n", profile_p->SMBopenX_time);
00232         d_printf("readX_count:                    %u\n", profile_p->SMBreadX_count);
00233         d_printf("readX_time:                     %u\n", profile_p->SMBreadX_time);
00234         d_printf("writeX_count:                   %u\n", profile_p->SMBwriteX_count);
00235         d_printf("writeX_time:                    %u\n", profile_p->SMBwriteX_time);
00236         d_printf("trans2_count:                   %u\n", profile_p->SMBtrans2_count);
00237         d_printf("trans2_time:                    %u\n", profile_p->SMBtrans2_time);
00238         d_printf("transs2_count:                  %u\n", profile_p->SMBtranss2_count);
00239         d_printf("transs2_time:                   %u\n", profile_p->SMBtranss2_time);
00240         d_printf("findclose_count:                %u\n", profile_p->SMBfindclose_count);
00241         d_printf("findclose_time:                 %u\n", profile_p->SMBfindclose_time);
00242         d_printf("findnclose_count:               %u\n", profile_p->SMBfindnclose_count);
00243         d_printf("findnclose_time:                %u\n", profile_p->SMBfindnclose_time);
00244         d_printf("tcon_count:                     %u\n", profile_p->SMBtcon_count);
00245         d_printf("tcon_time:                      %u\n", profile_p->SMBtcon_time);
00246         d_printf("tdis_count:                     %u\n", profile_p->SMBtdis_count);
00247         d_printf("tdis_time:                      %u\n", profile_p->SMBtdis_time);
00248         d_printf("negprot_count:                  %u\n", profile_p->SMBnegprot_count);
00249         d_printf("negprot_time:                   %u\n", profile_p->SMBnegprot_time);
00250         d_printf("sesssetupX_count:               %u\n", profile_p->SMBsesssetupX_count);
00251         d_printf("sesssetupX_time:                %u\n", profile_p->SMBsesssetupX_time);
00252         d_printf("ulogoffX_count:                 %u\n", profile_p->SMBulogoffX_count);
00253         d_printf("ulogoffX_time:                  %u\n", profile_p->SMBulogoffX_time);
00254         d_printf("tconX_count:                    %u\n", profile_p->SMBtconX_count);
00255         d_printf("tconX_time:                     %u\n", profile_p->SMBtconX_time);
00256         d_printf("dskattr_count:                  %u\n", profile_p->SMBdskattr_count);
00257         d_printf("dskattr_time:                   %u\n", profile_p->SMBdskattr_time);
00258         d_printf("search_count:                   %u\n", profile_p->SMBsearch_count);
00259         d_printf("search_time:                    %u\n", profile_p->SMBsearch_time);
00260         d_printf("ffirst_count:                   %u\n", profile_p->SMBffirst_count);
00261         d_printf("ffirst_time:                    %u\n", profile_p->SMBffirst_time);
00262         d_printf("funique_count:                  %u\n", profile_p->SMBfunique_count);
00263         d_printf("funique_time:                   %u\n", profile_p->SMBfunique_time);
00264         d_printf("fclose_count:                   %u\n", profile_p->SMBfclose_count);
00265         d_printf("fclose_time:                    %u\n", profile_p->SMBfclose_time);
00266         d_printf("nttrans_count:                  %u\n", profile_p->SMBnttrans_count);
00267         d_printf("nttrans_time:                   %u\n", profile_p->SMBnttrans_time);
00268         d_printf("nttranss_count:                 %u\n", profile_p->SMBnttranss_count);
00269         d_printf("nttranss_time:                  %u\n", profile_p->SMBnttranss_time);
00270         d_printf("ntcreateX_count:                %u\n", profile_p->SMBntcreateX_count);
00271         d_printf("ntcreateX_time:                 %u\n", profile_p->SMBntcreateX_time);
00272         d_printf("ntcancel_count:                 %u\n", profile_p->SMBntcancel_count);
00273         d_printf("ntcancel_time:                  %u\n", profile_p->SMBntcancel_time);
00274         d_printf("splopen_count:                  %u\n", profile_p->SMBsplopen_count);
00275         d_printf("splopen_time:                   %u\n", profile_p->SMBsplopen_time);
00276         d_printf("splwr_count:                    %u\n", profile_p->SMBsplwr_count);
00277         d_printf("splwr_time:                     %u\n", profile_p->SMBsplwr_time);
00278         d_printf("splclose_count:                 %u\n", profile_p->SMBsplclose_count);
00279         d_printf("splclose_time:                  %u\n", profile_p->SMBsplclose_time);
00280         d_printf("splretq_count:                  %u\n", profile_p->SMBsplretq_count);
00281         d_printf("splretq_time:                   %u\n", profile_p->SMBsplretq_time);
00282         d_printf("sends_count:                    %u\n", profile_p->SMBsends_count);
00283         d_printf("sends_time:                     %u\n", profile_p->SMBsends_time);
00284         d_printf("sendb_count:                    %u\n", profile_p->SMBsendb_count);
00285         d_printf("sendb_time:                     %u\n", profile_p->SMBsendb_time);
00286         d_printf("fwdname_count:                  %u\n", profile_p->SMBfwdname_count);
00287         d_printf("fwdname_time:                   %u\n", profile_p->SMBfwdname_time);
00288         d_printf("cancelf_count:                  %u\n", profile_p->SMBcancelf_count);
00289         d_printf("cancelf_time:                   %u\n", profile_p->SMBcancelf_time);
00290         d_printf("getmac_count:                   %u\n", profile_p->SMBgetmac_count);
00291         d_printf("getmac_time:                    %u\n", profile_p->SMBgetmac_time);
00292         d_printf("sendstrt_count:                 %u\n", profile_p->SMBsendstrt_count);
00293         d_printf("sendstrt_time:                  %u\n", profile_p->SMBsendstrt_time);
00294         d_printf("sendend_count:                  %u\n", profile_p->SMBsendend_count);
00295         d_printf("sendend_time:                   %u\n", profile_p->SMBsendend_time);
00296         d_printf("sendtxt_count:                  %u\n", profile_p->SMBsendtxt_count);
00297         d_printf("sendtxt_time:                   %u\n", profile_p->SMBsendtxt_time);
00298         d_printf("invalid_count:                  %u\n", profile_p->SMBinvalid_count);
00299         d_printf("invalid_time:                   %u\n", profile_p->SMBinvalid_time);
00300 
00301         profile_separator("Pathworks Calls");
00302         d_printf("setdir_count:                   %u\n", profile_p->pathworks_setdir_count);
00303         d_printf("setdir_time:                    %u\n", profile_p->pathworks_setdir_time);
00304 
00305         profile_separator("Trans2 Calls");
00306         d_printf("open_count:                     %u\n", profile_p->Trans2_open_count);
00307         d_printf("open_time:                      %u\n", profile_p->Trans2_open_time);
00308         d_printf("findfirst_count:                %u\n", profile_p->Trans2_findfirst_count);
00309         d_printf("findfirst_time:                 %u\n", profile_p->Trans2_findfirst_time);
00310         d_printf("findnext_count:                 %u\n", profile_p->Trans2_findnext_count);
00311         d_printf("findnext_time:                  %u\n", profile_p->Trans2_findnext_time);
00312         d_printf("qfsinfo_count:                  %u\n", profile_p->Trans2_qfsinfo_count);
00313         d_printf("qfsinfo_time:                   %u\n", profile_p->Trans2_qfsinfo_time);
00314         d_printf("setfsinfo_count:                %u\n", profile_p->Trans2_setfsinfo_count);
00315         d_printf("setfsinfo_time:                 %u\n", profile_p->Trans2_setfsinfo_time);
00316         d_printf("qpathinfo_count:                %u\n", profile_p->Trans2_qpathinfo_count);
00317         d_printf("qpathinfo_time:                 %u\n", profile_p->Trans2_qpathinfo_time);
00318         d_printf("setpathinfo_count:              %u\n", profile_p->Trans2_setpathinfo_count);
00319         d_printf("setpathinfo_time:               %u\n", profile_p->Trans2_setpathinfo_time);
00320         d_printf("qfileinfo_count:                %u\n", profile_p->Trans2_qfileinfo_count);
00321         d_printf("qfileinfo_time:                 %u\n", profile_p->Trans2_qfileinfo_time);
00322         d_printf("setfileinfo_count:              %u\n", profile_p->Trans2_setfileinfo_count);
00323         d_printf("setfileinfo_time:               %u\n", profile_p->Trans2_setfileinfo_time);
00324         d_printf("fsctl_count:                    %u\n", profile_p->Trans2_fsctl_count);
00325         d_printf("fsctl_time:                     %u\n", profile_p->Trans2_fsctl_time);
00326         d_printf("ioctl_count:                    %u\n", profile_p->Trans2_ioctl_count);
00327         d_printf("ioctl_time:                     %u\n", profile_p->Trans2_ioctl_time);
00328         d_printf("findnotifyfirst_count:          %u\n", profile_p->Trans2_findnotifyfirst_count);
00329         d_printf("findnotifyfirst_time:           %u\n", profile_p->Trans2_findnotifyfirst_time);
00330         d_printf("findnotifynext_count:           %u\n", profile_p->Trans2_findnotifynext_count);
00331         d_printf("findnotifynext_time:            %u\n", profile_p->Trans2_findnotifynext_time);
00332         d_printf("mkdir_count:                    %u\n", profile_p->Trans2_mkdir_count);
00333         d_printf("mkdir_time:                     %u\n", profile_p->Trans2_mkdir_time);
00334         d_printf("session_setup_count:            %u\n", profile_p->Trans2_session_setup_count);
00335         d_printf("session_setup_time:             %u\n", profile_p->Trans2_session_setup_time);
00336         d_printf("get_dfs_referral_count:         %u\n", profile_p->Trans2_get_dfs_referral_count);
00337         d_printf("get_dfs_referral_time:          %u\n", profile_p->Trans2_get_dfs_referral_time);
00338         d_printf("report_dfs_inconsistancy_count: %u\n", profile_p->Trans2_report_dfs_inconsistancy_count);
00339         d_printf("report_dfs_inconsistancy_time:  %u\n", profile_p->Trans2_report_dfs_inconsistancy_time);
00340 
00341         profile_separator("NT Transact Calls");
00342         d_printf("create_count:                   %u\n", profile_p->NT_transact_create_count);
00343         d_printf("create_time:                    %u\n", profile_p->NT_transact_create_time);
00344         d_printf("ioctl_count:                    %u\n", profile_p->NT_transact_ioctl_count);
00345         d_printf("ioctl_time:                     %u\n", profile_p->NT_transact_ioctl_time);
00346         d_printf("set_security_desc_count:        %u\n", profile_p->NT_transact_set_security_desc_count);
00347         d_printf("set_security_desc_time:         %u\n", profile_p->NT_transact_set_security_desc_time);
00348         d_printf("notify_change_count:            %u\n", profile_p->NT_transact_notify_change_count);
00349         d_printf("notify_change_time:             %u\n", profile_p->NT_transact_notify_change_time);
00350         d_printf("rename_count:                   %u\n", profile_p->NT_transact_rename_count);
00351         d_printf("rename_time:                    %u\n", profile_p->NT_transact_rename_time);
00352         d_printf("query_security_desc_count:      %u\n", profile_p->NT_transact_query_security_desc_count);
00353         d_printf("query_security_desc_time:       %u\n", profile_p->NT_transact_query_security_desc_time);
00354 
00355         profile_separator("ACL Calls");
00356         d_printf("get_nt_acl_count:               %u\n", profile_p->get_nt_acl_count);
00357         d_printf("get_nt_acl_time:                %u\n", profile_p->get_nt_acl_time);
00358         d_printf("fget_nt_acl_count:              %u\n", profile_p->fget_nt_acl_count);
00359         d_printf("fget_nt_acl_time:               %u\n", profile_p->fget_nt_acl_time);
00360         d_printf("set_nt_acl_count:               %u\n", profile_p->set_nt_acl_count);
00361         d_printf("set_nt_acl_time:                %u\n", profile_p->set_nt_acl_time);
00362         d_printf("fset_nt_acl_count:              %u\n", profile_p->fset_nt_acl_count);
00363         d_printf("fset_nt_acl_time:               %u\n", profile_p->fset_nt_acl_time);
00364         d_printf("chmod_acl_count:                %u\n", profile_p->chmod_acl_count);
00365         d_printf("chmod_acl_time:                 %u\n", profile_p->chmod_acl_time);
00366         d_printf("fchmod_acl_count:               %u\n", profile_p->fchmod_acl_count);
00367         d_printf("fchmod_acl_time:                %u\n", profile_p->fchmod_acl_time);
00368 
00369         profile_separator("NMBD Calls");
00370         d_printf("name_release_count:             %u\n", profile_p->name_release_count);
00371         d_printf("name_release_time:              %u\n", profile_p->name_release_time);
00372         d_printf("name_refresh_count:             %u\n", profile_p->name_refresh_count);
00373         d_printf("name_refresh_time:              %u\n", profile_p->name_refresh_time);
00374         d_printf("name_registration_count:        %u\n", profile_p->name_registration_count);
00375         d_printf("name_registration_time:         %u\n", profile_p->name_registration_time);
00376         d_printf("node_status_count:              %u\n", profile_p->node_status_count);
00377         d_printf("node_status_time:               %u\n", profile_p->node_status_time);
00378         d_printf("name_query_count:               %u\n", profile_p->name_query_count);
00379         d_printf("name_query_time:                %u\n", profile_p->name_query_time);
00380         d_printf("host_announce_count:            %u\n", profile_p->host_announce_count);
00381         d_printf("host_announce_time:             %u\n", profile_p->host_announce_time);
00382         d_printf("workgroup_announce_count:       %u\n", profile_p->workgroup_announce_count);
00383         d_printf("workgroup_announce_time:        %u\n", profile_p->workgroup_announce_time);
00384         d_printf("local_master_announce_count:    %u\n", profile_p->local_master_announce_count);
00385         d_printf("local_master_announce_time:     %u\n", profile_p->local_master_announce_time);
00386         d_printf("master_browser_announce_count:  %u\n", profile_p->master_browser_announce_count);
00387         d_printf("master_browser_announce_time:   %u\n", profile_p->master_browser_announce_time);
00388         d_printf("lm_host_announce_count:         %u\n", profile_p->lm_host_announce_count);
00389         d_printf("lm_host_announce_time:          %u\n", profile_p->lm_host_announce_time);
00390         d_printf("get_backup_list_count:          %u\n", profile_p->get_backup_list_count);
00391         d_printf("get_backup_list_time:           %u\n", profile_p->get_backup_list_time);
00392         d_printf("reset_browser_count:            %u\n", profile_p->reset_browser_count);
00393         d_printf("reset_browser_time:             %u\n", profile_p->reset_browser_time);
00394         d_printf("announce_request_count:         %u\n", profile_p->announce_request_count);
00395         d_printf("announce_request_time:          %u\n", profile_p->announce_request_time);
00396         d_printf("lm_announce_request_count:      %u\n", profile_p->lm_announce_request_count);
00397         d_printf("lm_announce_request_time:       %u\n", profile_p->lm_announce_request_time);
00398         d_printf("domain_logon_count:             %u\n", profile_p->domain_logon_count);
00399         d_printf("domain_logon_time:              %u\n", profile_p->domain_logon_time);
00400         d_printf("sync_browse_lists_count:        %u\n", profile_p->sync_browse_lists_count);
00401         d_printf("sync_browse_lists_time:         %u\n", profile_p->sync_browse_lists_time);
00402         d_printf("run_elections_count:            %u\n", profile_p->run_elections_count);
00403         d_printf("run_elections_time:             %u\n", profile_p->run_elections_time);
00404         d_printf("election_count:                 %u\n", profile_p->election_count);
00405         d_printf("election_time:                  %u\n", profile_p->election_time);
00406 #else /* WITH_PROFILE */
00407         fprintf(stderr, "Profile data unavailable\n");
00408 #endif /* WITH_PROFILE */
00409 
00410         return True;
00411 }

BOOL status_profile_rates ( BOOL  be_verbose  ) 

status_profile.c475 行で定義されています。

参照先 fprintf()print_count_samples()printf()profile_pprofile_setup()profile_timestamp()sample_datasample_timesys_usleep().

参照元 main().

00476 {
00477         SMB_BIG_UINT remain_usec;
00478         SMB_BIG_UINT next_usec;
00479         SMB_BIG_UINT delta_usec;
00480 
00481         int last = 0;
00482         int current = 1;
00483         int tmp;
00484 
00485         if (verbose) {
00486             fprintf(stderr, "Sampling stats at %d sec intervals\n",
00487                     usec_to_sec(sample_interval_usec));
00488         }
00489 
00490         if (!profile_setup(True)) {
00491                 fprintf(stderr,"Failed to initialise profile memory\n");
00492                 return False;
00493         }
00494 
00495         memcpy(&sample_data[last], profile_p, sizeof(*profile_p));
00496         for (;;) {
00497                 sample_time[current] = profile_timestamp();
00498                 next_usec = sample_time[current] + sample_interval_usec;
00499 
00500                 /* Take a sample. */
00501                 memcpy(&sample_data[current], profile_p, sizeof(*profile_p));
00502 
00503                 /* Rate convert some values and print results. */
00504                 delta_usec = sample_time[current] - sample_time[last];
00505 
00506                 if (print_count_samples(&sample_data[current],
00507                         &sample_data[last], delta_usec)) {
00508                         printf("\n");
00509                 }
00510 
00511                 /* Swap sampling buffers. */
00512                 tmp = last;
00513                 last = current;
00514                 current = tmp;
00515 
00516                 /* Delay until next sample time. */
00517                 remain_usec = next_usec - profile_timestamp();
00518                 if (remain_usec > sample_interval_usec) {
00519                         fprintf(stderr, "eek! falling behind sampling rate!\n");
00520                 } else {
00521                         if (verbose) {
00522                             fprintf(stderr,
00523                                     "delaying for %lu msec\n",
00524                                     (unsigned long )usec_to_msec(remain_usec));
00525                         }
00526 
00527                         sys_usleep(remain_usec);
00528                 }
00529 
00530         }
00531 
00532         return True;
00533 }

static void Ucrit_addUid ( uid_t  uid  )  [static]

status.c55 行で定義されています。

参照先 Ucrit_IsActiveUcrit_uid.

参照元 main().

00056 {
00057         Ucrit_uid = uid;
00058         Ucrit_IsActive = 1;
00059 }

static unsigned int Ucrit_checkUid ( uid_t  uid  )  [static]

status.c61 行で定義されています。

参照先 Ucrit_IsActiveUcrit_uid.

参照元 traverse_fn1()traverse_sessionid().

00062 {
00063         if ( !Ucrit_IsActive ) 
00064                 return 1;
00065         
00066         if ( uid == Ucrit_uid ) 
00067                 return 1;
00068         
00069         return 0;
00070 }

static unsigned int Ucrit_checkPid ( pid_t  pid  )  [static]

status.c72 行で定義されています。

参照先 Ucrit_IsActiveUcrit_MaxPidUcrit_pid.

参照元 print_share_mode().

00073 {
00074         int i;
00075         
00076         if ( !Ucrit_IsActive ) 
00077                 return 1;
00078         
00079         for (i=0;i<Ucrit_MaxPid;i++) {
00080                 if( pid == Ucrit_pid[i] ) 
00081                         return 1;
00082         }
00083         
00084         return 0;
00085 }

static BOOL Ucrit_addPid ( pid_t  pid  )  [static]

status.c87 行で定義されています。

参照先 d_printf()Ucrit_IsActiveUcrit_MaxPidUcrit_pidUcrit_uiduidtoname().

参照元 traverse_sessionid().

00088 {
00089         if ( !Ucrit_IsActive )
00090                 return True;
00091 
00092         if ( Ucrit_MaxPid >= SMB_MAXPIDS ) {
00093                 d_printf("ERROR: More than %d pids for user %s!\n",
00094                          SMB_MAXPIDS, uidtoname(Ucrit_uid));
00095 
00096                 return False;
00097         }
00098 
00099         Ucrit_pid[Ucrit_MaxPid++] = pid;
00100         
00101         return True;
00102 }

static void print_share_mode ( const struct share_mode_entry e,
const char *  sharepath,
const char *  fname,
void *  dummy 
) [static]

status.c104 行で定義されています。

参照先 share_mode_entry::access_maskd_printf()is_valid_share_mode_entry()map_share_mode_to_deny_mode()share_mode_entry::op_typeshare_mode_entry::pidprintf()share_mode_entry::private_optionsprocid_str_static()procid_to_pid()share_mode_entry::share_accessshare_mode_entry::timetime_to_asc()Ucrit_checkPid()share_mode_entry::uid.

参照元 main()status_page().

00108 {
00109         static int count;
00110 
00111         if (!is_valid_share_mode_entry(e)) {
00112                 return;
00113         }
00114 
00115         if (count==0) {
00116                 d_printf("Locked files:\n");
00117                 d_printf("Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time\n");
00118                 d_printf("--------------------------------------------------------------------------------------------------\n");
00119         }
00120         count++;
00121 
00122         if (Ucrit_checkPid(procid_to_pid(&e->pid))) {
00123                 d_printf("%-11s  ",procid_str_static(&e->pid));
00124                 d_printf("%-9u  ", (unsigned int)e->uid);
00125                 switch (map_share_mode_to_deny_mode(e->share_access,
00126                                                     e->private_options)) {
00127                         case DENY_NONE: d_printf("DENY_NONE  "); break;
00128                         case DENY_ALL:  d_printf("DENY_ALL   "); break;
00129                         case DENY_DOS:  d_printf("DENY_DOS   "); break;
00130                         case DENY_READ: d_printf("DENY_READ  "); break;
00131                         case DENY_WRITE:printf("DENY_WRITE "); break;
00132                         case DENY_FCB:  d_printf("DENY_FCB "); break;
00133                         default: {
00134                                 d_printf("unknown-please report ! "
00135                                          "e->share_access = 0x%x, "
00136                                          "e->private_options = 0x%x\n",
00137                                          (unsigned int)e->share_access,
00138                                          (unsigned int)e->private_options );
00139                                 break;
00140                         }
00141                 }
00142                 d_printf("0x%-8x  ",(unsigned int)e->access_mask);
00143                 if ((e->access_mask & (FILE_READ_DATA|FILE_WRITE_DATA))==
00144                                 (FILE_READ_DATA|FILE_WRITE_DATA)) {
00145                         d_printf("RDWR       ");
00146                 } else if (e->access_mask & FILE_WRITE_DATA) {
00147                         d_printf("WRONLY     ");
00148                 } else {
00149                         d_printf("RDONLY     ");
00150                 }
00151 
00152                 if((e->op_type & (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) == 
00153                                         (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) {
00154                         d_printf("EXCLUSIVE+BATCH ");
00155                 } else if (e->op_type & EXCLUSIVE_OPLOCK) {
00156                         d_printf("EXCLUSIVE       ");
00157                 } else if (e->op_type & BATCH_OPLOCK) {
00158                         d_printf("BATCH           ");
00159                 } else if (e->op_type & LEVEL_II_OPLOCK) {
00160                         d_printf("LEVEL_II        ");
00161                 } else {
00162                         d_printf("NONE            ");
00163                 }
00164 
00165                 d_printf(" %s   %s   %s",sharepath, fname, time_to_asc((time_t)e->time.tv_sec));
00166         }
00167 }

static void print_brl ( SMB_DEV_T  dev,
SMB_INO_T  ino,
struct process_id  pid,
enum brl_type  lock_type,
enum brl_flavour  lock_flav,
br_off  start,
br_off  size 
) [static]

status.c169 行で定義されています。

参照先 d_printf()procid_str_static()READ_LOCK.

00176 {
00177         static int count;
00178         if (count==0) {
00179                 d_printf("Byte range locks:\n");
00180                 d_printf("   Pid     dev:inode  R/W      start        size\n");
00181                 d_printf("------------------------------------------------\n");
00182         }
00183         count++;
00184 
00185         d_printf("%8s   %05x:%05x    %s  %9.0f   %9.0f\n", 
00186                procid_str_static(&pid), (int)dev, (int)ino, 
00187                lock_type==READ_LOCK?"R":"W",
00188                (double)start, (double)size);
00189 }

static int traverse_fn1 ( TDB_CONTEXT tdb,
TDB_DATA  kbuf,
TDB_DATA  dbuf,
void *  state 
) [static]

status.c191 行で定義されています。

参照先 d_printf()TDB_DATA::dptrTDB_DATA::dsizeprocess_exists()procid_str_static()time_to_asc()Ucrit_checkUid().

参照元 main()status_page().

00192 {
00193         struct connections_data crec;
00194 
00195         if (dbuf.dsize != sizeof(crec))
00196                 return 0;
00197 
00198         memcpy(&crec, dbuf.dptr, sizeof(crec));
00199 
00200         if (crec.cnum == -1)
00201                 return 0;
00202 
00203         if (!process_exists(crec.pid) || !Ucrit_checkUid(crec.uid)) {
00204                 return 0;
00205         }
00206 
00207         d_printf("%-10s   %s   %-12s  %s",
00208                crec.servicename,procid_str_static(&crec.pid),
00209                crec.machine,
00210                time_to_asc(crec.start));
00211 
00212         return 0;
00213 }

static int traverse_sessionid ( TDB_CONTEXT tdb,
TDB_DATA  kbuf,
TDB_DATA  dbuf,
void *  state 
) [static]

status.c215 行で定義されています。

参照先 d_printf()TDB_DATA::dptrTDB_DATA::dsizefstr_sprintf()gidtoname()numeric_onlyprocess_exists_by_pid()Ucrit_addPid()Ucrit_checkUid()uidtoname().

参照元 main().

00216 {
00217         struct sessionid sessionid;
00218         fstring uid_str, gid_str;
00219 
00220         if (dbuf.dsize != sizeof(sessionid))
00221                 return 0;
00222 
00223         memcpy(&sessionid, dbuf.dptr, sizeof(sessionid));
00224 
00225         if (!process_exists_by_pid(sessionid.pid) || !Ucrit_checkUid(sessionid.uid)) {
00226                 return 0;
00227         }
00228 
00229         Ucrit_addPid( sessionid.pid );
00230 
00231         fstr_sprintf(uid_str, "%d", sessionid.uid);
00232         fstr_sprintf(gid_str, "%d", sessionid.gid);
00233 
00234         d_printf("%5d   %-12s  %-12s  %-12s (%s)\n",
00235                  (int)sessionid.pid,
00236                  numeric_only ? uid_str : uidtoname(sessionid.uid),
00237                  numeric_only ? gid_str : gidtoname(sessionid.gid), 
00238                  sessionid.remote_machine, sessionid.hostname);
00239         
00240         return 0;
00241 }

int main ( int  argc,
char *  argv[] 
)

status.c246 行で定義されています。

参照先 briefbrl_forall()cd_printf()dbfdyn_CONFIGFILEfprintf()load_case_tables()lock_path()locking_end()locking_init()locks_onlynametouid()numeric_onlypoptGetContext()poptGetNextOpt()poptGetOptArg()print_brl()print_share_mode()processes_onlysec_init()setup_logging()share_mode_forall()shares_onlyshow_brlshow_locks()status_profile_dump()status_profile_rates()tdbtdb_close()tdb_open_log()tdb_traverse()traverse_fn1()traverse_sessionid()Ucrit_addUid()usernameverbosex_stderr.

00247 {
00248         int c;
00249         int profile_only = 0;
00250         TDB_CONTEXT *tdb;
00251         BOOL show_processes, show_locks, show_shares;
00252         poptContext pc;
00253         struct poptOption long_options[] = {
00254                 POPT_AUTOHELP
00255                 {"processes",   'p', POPT_ARG_NONE,     &processes_only, 'p', "Show processes only" },
00256                 {"verbose",     'v', POPT_ARG_NONE, &verbose, 'v', "Be verbose" },
00257                 {"locks",       'L', POPT_ARG_NONE,     &locks_only, 'L', "Show locks only" },
00258                 {"shares",      'S', POPT_ARG_NONE,     &shares_only, 'S', "Show shares only" },
00259                 {"user",        'u', POPT_ARG_STRING,   &username, 'u', "Switch to user" },
00260                 {"brief",       'b', POPT_ARG_NONE,     &brief, 'b', "Be brief" },
00261                 {"profile",     'P', POPT_ARG_NONE, NULL, 'P', "Do profiling" },
00262                 {"profile-rates", 'R', POPT_ARG_NONE, NULL, 'R', "Show call rates" },
00263                 {"byterange",   'B', POPT_ARG_NONE,     &show_brl, 'B', "Include byte range locks"},
00264                 {"numeric",     'n', POPT_ARG_NONE,     &numeric_only, 'n', "Numeric uid/gid"},
00265                 POPT_COMMON_SAMBA
00266                 POPT_TABLEEND
00267         };
00268 
00269         sec_init();
00270         load_case_tables();
00271 
00272         setup_logging(argv[0],True);
00273         
00274         dbf = x_stderr;
00275         
00276         if (getuid() != geteuid()) {
00277                 d_printf("smbstatus should not be run setuid\n");
00278                 return(1);
00279         }
00280 
00281         pc = poptGetContext(NULL, argc, (const char **) argv, long_options, 
00282                             POPT_CONTEXT_KEEP_FIRST);
00283         
00284         while ((c = poptGetNextOpt(pc)) != -1) {
00285                 switch (c) {
00286                 case 'u':                                      
00287                         Ucrit_addUid(nametouid(poptGetOptArg(pc)));
00288                         break;
00289                 case 'P':
00290                 case 'R':
00291                         profile_only = c;
00292                 }
00293         }
00294 
00295         /* setup the flags based on the possible combincations */
00296 
00297         show_processes = !(shares_only || locks_only || profile_only) || processes_only;
00298         show_locks     = !(shares_only || processes_only || profile_only) || locks_only;
00299         show_shares    = !(processes_only || locks_only || profile_only) || shares_only;
00300 
00301         if ( username )
00302                 Ucrit_addUid( nametouid(username) );
00303 
00304         if (verbose) {
00305                 d_printf("using configfile = %s\n", dyn_CONFIGFILE);
00306         }
00307 
00308         if (!lp_load(dyn_CONFIGFILE,False,False,False,True)) {
00309                 fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
00310                 return (-1);
00311         }
00312 
00313         switch (profile_only) {
00314                 case 'P':
00315                         /* Dump profile data */
00316                         return status_profile_dump(verbose);
00317                 case 'R':
00318                         /* Continuously display rate-converted data */
00319                         return status_profile_rates(verbose);
00320                 default:
00321                         break;
00322         }
00323 
00324         if ( show_processes ) {
00325                 tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
00326                 if (!tdb) {
00327                         d_printf("sessionid.tdb not initialised\n");
00328                 } else {
00329                         d_printf("\nSamba version %s\n",SAMBA_VERSION_STRING);
00330                         d_printf("PID     Username      Group         Machine                        \n");
00331                         d_printf("-------------------------------------------------------------------\n");
00332 
00333                         tdb_traverse(tdb, traverse_sessionid, NULL);
00334                         tdb_close(tdb);
00335                 }
00336 
00337                 if (processes_only) 
00338                         exit(0);        
00339         }
00340   
00341         if ( show_shares ) {
00342                 tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
00343                 if (!tdb) {
00344                         d_printf("%s not initialised\n", lock_path("connections.tdb"));
00345                         d_printf("This is normal if an SMB client has never connected to your server.\n");
00346                 }  else  {
00347                         if (verbose) {
00348                                 d_printf("Opened %s\n", lock_path("connections.tdb"));
00349                         }
00350 
00351                         if (brief) 
00352                                 exit(0);
00353                 
00354                         d_printf("\nService      pid     machine       Connected at\n");
00355                         d_printf("-------------------------------------------------------\n");
00356         
00357                         tdb_traverse(tdb, traverse_fn1, NULL);
00358                         tdb_close(tdb);
00359 
00360                         d_printf("\n");
00361                 }
00362 
00363                 if ( shares_only )
00364                         exit(0);
00365         }
00366 
00367         if ( show_locks ) {
00368                 int ret;
00369 
00370                 tdb = tdb_open_log(lock_path("locking.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
00371 
00372                 if (!tdb) {
00373                         d_printf("%s not initialised\n", lock_path("locking.tdb"));
00374                         d_printf("This is normal if an SMB client has never connected to your server.\n");
00375                         exit(0);
00376                 } else {
00377                         tdb_close(tdb);
00378                 }
00379 
00380                 if (!locking_init(1)) {
00381                         d_printf("Can't initialise locking module - exiting\n");
00382                         exit(1);
00383                 }
00384                 
00385                 ret = share_mode_forall(print_share_mode, NULL);
00386 
00387                 if (ret == 0) {
00388                         d_printf("No locked files\n");
00389                 } else if (ret == -1) {
00390                         d_printf("locked file list truncated\n");
00391                 }
00392                 
00393                 d_printf("\n");
00394 
00395                 if (show_brl) {
00396                         brl_forall(print_brl);
00397                 }
00398                 
00399                 locking_end();
00400         }
00401 
00402         return (0);
00403 }


変数

uid_t Ucrit_uid = 0 [static]

status.c37 行で定義されています。

参照元 Ucrit_addPid()Ucrit_addUid()Ucrit_checkUid().

pid_t Ucrit_pid[SMB_MAXPIDS] [static]

status.c38 行で定義されています。

参照元 Ucrit_addPid()Ucrit_checkPid().

int Ucrit_MaxPid = 0 [static]

status.c39 行で定義されています。

参照元 Ucrit_addPid()Ucrit_checkPid().

unsigned int Ucrit_IsActive = 0 [static]

status.c40 行で定義されています。

参照元 Ucrit_addPid()Ucrit_addUid()Ucrit_checkPid()Ucrit_checkUid().

int verbose [static]

status.c42 行で定義されています。

int brief [static]

status.c42 行で定義されています。

参照元 main().

int shares_only = 0 [static]

status.c43 行で定義されています。

参照元 main().

int locks_only = 0 [static]

status.c44 行で定義されています。

参照元 main().

BOOL processes_only = False [static]

status.c45 行で定義されています。

参照元 main().

int show_brl [static]

status.c46 行で定義されています。

参照元 main().

BOOL numeric_only = False [static]

status.c47 行で定義されています。

参照元 main()traverse_sessionid().

const char* username = NULL

status.c49 行で定義されています。


Sambaに対してSat Aug 29 21:24:37 2009に生成されました。  doxygen 1.4.7