From 907b31a9e08648151fcbf5863ac0fb2947c5c29c Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Fri, 11 Nov 2016 14:15:45 +0000 Subject: [PATCH] Addition of the options --xtree-memory and --xtree-memory-file Option is added, parsed, explained in --help but is not used yet by any other code. So, apart of the --help, no functional effect. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16124 --- coregrind/m_main.c | 6 ++++++ coregrind/m_replacemalloc/replacemalloc_core.c | 10 ++++++++++ none/tests/cmdline1.stdout.exp | 6 ++++++ none/tests/cmdline2.stdout.exp | 6 ++++++ 4 files changed, 28 insertions(+) diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 3fbab26dae..cd3d7c5c8a 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -145,6 +145,12 @@ static void usage_NORETURN ( Bool debug_help ) " --alignment= set minimum alignment of heap allocations [%s]\n" " --redzone-size= set minimum size of redzones added before/after\n" " heap blocks (in bytes). [%s]\n" +" --xtree-memory=none|allocs|full profile heap memory in an xtree [none]\n" +" and produces a report at the end of the execution\n" +" none: no profiling, allocs: current allocated\n" +" size/blocks, full: profile current and cumulative\n" +" allocated size/blocks and freed size/blocks.\n" +" --xtree-memory-file= xtree memory report file [xtmemory.kcg.%%p]\n" "\n" " uncommon user options for all Valgrind tools:\n" " --fullpath-after= (with nothing after the '=')\n" diff --git a/coregrind/m_replacemalloc/replacemalloc_core.c b/coregrind/m_replacemalloc/replacemalloc_core.c index c31add04c2..9033fb9b57 100644 --- a/coregrind/m_replacemalloc/replacemalloc_core.c +++ b/coregrind/m_replacemalloc/replacemalloc_core.c @@ -65,6 +65,16 @@ Bool VG_(replacement_malloc_process_cmd_line_option)(const HChar* arg) VG_MIN_MALLOC_SZB); } } + else if VG_XACT_CLO(arg, "--xtree-memory=none", + VG_(clo_xtree_memory), Vg_XTMemory_None) {} + else if VG_XACT_CLO(arg, "--xtree-memory=allocs", + VG_(clo_xtree_memory), Vg_XTMemory_Allocs) {} + else if VG_XACT_CLO(arg, "--xtree-memory=full", + VG_(clo_xtree_memory), Vg_XTMemory_Full) {} + else if VG_STR_CLO (arg, "--xtree-memory-file", + VG_(clo_xtree_memory_file)) {} + else if VG_BOOL_CLO(arg, "--xtree-compress-strings", + VG_(clo_xtree_compress_strings)) {} else if VG_BOOL_CLO(arg, "--trace-malloc", VG_(clo_trace_malloc)) {} else diff --git a/none/tests/cmdline1.stdout.exp b/none/tests/cmdline1.stdout.exp index 0faec690e9..4e8bca40f7 100644 --- a/none/tests/cmdline1.stdout.exp +++ b/none/tests/cmdline1.stdout.exp @@ -58,6 +58,12 @@ usage: valgrind [options] prog-and-args --alignment= set minimum alignment of heap allocations [not used by this tool] --redzone-size= set minimum size of redzones added before/after heap blocks (in bytes). [not used by this tool] + --xtree-memory=none|allocs|full profile heap memory in an xtree [none] + and produces a report at the end of the execution + none: no profiling, allocs: current allocated + size/blocks, full: profile current and cumulative + allocated size/blocks and freed size/blocks. + --xtree-memory-file= xtree memory report file [xtmemory.kcg.%p] uncommon user options for all Valgrind tools: --fullpath-after= (with nothing after the '=') diff --git a/none/tests/cmdline2.stdout.exp b/none/tests/cmdline2.stdout.exp index b124f20723..7265c2b9e1 100644 --- a/none/tests/cmdline2.stdout.exp +++ b/none/tests/cmdline2.stdout.exp @@ -58,6 +58,12 @@ usage: valgrind [options] prog-and-args --alignment= set minimum alignment of heap allocations [not used by this tool] --redzone-size= set minimum size of redzones added before/after heap blocks (in bytes). [not used by this tool] + --xtree-memory=none|allocs|full profile heap memory in an xtree [none] + and produces a report at the end of the execution + none: no profiling, allocs: current allocated + size/blocks, full: profile current and cumulative + allocated size/blocks and freed size/blocks. + --xtree-memory-file= xtree memory report file [xtmemory.kcg.%p] uncommon user options for all Valgrind tools: --fullpath-after= (with nothing after the '=') -- 2.47.2