------------------------------------------------------------
revno: 254
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Sat 2007-05-05 11:03:10 +1000
message:
  added a dumpmemory control, used to find memory leaks
modified:
  common/ctdb_control.c          
ctdb_control.c-20070426122724-j6gkpiofhbwdin63-1
  include/ctdb_private.h         
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  tools/ctdb_control.c           
ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
=== modified file 'common/ctdb_control.c'
--- a/common/ctdb_control.c     2007-05-04 22:33:35 +0000
+++ b/common/ctdb_control.c     2007-05-05 01:03:10 +0000
@@ -164,6 +164,12 @@
                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);

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h    2007-05-04 22:33:35 +0000
+++ b/include/ctdb_private.h    2007-05-05 01:03:10 +0000
@@ -306,6 +306,7 @@
                    CTDB_CONTROL_ENABLE_SEQNUM,
                    CTDB_CONTROL_UPDATE_SEQNUM,
                    CTDB_CONTROL_SET_SEQNUM_FREQUENCY,
+                   CTDB_CONTROL_DUMP_MEMORY,
 };
 
 

=== modified file 'tools/ctdb_control.c'
--- a/tools/ctdb_control.c      2007-05-04 22:33:35 +0000
+++ b/tools/ctdb_control.c      2007-05-05 01:03:10 +0000
@@ -935,6 +935,28 @@
 }
 
 /*
+  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
 */
 int main(int argc, const char *argv[])
@@ -976,6 +998,7 @@
                { "recover", control_recover },
                { "writerecord", control_writerecord },
                { "attach", control_attach },
+               { "dumpmemory", control_dumpmemory },
        };
 
        pc = poptGetContext(argv[0], argc, argv, popt_options, 
POPT_CONTEXT_KEEP_FIRST);

Reply via email to