X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=blobdiff_plain;f=source3%2Finclude%2Fsmbprofile.h;h=3041f6c87ec03146abfa6d0dd00262957c5c315a;hp=8945708ca3375adb127a22226b36e9cd1dcdede7;hb=a674a56a97c78a44bf43f1c175d106fbe70c7485;hpb=5209a846a9157e649fcdcb561f7eaf19c8c0e465 diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 8945708ca33..3041f6c87ec 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -26,7 +26,7 @@ #define PROF_SHMEM_KEY ((key_t)0x07021999) #define PROF_SHM_MAGIC 0x6349985 -#define PROF_SHM_VERSION 11 +#define PROF_SHM_VERSION 12 /* time values in the following structure are in microseconds */ @@ -43,6 +43,10 @@ enum profile_stats_values #define syscall_opendir_count __profile_stats_value(PR_VALUE_SYSCALL_OPENDIR, count) #define syscall_opendir_time __profile_stats_value(PR_VALUE_SYSCALL_OPENDIR, time) + PR_VALUE_SYSCALL_FDOPENDIR, +#define syscall_fdopendir_count __profile_stats_value(PR_VALUE_SYSCALL_FDOPENDIR, count) +#define syscall_fdopendir_time __profile_stats_value(PR_VALUE_SYSCALL_FDOPENDIR, time) + PR_VALUE_SYSCALL_READDIR, #define syscall_readdir_count __profile_stats_value(PR_VALUE_SYSCALL_READDIR, count) #define syscall_readdir_time __profile_stats_value(PR_VALUE_SYSCALL_READDIR, time) @@ -75,6 +79,10 @@ enum profile_stats_values #define syscall_open_count __profile_stats_value(PR_VALUE_SYSCALL_OPEN, count) #define syscall_open_time __profile_stats_value(PR_VALUE_SYSCALL_OPEN, time) + PR_VALUE_SYSCALL_CREATEFILE, +#define syscall_createfile_count __profile_stats_value(PR_VALUE_SYSCALL_CREATEFILE, count) +#define syscall_createfile_time __profile_stats_value(PR_VALUE_SYSCALL_CREATEFILE, time) + PR_VALUE_SYSCALL_CLOSE, #define syscall_close_count __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, count) #define syscall_close_time __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, time) @@ -111,6 +119,10 @@ enum profile_stats_values #define syscall_rename_count __profile_stats_value(PR_VALUE_SYSCALL_RENAME, count) #define syscall_rename_time __profile_stats_value(PR_VALUE_SYSCALL_RENAME, time) + PR_VALUE_SYSCALL_RENAME_AT, +#define syscall_rename_at_count __profile_stats_value(PR_VALUE_SYSCALL_RENAME_AT, count) +#define syscall_rename_at_time __profile_stats_value(PR_VALUE_SYSCALL_RENAME_AT, time) + PR_VALUE_SYSCALL_FSYNC, #define syscall_fsync_count __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, count) #define syscall_fsync_time __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, time) @@ -127,6 +139,10 @@ enum profile_stats_values #define syscall_lstat_count __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, count) #define syscall_lstat_time __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, time) + PR_VALUE_SYSCALL_GET_ALLOC_SIZE, +#define syscall_get_alloc_size_count __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, count) +#define syscall_get_alloc_size_time __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, time) + PR_VALUE_SYSCALL_UNLINK, #define syscall_unlink_count __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, count) #define syscall_unlink_time __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, time) @@ -167,6 +183,10 @@ enum profile_stats_values #define syscall_ftruncate_count __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, count) #define syscall_ftruncate_time __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, time) + PR_VALUE_SYSCALL_FALLOCATE, +#define syscall_fallocate_count __profile_stats_value(PR_VALUE_SYSCALL_FALLOCATE, count) +#define syscall_fallocate_time __profile_stats_value(PR_VALUE_SYSCALL_FALLOCATE, time) + PR_VALUE_SYSCALL_FCNTL_LOCK, #define syscall_fcntl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, count) #define syscall_fcntl_lock_time __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, time) @@ -211,6 +231,34 @@ enum profile_stats_values #define syscall_set_quota_count __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, count) #define syscall_set_quota_time __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, time) + PR_VALUE_SYSCALL_GET_SD, +#define syscall_get_sd_count __profile_stats_value(PR_VALUE_SYSCALL_GET_SD, count) +#define syscall_get_sd_time __profile_stats_value(PR_VALUE_SYSCALL_GET_SD, time) + + PR_VALUE_SYSCALL_SET_SD, +#define syscall_set_sd_count __profile_stats_value(PR_VALUE_SYSCALL_SET_SD, count) +#define syscall_set_sd_time __profile_stats_value(PR_VALUE_SYSCALL_SET_SD, time) + + PR_VALUE_SYSCALL_BRL_LOCK, +#define syscall_brl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_LOCK, count) +#define syscall_brl_lock_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_LOCK, time) + + PR_VALUE_SYSCALL_BRL_UNLOCK, +#define syscall_brl_unlock_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_UNLOCK, count) +#define syscall_brl_unlock_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_UNLOCK, time) + + PR_VALUE_SYSCALL_BRL_CANCEL, +#define syscall_brl_cancel_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_CANCEL, count) +#define syscall_brl_cancel_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_CANCEL, time) + + PR_VALUE_SYSCALL_STRICT_LOCK, +#define syscall_strict_lock_count __profile_stats_value(PR_VALUE_SYSCALL_STRICT_LOCK, count) +#define syscall_strict_lock_time __profile_stats_value(PR_VALUE_SYSCALL_STRICT_LOCK, time) + + PR_VALUE_SYSCALL_STRICT_UNLOCK, +#define syscall_strict_unlock_count __profile_stats_value(PR_VALUE_SYSCALL_STRICT_UNLOCK, count) +#define syscall_strict_unlock_time __profile_stats_value(PR_VALUE_SYSCALL_STRICT_UNLOCK, time) + /* counters for individual SMB types */ PR_VALUE_SMBMKDIR, #define SMBmkdir_count __profile_stats_value(PR_VALUE_SMBMKDIR, count) @@ -716,6 +764,82 @@ enum profile_stats_values #define election_count __profile_stats_value(PR_VALUE_ELECTION, count) #define election_time __profile_stats_value(PR_VALUE_ELECTION, time) + PR_VALUE_SMB2_NEGPROT, +#define smb2_negprot_count __profile_stats_value(PR_VALUE_SMB2_NEGPROT, count) +#define smb2_negprot_time __profile_stats_value(PR_VALUE_SMB2_NEGPROT, time) + + PR_VALUE_SMB2_SESSSETUP, +#define smb2_sesssetup_count __profile_stats_value(PR_VALUE_SMB2_SESSSETUP, count) +#define smb2_sesssetup_time __profile_stats_value(PR_VALUE_SMB2_SESSSETUP, time) + + PR_VALUE_SMB2_LOGOFF, +#define smb2_logoff_count __profile_stats_value(PR_VALUE_SMB2_LOGOFF, count) +#define smb2_logoff_time __profile_stats_value(PR_VALUE_SMB2_LOGOFF, time) + + PR_VALUE_SMB2_TCON, +#define smb2_tcon_count __profile_stats_value(PR_VALUE_SMB2_TCON, count) +#define smb2_tcon_time __profile_stats_value(PR_VALUE_SMB2_TCON, time) + + PR_VALUE_SMB2_TDIS, +#define smb2_tdis_count __profile_stats_value(PR_VALUE_SMB2_TDIS, count) +#define smb2_tdis_time __profile_stats_value(PR_VALUE_SMB2_TDIS, time) + + PR_VALUE_SMB2_CREATE, +#define smb2_create_count __profile_stats_value(PR_VALUE_SMB2_CREATE, count) +#define smb2_create_time __profile_stats_value(PR_VALUE_SMB2_CREATE, time) + + PR_VALUE_SMB2_CLOSE, +#define smb2_close_count __profile_stats_value(PR_VALUE_SMB2_CLOSE, count) +#define smb2_close_time __profile_stats_value(PR_VALUE_SMB2_CLOSE, time) + + PR_VALUE_SMB2_FLUSH, +#define smb2_flush_count __profile_stats_value(PR_VALUE_SMB2_FLUSH, count) +#define smb2_flush_time __profile_stats_value(PR_VALUE_SMB2_FLUSH, time) + + PR_VALUE_SMB2_READ, +#define smb2_read_count __profile_stats_value(PR_VALUE_SMB2_READ, count) +#define smb2_read_time __profile_stats_value(PR_VALUE_SMB2_READ, time) + + PR_VALUE_SMB2_WRITE, +#define smb2_write_count __profile_stats_value(PR_VALUE_SMB2_WRITE, count) +#define smb2_write_time __profile_stats_value(PR_VALUE_SMB2_WRITE, time) + + PR_VALUE_SMB2_LOCK, +#define smb2_lock_count __profile_stats_value(PR_VALUE_SMB2_LOCK, count) +#define smb2_lock_time __profile_stats_value(PR_VALUE_SMB2_LOCK, time) + + PR_VALUE_SMB2_IOCTL, +#define smb2_ioctl_count __profile_stats_value(PR_VALUE_SMB2_IOCTL, count) +#define smb2_ioctl_time __profile_stats_value(PR_VALUE_SMB2_IOCTL, time) + + PR_VALUE_SMB2_CANCEL, +#define smb2_cancel_count __profile_stats_value(PR_VALUE_SMB2_CANCEL, count) +#define smb2_cancel_time __profile_stats_value(PR_VALUE_SMB2_CANCEL, time) + + PR_VALUE_SMB2_KEEPALIVE, +#define smb2_keepalive_count __profile_stats_value(PR_VALUE_SMB2_KEEPALIVE, count) +#define smb2_keepalive_time __profile_stats_value(PR_VALUE_SMB2_KEEPALIVE, time) + + PR_VALUE_SMB2_FIND, +#define smb2_find_count __profile_stats_value(PR_VALUE_SMB2_FIND, count) +#define smb2_find_time __profile_stats_value(PR_VALUE_SMB2_FIND, time) + + PR_VALUE_SMB2_NOTIFY, +#define smb2_notify_count __profile_stats_value(PR_VALUE_SMB2_NOTIFY, count) +#define smb2_notify_time __profile_stats_value(PR_VALUE_SMB2_NOTIFY, time) + + PR_VALUE_SMB2_GETINFO, +#define smb2_getinfo_count __profile_stats_value(PR_VALUE_SMB2_GETINFO, count) +#define smb2_getinfo_time __profile_stats_value(PR_VALUE_SMB2_GETINFO, time) + + PR_VALUE_SMB2_SETINFO, +#define smb2_setinfo_count __profile_stats_value(PR_VALUE_SMB2_SETINFO, count) +#define smb2_setinfo_time __profile_stats_value(PR_VALUE_SMB2_SETINFO, time) + + PR_VALUE_SMB2_BREAK, +#define smb2_break_count __profile_stats_value(PR_VALUE_SMB2_BREAK, count) +#define smb2_break_time __profile_stats_value(PR_VALUE_SMB2_BREAK, time) + /* This mist remain the last value. */ PR_VALUE_MAX }; /* enum profile_stats_values */ @@ -778,34 +902,16 @@ extern bool do_profile_times; #define DEC_PROFILE_COUNT(x) profile_p->x-- #define ADD_PROFILE_COUNT(x,y) profile_p->x += (y) -#if defined(HAVE_CLOCK_GETTIME) - -extern clockid_t __profile_clock; - static inline uint64_t profile_timestamp(void) { struct timespec ts; - /* FIXME: On a single-CPU system, or a system where we have bound - * daemon threads to single CPUs (eg. using cpusets or processor - * affinity), it might be preferable to use CLOCK_PROCESS_CPUTIME_ID. - */ - - clock_gettime(__profile_clock, &ts); + /* we might prefer to use the _COARSE clock variant of CLOCK_MONOTONIC + that one is faster but cached and "just" tick-wise precise */ + clock_gettime_mono(&ts); return (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); /* usec */ } -#else - -static inline uint64_t profile_timestamp(void) -{ - struct timeval tv; - GetTimeOfDay(&tv); - return (tv.tv_sec * 1000000) + tv.tv_usec; -} - -#endif - /* end of helper macros */ #define DO_PROFILE_INC(x) \ @@ -849,8 +955,6 @@ static inline uint64_t profile_timestamp(void) ADD_PROFILE_COUNT(x##_time, \ profile_timestamp() - __profstamp_##x); \ } - - #else /* WITH_PROFILE */ #define DO_PROFILE_INC(x) @@ -860,7 +964,6 @@ static inline uint64_t profile_timestamp(void) #define START_PROFILE(x) #define START_PROFILE_BYTES(x,n) #define END_PROFILE(x) - #endif /* WITH_PROFILE */ #endif