データ構造 | |
struct | msg_pool_usage_state |
関数 | |
static void | msg_pool_usage_helper (const void *ptr, int depth, int max_depth, int is_ref, void *_s) |
void | msg_pool_usage (int msg_type, struct process_id src_pid, void *UNUSED(buf), size_t UNUSED(len), void *private_data) |
Respond to a POOL_USAGE message by sending back string form of memory usage stats. | |
void | register_msg_pool_usage (void) |
Register handler for MSG_REQ_POOL_USAGE |
tallocmsg.c で定義されています。
static void msg_pool_usage_helper | ( | const void * | ptr, | |
int | depth, | |||
int | max_depth, | |||
int | is_ref, | |||
void * | _s | |||
) | [static] |
tallocmsg.c の 35 行で定義されています。
参照先 msg_pool_usage_state::buflen・msg_pool_usage_state::len・msg_pool_usage_state::mem_ctx・name・msg_pool_usage_state::s・sprintf_append()・talloc_get_name()・talloc_reference_count()・talloc_total_blocks()・talloc_total_size().
参照元 msg_pool_usage().
00036 { 00037 const char *name = talloc_get_name(ptr); 00038 struct msg_pool_usage_state *state = (struct msg_pool_usage_state *)_s; 00039 00040 if (is_ref) { 00041 sprintf_append(state->mem_ctx, &state->s, &state->len, &state->buflen, 00042 "%*sreference to: %s\n", depth*4, "", name); 00043 return; 00044 } 00045 00046 if (depth == 0) { 00047 sprintf_append(state->mem_ctx, &state->s, &state->len, &state->buflen, 00048 "%stalloc report on '%s' (total %6lu bytes in %3lu blocks)\n", 00049 (max_depth < 0 ? "full " :""), name, 00050 (unsigned long)talloc_total_size(ptr), 00051 (unsigned long)talloc_total_blocks(ptr)); 00052 return; 00053 } 00054 00055 sprintf_append(state->mem_ctx, &state->s, &state->len, &state->buflen, 00056 "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d)\n", 00057 depth*4, "", 00058 name, 00059 (unsigned long)talloc_total_size(ptr), 00060 (unsigned long)talloc_total_blocks(ptr), 00061 talloc_reference_count(ptr)); 00062 }
void msg_pool_usage | ( | int | msg_type, | |
struct process_id | src_pid, | |||
void * | UNUSED(buf), | |||
size_t | UNUSED(len), | |||
void * | private_data | |||
) |
Respond to a POOL_USAGE message by sending back string form of memory usage stats.
tallocmsg.c の 68 行で定義されています。
参照先 msg_pool_usage_state::buflen・msg_pool_usage_state::len・msg_pool_usage_state::mem_ctx・message_send_pid()・msg_pool_usage_helper()・msg_pool_usage_state::s・talloc_init()・talloc_report_depth_cb().
参照元 register_msg_pool_usage().
00071 { 00072 struct msg_pool_usage_state state; 00073 00074 SMB_ASSERT(msg_type == MSG_REQ_POOL_USAGE); 00075 00076 DEBUG(2,("Got POOL_USAGE\n")); 00077 00078 state.mem_ctx = talloc_init("msg_pool_usage"); 00079 if (!state.mem_ctx) { 00080 return; 00081 } 00082 state.len = 0; 00083 state.buflen = 512; 00084 state.s = NULL; 00085 00086 talloc_report_depth_cb(NULL, 0, -1, msg_pool_usage_helper, &state); 00087 00088 if (!state.s) { 00089 talloc_destroy(state.mem_ctx); 00090 return; 00091 } 00092 00093 message_send_pid(src_pid, MSG_POOL_USAGE, 00094 state.s, strlen(state.s)+1, True); 00095 00096 talloc_destroy(state.mem_ctx); 00097 }
void register_msg_pool_usage | ( | void | ) |
Register handler for MSG_REQ_POOL_USAGE
tallocmsg.c の 102 行で定義されています。
参照先 message_register()・msg_pool_usage().
参照元 message_init().
00103 { 00104 message_register(MSG_REQ_POOL_USAGE, msg_pool_usage, NULL); 00105 DEBUG(2, ("Registered MSG_REQ_POOL_USAGE\n")); 00106 }