mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
added a dumpmemory control, used to find memory leaks
(This used to be ctdb commit 44fdafaf421e3e906796d529aed2f7c5df201b94)
This commit is contained in:
parent
adc64aed0a
commit
410d41480a
@ -164,6 +164,12 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
||||
return 0;
|
||||
}
|
||||
|
||||
case CTDB_CONTROL_DUMP_MEMORY: {
|
||||
CHECK_CONTROL_DATA_SIZE(0);
|
||||
talloc_report_full(ctdb, stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case CTDB_CONTROL_STATUS_RESET: {
|
||||
CHECK_CONTROL_DATA_SIZE(0);
|
||||
ZERO_STRUCT(ctdb->status);
|
||||
|
@ -306,6 +306,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS,
|
||||
CTDB_CONTROL_ENABLE_SEQNUM,
|
||||
CTDB_CONTROL_UPDATE_SEQNUM,
|
||||
CTDB_CONTROL_SET_SEQNUM_FREQUENCY,
|
||||
CTDB_CONTROL_DUMP_MEMORY,
|
||||
};
|
||||
|
||||
|
||||
|
@ -934,6 +934,28 @@ static int control_attach(struct ctdb_context *ctdb, int argc, const char **argv
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
dump memory usage
|
||||
*/
|
||||
static int control_dumpmemory(struct ctdb_context *ctdb, int argc, const char **argv)
|
||||
{
|
||||
|
||||
uint32_t vnn;
|
||||
if (argc < 1) {
|
||||
usage();
|
||||
}
|
||||
if (strcmp(argv[0], "all") == 0) {
|
||||
vnn = CTDB_BROADCAST_VNN;
|
||||
} else {
|
||||
vnn = strtoul(argv[0], NULL, 0);
|
||||
}
|
||||
|
||||
ctdb_control(ctdb, vnn, 0, CTDB_CONTROL_DUMP_MEMORY,
|
||||
CTDB_CTRL_FLAG_NOREPLY, tdb_null, NULL, NULL, NULL, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
main program
|
||||
*/
|
||||
@ -976,6 +998,7 @@ int main(int argc, const char *argv[])
|
||||
{ "recover", control_recover },
|
||||
{ "writerecord", control_writerecord },
|
||||
{ "attach", control_attach },
|
||||
{ "dumpmemory", control_dumpmemory },
|
||||
};
|
||||
|
||||
pc = poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
|
||||
|
Loading…
x
Reference in New Issue
Block a user