]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
DHAT: when the run ends, print a how-to-view-the-profile hint message. n-i-bz.
authorJulian Seward <jseward@acm.org>
Thu, 4 Apr 2019 10:08:26 +0000 (12:08 +0200)
committerJulian Seward <jseward@acm.org>
Thu, 4 Apr 2019 10:08:26 +0000 (12:08 +0200)
The aim is to make it zero-effort for users to view the profile after
a run.  The printed message is as follows:

  To view the resulting profile, open
    file:///path/to/valgrind/installation/lib/valgrind/dh_view.html
  in a web browser, click on "Load..." and then select the file
    /path/to/dhat.out.12345
  Scroll to the end the displayed page to see a short
  explanation of some of the abbreviations used in the page.

This patch adds printing of the message, then filters it out in
dhat/tests/filter_stderr, and updates the .stderr.exp files to
remove blank lines.

dhat/dh_main.c
dhat/tests/acc.stderr.exp
dhat/tests/basic.stderr.exp
dhat/tests/big.stderr.exp
dhat/tests/empty.stderr.exp
dhat/tests/filter_stderr
dhat/tests/sig.stderr.exp
dhat/tests/single.stderr.exp

index ffcf87461973f0914460f31a92fc984b7844dd0f..ece2eed77105804e98aad7da3a6f237cc8f00267 100644 (file)
@@ -1441,6 +1441,16 @@ static void dh_fini(Int exit_status)
              g_curr_bytes, g_curr_blocks);
    VG_(umsg)("Reads:     %'llu bytes\n", g_reads_bytes);
    VG_(umsg)("Writes:    %'llu bytes\n", g_writes_bytes);
+
+   // Print a how-to-view-the-profile hint.
+   VG_(umsg)("\n");
+   VG_(umsg)("To view the resulting profile, open\n");
+   VG_(umsg)("  file://%s/%s\n", VG_(libdir), "dh_view.html");
+   VG_(umsg)("in a web browser, click on \"Load...\" "
+             "and then select the file\n");
+   VG_(umsg)("  %s\n", dhat_out_file);
+   VG_(umsg)("Scroll to the end the displayed page to see a short\n");
+   VG_(umsg)("explanation of some of the abbreviations used in the page.\n");
 }
 
 //------------------------------------------------------------//
index 7732270733c383c435d2cacd0c628f16d676d505..e48b16efc0ec4c6019d0dd79f1a93f96ab2ea86c 100644 (file)
@@ -1,5 +1,3 @@
-
-
 Total:     2,534 bytes in 9 blocks
 At t-gmax: 1,025 bytes in 1 blocks
 At t-end:  0 bytes in 0 blocks
index bcdec65409f1386067b99e904381dfeed5b30ee6..cc714443ddd1d03ef10b997991eb08474e32db40 100644 (file)
@@ -1,5 +1,3 @@
-
-
 Total:     6,000 bytes in 3 blocks
 At t-gmax: 5,000 bytes in 2 blocks
 At t-end:  3,000 bytes in 1 blocks
index 57339767ed049bc8c4b8e4850e17534e7f1f2ede..04092b6060cba500474e9d3eba2887ef1d9d70bb 100644 (file)
@@ -1,5 +1,3 @@
-
-
 Total:     1,000 bytes in 19 blocks
 At t-gmax: 706 bytes in 1 blocks
 At t-end:  294 bytes in 18 blocks
index 6b189fd673a2a5a5c5dd4ceac1d325fe43e86a8e..e5adf9120b85842ec65a64e2af97e1c0a58df3b7 100644 (file)
@@ -1,5 +1,3 @@
-
-
 Total:     0 bytes in 0 blocks
 At t-gmax: 0 bytes in 0 blocks
 At t-end:  0 bytes in 0 blocks
index 6b4058be9dbf1a97ca56eb5d27fcaa0c28c624d9..e02ecc84488ed8787aba51260261f191bc470635 100755 (executable)
@@ -4,6 +4,25 @@ dir=`dirname $0`
 
 $dir/../../tests/filter_stderr_basic |
 
-# Remove "Massif, ..." line and the following copyright line.
-sed "/^DHAT, a dynamic heap analysis tool/ , /./ d"
+# Remove the "DHAT, ..." line and the following copyright line.
+sed "/^DHAT, a dynamic heap analysis tool/ , /./ d" |
 
+# Remove the six hint-lines, which look like this:
+#
+#   To view the resulting profile, open
+#     file:///path/to/valgrind/installation/lib/valgrind/dh_view.html
+#   in a web browser, click on "Load..." and then select the file
+#     /path/to/dhat.out.12345
+#   Scroll to the end the displayed page to see a short
+#   explanation of some of the abbreviations used in the page.
+#
+sed "/^To view the resulting profile/ d" |
+sed "/^  file:\/\/\// d" |
+sed "/^in a web browser/ d" |
+sed "/^  \// d" |                # This is pretty feeble, but I don't see
+                                 # how to do better
+sed "/^Scroll to the end/ d" |
+sed "/^explanation of some/ d" |
+
+# and remove any blank lines in the output
+sed "/^[[:space:]]*$/d"
index d5a50cf2b07d0a1b2a34f83ec183e233d7380908..fc0af355a63fc3764fb1ab8c1d2f5fdea5b121b0 100644 (file)
@@ -1,5 +1,3 @@
-
-
 Total:     102 bytes in 16 blocks
 At t-gmax: 102 bytes in 16 blocks
 At t-end:  102 bytes in 16 blocks
index 87e818599d26ab365d40e4d8c327de0afc52f214..ba8c41605ef519dc74b55e67f14859aeecda955a 100644 (file)
@@ -1,5 +1,3 @@
-
-
 Total:     16 bytes in 1 blocks
 At t-gmax: 16 bytes in 1 blocks
 At t-end:  16 bytes in 1 blocks