summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2000-10-11 05:31:39 +0000
committerHerb Lewis <herb@samba.org>2000-10-11 05:31:39 +0000
commit8719c27726d3412edd0781beb956f48f76a62fb6 (patch)
tree4946f7b6d6159eb566ff279d9ccba1f6d901e0e1 /source3/include
parentc72f94dad9639bc241890aad338ae0bea8eed84d (diff)
downloadsamba-8719c27726d3412edd0781beb956f48f76a62fb6.tar.gz
samba-8719c27726d3412edd0781beb956f48f76a62fb6.tar.bz2
samba-8719c27726d3412edd0781beb956f48f76a62fb6.zip
changes to sync with 2.2. tree
.cvsignore remove config.h - not in this directory include/profile.h profile changes lib/messages.c added message to return debug level libsmb/clierror.c cast to get rid of compiler warning libsmb/smbencrypt.c cast to get rid of compiler warning profile/profile.c add flush profile stats changes for profile struct rpc_parse/parse_samr.c fix for compiler warning rpc_server/srv_samr.c cast to get rid of compiler warning smbd/ipc.c profile stats message.c profile stats smbd/negprot.c profile stats smbd/nttrans.c profile stats smbd/trans2.c profile stats utils/smbcontrol.c new flush stats command (This used to be commit bbb24daa25dca4e4b6b1f8942cd84ee3aa1bed8e)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/profile.h38
1 files changed, 31 insertions, 7 deletions
diff --git a/source3/include/profile.h b/source3/include/profile.h
index c196a63c62..b05e1fd9bb 100644
--- a/source3/include/profile.h
+++ b/source3/include/profile.h
@@ -35,13 +35,11 @@ enum flush_reason_enum { SEEK_FLUSH, READ_FLUSH, WRITE_FLUSH, READRAW_FLUSH,
#define PROF_SHMEM_KEY ((key_t)0x07021999)
#define PROF_SHM_MAGIC 0x6349985
-#define PROF_SHM_VERSION 2
+#define PROF_SHM_VERSION 3
-/* time values in the following structure are in milliseconds */
+/* time values in the following structure are in microseconds */
-struct profile_struct {
- int prof_shm_magic;
- int prof_shm_version;
+struct profile_stats {
/* general counters */
unsigned smb_count; /* how many SMB packets we have processed */
unsigned uid_changes; /* how many times we change our effective uid */
@@ -314,10 +312,18 @@ struct profile_struct {
unsigned NT_transact_query_security_desc_time;
};
+struct profile_header {
+ int prof_shm_magic;
+ int prof_shm_version;
+ struct profile_stats stats;
+};
-extern struct profile_struct *profile_p;
+extern struct profile_header *profile_h;
+extern struct profile_stats *profile_p;
extern struct timeval profile_starttime;
extern struct timeval profile_endtime;
+extern struct timeval profile_starttime_nested;
+extern struct timeval profile_endtime_nested;
extern BOOL do_profile_flag;
extern BOOL do_profile_times;
@@ -328,7 +334,12 @@ extern BOOL do_profile_times;
#define INC_PROFILE_COUNT(x) profile_p->x++
#define DEC_PROFILE_COUNT(x) profile_p->x--
#define ADD_PROFILE_COUNT(x,y) profile_p->x += (y)
-#define PROFILE_TIME TvalDiff(&profile_starttime,&profile_endtime)
+#define PROFILE_TIME \
+ ((profile_endtime.tv_sec - profile_starttime.tv_sec) *1000000 + \
+ ((int)profile_endtime.tv_usec - (int)profile_starttime.tv_usec))
+#define PROFILE_TIME_NESTED \
+ ((profile_endtime_nested.tv_sec - profile_starttime_nested.tv_sec) *1000000 + \
+ ((int)profile_endtime_nested.tv_usec - (int)profile_starttime_nested.tv_usec))
#ifdef WITH_PROFILE
#define DO_PROFILE_INC(x) \
@@ -354,6 +365,12 @@ extern BOOL do_profile_times;
GetTimeOfDay(&profile_starttime); \
INC_PROFILE_COUNT(x##_count); \
}
+#define START_PROFILE_NESTED(x) \
+ if (do_profile_flag) { \
+ if (do_profile_times) \
+ GetTimeOfDay(&profile_starttime_nested); \
+ INC_PROFILE_COUNT(x##_count); \
+ }
#define START_PROFILE_BYTES(x,n) \
if (do_profile_flag) { \
if (do_profile_times) \
@@ -366,14 +383,21 @@ extern BOOL do_profile_times;
GetTimeOfDay(&profile_endtime); \
ADD_PROFILE_COUNT(x##_time,PROFILE_TIME); \
}
+#define END_PROFILE_NESTED(x) \
+ if (do_profile_times) { \
+ GetTimeOfDay(&profile_endtime_nested); \
+ ADD_PROFILE_COUNT(x##_time,PROFILE_TIME_NESTED); \
+ }
#else
#define DO_PROFILE_INC(x)
#define DO_PROFILE_DEC(x)
#define DO_PROFILE_DEC_INC(x,y)
#define DO_PROFILE_ADD(x,n)
#define START_PROFILE(x)
+#define START_PROFILE_NESTED(x)
#define START_PROFILE_BYTES(x,n)
#define END_PROFILE(x)
+#define END_PROFILE_NESTED(x)
#endif
#endif