00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "includes.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifdef ENABLE_DMALLOC
00030 static unsigned long our_dm_mark = 0;
00031 #endif
00032
00033
00034
00035
00036
00037
00038 static void msg_req_dmalloc_mark(int UNUSED(msg_type),
00039 struct process_id UNUSED(src_pid),
00040 void *UNUSED(buf), size_t UNUSED(len),
00041 void *private_data)
00042 {
00043 #ifdef ENABLE_DMALLOC
00044 our_dm_mark = dmalloc_mark();
00045 DEBUG(2,("Got MSG_REQ_DMALLOC_MARK: mark set\n"));
00046 #else
00047 DEBUG(2,("Got MSG_REQ_DMALLOC_MARK but dmalloc not in this process\n"));
00048 #endif
00049 }
00050
00051
00052
00053 static void msg_req_dmalloc_log_changed(int UNUSED(msg_type),
00054 struct process_id UNUSED(src_pid),
00055 void *UNUSED(buf), size_t UNUSED(len),
00056 void *private_data)
00057 {
00058 #ifdef ENABLE_DMALLOC
00059 dmalloc_log_changed(our_dm_mark, True, True, True);
00060 DEBUG(2,("Got MSG_REQ_DMALLOC_LOG_CHANGED: done\n"));
00061 #else
00062 DEBUG(2,("Got MSG_REQ_DMALLOC_LOG_CHANGED but dmalloc not in this process\n"));
00063 #endif
00064 }
00065
00066
00067
00068
00069
00070 void register_dmalloc_msgs(void)
00071 {
00072 message_register(MSG_REQ_DMALLOC_MARK, msg_req_dmalloc_mark, NULL);
00073 message_register(MSG_REQ_DMALLOC_LOG_CHANGED,
00074 msg_req_dmalloc_log_changed, NULL);
00075 DEBUG(2, ("Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED\n"));
00076 }