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 | 4862d2ab1163310d844b929fb17239b4f4cb1a99 (patch) | |
tree | fd58c1de6f207ec50282ed34fd2c58103060f510 /source/profile | |
parent | dd804fdb96ff49645647787c197a61a6515a474d (diff) | |
download | samba-4862d2ab1163310d844b929fb17239b4f4cb1a99.tar.gz |
Added Herb's fixes to HEAD.
Jeremy.
Diffstat (limited to 'source/profile')
-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; } |