]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
DHAT currently has "max-bytes-live", "max-blocks-live", and
authorJulian Seward <jseward@acm.org>
Wed, 5 Oct 2016 04:32:44 +0000 (04:32 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 5 Oct 2016 04:32:44 +0000 (04:32 +0000)
"tot-bytes-allocd" orderings.  This adds "tot-blocks-allocd", which
completes the 2x2 matrix and is useful too.  n-i-bz.
From n.nethercote@gmail.com.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16006

exp-dhat/dh_main.c
exp-dhat/docs/dh-manual.xml

index 3476cd9b360ad1b2e070055139be23ccbdef8b9b..1589fee758cc9e75cf6a664015d338f434e0c9ce 100644 (file)
@@ -1065,8 +1065,9 @@ static void dh_print_usage(void)
 "            sort the allocation points by the metric\n"
 "            defined by <string>, thusly:\n"
 "                max-bytes-live    maximum live bytes [default]\n"
-"                tot-bytes-allocd  total allocation (turnover)\n"
+"                tot-bytes-allocd  bytes allocated in total (turnover)\n"
 "                max-blocks-live   maximum live blocks\n"
+"                tot-blocks-allocd blocks allocated in total (turnover)\n"
    );
 }
 
@@ -1175,6 +1176,9 @@ static ULong get_metric__tot_bytes ( APInfo* api ) {
 static ULong get_metric__max_blocks_live ( APInfo* api ) {
    return api->max_blocks_live;
 }
+static ULong get_metric__tot_blocks ( APInfo* api ) {
+   return api->tot_blocks;
+}
 
 /* Given a string, return the metric-access function and also a Bool
    indicating whether we want increasing or decreasing values of the
@@ -1200,6 +1204,11 @@ static Bool identify_metric ( /*OUT*/ULong(**get_metricP)(APInfo*),
       *increasingP = False;
       return True;
    }
+   if (0 == VG_(strcmp)(metric_name, "tot-blocks-allocd")) {
+      *get_metricP = get_metric__tot_blocks;
+      *increasingP = False;
+      return True;
+   }
    return False;
 }
 
index 49df7a6b78cffefc3fd2756adf2492402d8d4d95..4836c398db1f2d6f2a06bc69af771a7c1700936e 100644 (file)
@@ -372,16 +372,17 @@ to be the case, but it could happen.</para>
        allocation points according to some metric, and shows the
        highest scoring entries.  <varname>--sort-by</varname>
        selects the metric used for sorting:</para>
-      <para><varname>max-bytes-live   </varname>    maximum live bytes [default]</para>
-      <para><varname>tot-bytes-allocd </varname>  total allocation (turnover)</para>
-      <para><varname>max-blocks-live  </varname>   maximum live blocks</para>
+      <para><varname>max-bytes-live   </varname>  maximum live bytes [default]</para>
+      <para><varname>tot-bytes-allocd </varname>  bytes allocates in total (turnover)</para>
+      <para><varname>max-blocks-live  </varname>  maximum live blocks</para>
+      <para><varname>tot-blocks-allocd </varname> blocks allocated in total (turnover)</para>
       <para>This controls the order in which allocation points are
        displayed.  You can choose to look at allocation points with
-       the highest maximum liveness, or the highest total turnover, or
-       by the highest number of live blocks.  These give usefully
-       different pictures of program behaviour.  For example, sorting
-       by maximum live blocks tends to show up allocation points
-       creating large numbers of small objects.</para>
+       the highest number of live bytes, or the highest total byte turnover, or
+       by the highest number of live blocks, or the highest total block
+       turnover.  These give usefully different pictures of program behaviour.
+       For example, sorting by maximum live blocks tends to show up allocation
+       points creating large numbers of small objects.</para>
     </listitem>
   </varlistentry>