From: Nicholas Nethercote Date: Mon, 26 Nov 2007 22:27:02 +0000 (+0000) Subject: Minor tweak to drawing of peak and detailed snapshot bars on the graph. X-Git-Tag: svn/VALGRIND_3_3_0~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e4acd024b75302e83b98b1a51259ab09e7f2a9;p=thirdparty%2Fvalgrind.git Minor tweak to drawing of peak and detailed snapshot bars on the graph. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7231 --- diff --git a/massif/docs/ms-manual.xml b/massif/docs/ms-manual.xml index c9eec4d3f3..8cd7bd7298 100644 --- a/massif/docs/ms-manual.xml +++ b/massif/docs/ms-manual.xml @@ -212,7 +212,7 @@ re-run ms_print, we get this more useful graph: | : # : : : : : : . | : : # : : : : : : : . | : : # : : : : : : : : . - | : : : # : : : : : : : : : . + | : : : # : : : : : : : : : , | @ : : : # : : : : : : : : : @ | : @ : : : # : : : : : : : : : @ | : : @ : : : # : : : : : : : : : @ @@ -248,7 +248,7 @@ graph by bars consisting of ':' and '.' characters. Some snapshots are detailed. Information about where allocations happened are recorded for these snapshots, as we will see shortly. Detailed snapshots are represented in the graph by bars consisting -of '@' and '.' characters. The text at the bottom show that 3 detailed +of '@' and ',' characters. The text at the bottom show that 3 detailed snapshots were taken for this program (snapshots 9, 14 and 24). By default, every 10th snapshot is detailed, although this can be changed via the --detailed-freqoption. @@ -260,7 +260,7 @@ default Massif records a peak whose size is within 1% of the size of the true peak. See the description of the --peak-inaccuracy option below for more details.) The peak snapshot is represented in the graph by a bar consisting -of '#' and '.' characters. The text at the bottom show that snapshot 14 was +of '#' and ',' characters. The text at the bottom show that snapshot 14 was the peak. Note that for tiny programs that never deallocate heap memory, Massif will record a peak snapshot. @@ -269,24 +269,24 @@ browser. It shows what graphs for larger programs look like. Mi 0 626.4 diff --git a/massif/ms_main.c b/massif/ms_main.c index b6997b9899..caf7ae3700 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -34,7 +34,6 @@ // - address/close all the bug reports below (after writing docs) // - do a graph-drawing test // - Get Josef to update the Callgrind --callgrind-out-file option. -// - Use '_' instead of '.' for detailed/peak bars? // // Todo -- nice, but less critical: // - make file format more generic. Obstacles: diff --git a/massif/ms_print.in b/massif/ms_print.in index 1b22534233..6cc3faa30b 100755 --- a/massif/ms_print.in +++ b/massif/ms_print.in @@ -523,7 +523,9 @@ sub read_input_file() my $peak_full_char = '#'; my $detailed_full_char = '@'; my $normal_full_char = ':'; - my $half_char = '.'; + my $peak_half_char = ','; + my $detailed_half_char = ','; + my $normal_half_char = '.'; # Work out how many bytes each row represents. If the peak size was 0, # make it 1 so that the Y-axis covers a non-zero range of values. @@ -559,13 +561,16 @@ sub read_input_file() if ($should_draw_column) { # If it's detailed, mark the X-axis. Also choose the full-slot # char. - my $full_char; + my ($full_char, $half_char); if ($i == $peak_num) { $full_char = $peak_full_char; + $half_char = $peak_half_char; } elsif ($is_detaileds[$i]) { $full_char = $detailed_full_char; + $half_char = $detailed_half_char; } else { $full_char = $normal_full_char; + $half_char = $normal_half_char; } # Grow this snapshot bar from bottom to top. for ($y = 1; $y <= $graph_y; $y++) {