diff options
author | Herb Lewis <herb@samba.org> | 2000-10-06 21:32:57 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2000-10-06 21:32:57 +0000 |
commit | 073e336aaa518f6a8a6cdabf10e6a7d23cfe77bd (patch) | |
tree | 72cbd52d531ebb8ea092c000e57f4f6f9490abad /source/profile/profile.c | |
parent | 4f5d2f9649a4d9b5c983148029c068deb5eee186 (diff) | |
download | samba-073e336aaa518f6a8a6cdabf10e6a7d23cfe77bd.tar.gz samba-073e336aaa518f6a8a6cdabf10e6a7d23cfe77bd.tar.xz samba-073e336aaa518f6a8a6cdabf10e6a7d23cfe77bd.zip |
proto.h rebuild proto.h
messages.h add new message types
profile.h change profile start and end macros to allow times to
not be gathered
messages.c add message handling for returning current debug level
profile.c add a new flag to allow time profiling to to turned off
default flags to off now they can be set by smbcontrol
add message handlinf for setting profile level
smbcontrol.c add printout in pong function so you can see replies
add new set profile level and get debug level messages
add flags so we don't register callbacks more than once
when in interactive mode and reset pong count each time
Diffstat (limited to 'source/profile/profile.c')
-rw-r--r-- | source/profile/profile.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source/profile/profile.c b/source/profile/profile.c index 5b8b280c293..87f5e2c9b22 100644 --- a/source/profile/profile.c +++ b/source/profile/profile.c @@ -34,10 +34,36 @@ static BOOL read_only; struct profile_struct *profile_p; BOOL do_profile_flag = False; +BOOL do_profile_times = False; struct timeval profile_starttime; struct timeval profile_endtime; +/**************************************************************************** +receive a set profile level message +****************************************************************************/ +void profile_message(int msg_type, pid_t src, void *buf, size_t len) +{ + int level; + + memcpy(&level, buf, sizeof(int)); + switch (level) { + case 0: + do_profile_flag = False; + do_profile_times = False; + break; + case 1: + do_profile_flag = True; + do_profile_times = False; + break; + case 2: + do_profile_flag = True; + do_profile_times = True; + break; + } + DEBUG(1,("Profile level set to %d from pid %d\n", level, (int)src)); +} + /******************************************************************* open the profiling shared memory area ******************************************************************/ @@ -103,7 +129,7 @@ BOOL profile_setup(BOOL rdonly) DEBUG(3,("Initialised profile area\n")); } - do_profile_flag = True; /* temp for now */ + message_register(MSG_PROFILE, profile_message); return True; } |