From 20838bb9ed25d7a325831041f371c11731ff6283 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Nov 2000 00:33:33 +0000 Subject: Merge of Herb's profiling code. Jeremy. (This used to be commit 3be056c71aa8e0a4ba70d397107199004bdb7d3f) --- source3/profile/profile.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source3/profile') diff --git a/source3/profile/profile.c b/source3/profile/profile.c index f1d2310ce1..80584adfa2 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -73,6 +73,22 @@ void profile_message(int msg_type, pid_t src, void *buf, size_t len) } } +/**************************************************************************** +receive a request profile level message +****************************************************************************/ +void reqprofile_message(int msg_type, pid_t src, void *buf, size_t len) +{ + int level; + +#ifdef WITH_PROFILE + level = 1 + (do_profile_flag?2:0) + (do_profile_times?4:0); +#else + level = 0; +#endif + DEBUG(1,("INFO: Received REQ_PROFILELEVEL message from PID %d\n",src)); + message_send_pid(src, MSG_PROFILELEVEL, &level, sizeof(int)); +} + /******************************************************************* open the profiling shared memory area ******************************************************************/ @@ -140,6 +156,7 @@ BOOL profile_setup(BOOL rdonly) profile_p = &profile_h->stats; message_register(MSG_PROFILE, profile_message); + message_register(MSG_REQ_PROFILELEVEL, reqprofile_message); return True; } -- cgit