From 073e336aaa518f6a8a6cdabf10e6a7d23cfe77bd Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Fri, 6 Oct 2000 21:32:57 +0000 Subject: 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 --- source/profile/profile.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source/profile/profile.c') 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; } -- cgit