diff options
author | Volker Lendecke <vl@samba.org> | 2010-01-17 14:57:54 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-01-17 15:04:25 +0100 |
commit | f7adf534fdc8b0028028538d264e65d7dd45aa58 (patch) | |
tree | 5ed1e49d3063580b45fc6799e17e2ca9180b7a5a /source3 | |
parent | a1015051c054428482efe1810025728a8987a2a0 (diff) | |
download | samba-f7adf534fdc8b0028028538d264e65d7dd45aa58.tar.gz samba-f7adf534fdc8b0028028538d264e65d7dd45aa58.tar.bz2 samba-f7adf534fdc8b0028028538d264e65d7dd45aa58.zip |
s3: For "smbcontrol <pid> pool-usage", print the first 50 bytes of a string
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/tallocmsg.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/lib/tallocmsg.c b/source3/lib/tallocmsg.c index adeb4ed8d6..3cfd118d21 100644 --- a/source3/lib/tallocmsg.c +++ b/source3/lib/tallocmsg.c @@ -51,6 +51,23 @@ static void msg_pool_usage_helper(const void *ptr, int depth, int max_depth, int return; } + if (strcmp(name, "char") == 0) { + /* + * Print out the first 50 bytes of the string + */ + sprintf_append(state->mem_ctx, &state->s, &state->len, + &state->buflen, + "%*s%-30s contains %6lu bytes in %3lu blocks " + "(ref %d): %*s\n", depth*4, "", + name, + (unsigned long)talloc_total_size(ptr), + (unsigned long)talloc_total_blocks(ptr), + talloc_reference_count(ptr), + MIN(50, talloc_get_size(ptr)), + (char *)ptr); + return; + } + sprintf_append(state->mem_ctx, &state->s, &state->len, &state->buflen, "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d)\n", depth*4, "", |