diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-06 23:01:47 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-06 23:01:47 +0000 |
commit | 74d4a3b7410547d9f65bfc26de5f22c623574afd (patch) | |
tree | 1ce41ec5a9c410060b486e2ad1c0b251bb11e422 /source3/profile/profile.c | |
parent | 9c6acf4595d14cb0fc0c9bf17ce02de73af127cd (diff) | |
download | samba-74d4a3b7410547d9f65bfc26de5f22c623574afd.tar.gz samba-74d4a3b7410547d9f65bfc26de5f22c623574afd.tar.xz samba-74d4a3b7410547d9f65bfc26de5f22c623574afd.zip |
Added Herb's fixes to HEAD.
Jeremy.
(This used to be commit 4862d2ab1163310d844b929fb17239b4f4cb1a99)
Diffstat (limited to 'source3/profile/profile.c')
-rw-r--r-- | source3/profile/profile.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 5b8b280c293..87f5e2c9b22 100644 --- a/source3/profile/profile.c +++ b/source3/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; } |