summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2012-11-16 22:58:06 +0100
committerAndrew Bartlett <abartlet@samba.org>2013-02-04 12:19:30 +0100
commit940b7ec78c50c41a399bee2775cd008618baf8f8 (patch)
tree76ce6461d820f9132612e2bf48dcbcfcc254fb73
parent8e571fd385334bc12ee5c5bdfd32b31ad2c4b4b8 (diff)
downloadsamba-940b7ec78c50c41a399bee2775cd008618baf8f8.tar.gz
samba-940b7ec78c50c41a399bee2775cd008618baf8f8.tar.bz2
samba-940b7ec78c50c41a399bee2775cd008618baf8f8.zip
s3:torture/vfstest add memreport option
this will run a talloc_report_full on the talloc stackframe after each command Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source3/torture/vfstest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index de7e732e58..439e186c90 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -42,6 +42,9 @@ static struct cmd_list {
struct cmd_set *cmd_set;
} *cmd_list;
+/* shall we do talloc_report after each command? */
+static int memreports = 0;
+
/****************************************************************************
handle completion of commands for readline
****************************************************************************/
@@ -324,6 +327,9 @@ static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *c
SAFE_FREE(argv);
}
+ if (memreports != 0) {
+ talloc_report_full(mem_ctx, stdout);
+ }
TALLOC_FREE(mem_ctx);
return result;
}
@@ -464,6 +470,8 @@ int main(int argc, char *argv[])
POPT_AUTOHELP
{"file", 'f', POPT_ARG_STRING, &filename, 0, },
{"command", 'c', POPT_ARG_STRING, &cmdstr, 0, "Execute specified list of commands" },
+ {"memreport", 'm', POPT_ARG_INT, &memreports, 0,
+ "Report memory left on talloc stackframe after each command" },
POPT_COMMON_SAMBA
POPT_TABLEEND
};