summaryrefslogtreecommitdiffstats
path: root/source/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
commit3be056c71aa8e0a4ba70d397107199004bdb7d3f (patch)
tree2d952faee94af163ac4060e624327cfbc507dc9f /source/profile
parent24d76c5fbda29d89c96d7c22193ec2eb93ad3887 (diff)
downloadsamba-3be056c71aa8e0a4ba70d397107199004bdb7d3f.tar.gz
samba-3be056c71aa8e0a4ba70d397107199004bdb7d3f.tar.xz
samba-3be056c71aa8e0a4ba70d397107199004bdb7d3f.zip
Merge of Herb's profiling code.
Jeremy.
Diffstat (limited to 'source/profile')
-rw-r--r--source/profile/profile.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/profile/profile.c b/source/profile/profile.c
index f1d2310ce18..80584adfa2a 100644
--- a/source/profile/profile.c
+++ b/source/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;
}