|
From: tom f. <tf...@al...> - 2009-07-11 18:29:20
|
Please keep discussions on-list.
David Gregorczyk <in...@we...> writes:
> but what can I do to summarize massif's multiple outputs for
> each child process? I've tried to watch out memory usage for
> Xerces-C++ and get more than 10 output files. To get complete memory
> consumption, I have to intrepret every file with ms_print and search
> for the peak consumption. For one measurement that seems ok, but I
> have to check out the program's behaviour for 16 input files.
Sounds like a job for your friendly neighborhood awk.
BEGIN {
max_percent=0
max_bytes=0
}
/heap allocation functions/ {
percent=$1
bytes=$2
if(percent > max_percent || bytes > max_bytes) {
max_percent=percent
max_bytes=bytes
max_file=FILENAME
}
}
END {
printf "Largest heap usage was %d (%d%%) from output %s\n", \
max_bytes, max_percent, max_file
}
Untested, I've actually never even used massif, just basing that on the
doc's output. You get the idea though.
Massif might have an xml output mode too (I don't know). I would
expect programmatically parsing the default output will break in some
subsequent version, but presumably an xml output would be designed for
consistency across revisions.
Cheers,
-tom
|