summaryrefslogtreecommitdiff
path: root/source3/profile
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-11 00:33:33 +0000
committerJeremy Allison <jra@samba.org>2000-11-11 00:33:33 +0000
commit20838bb9ed25d7a325831041f371c11731ff6283 (patch)
treeef928af674aefabb2de152a1febbbc2afc52b8d1 /source3/profile
parentc97023b14c942f7261808159a0d192926239b704 (diff)
downloadsamba-20838bb9ed25d7a325831041f371c11731ff6283.tar.gz
samba-20838bb9ed25d7a325831041f371c11731ff6283.tar.bz2
samba-20838bb9ed25d7a325831041f371c11731ff6283.zip
Merge of Herb's profiling code.
Jeremy. (This used to be commit 3be056c71aa8e0a4ba70d397107199004bdb7d3f)
Diffstat (limited to 'source3/profile')
-rw-r--r--source3/profile/profile.c17
1 files changed, 17 insertions, 0 deletions
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;
}