From: Nicholas Nethercote Date: Sun, 16 Feb 2020 22:40:26 +0000 (+1100) Subject: Flip the default value of `--auto` and `--show-percs` to `yes`. X-Git-Tag: VALGRIND_3_16_0~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40ab2f14db75244fa791ea99b52f817f018d88ef;p=thirdparty%2Fvalgrind.git Flip the default value of `--auto` and `--show-percs` to `yes`. In both `cg_annotate` and `callgrind_annotate`. --- diff --git a/NEWS b/NEWS index 07dd91489f..5dbb014c40 100644 --- a/NEWS +++ b/NEWS @@ -35,7 +35,14 @@ support for X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux. * Cachegrind: + - cg_annotate's --auto and --show-percs options now default to 'yes', because + they are usually wanted. + * Callgrind: + + - callgrind_annotate's --auto and --show-percs options now default to 'yes', + because they are usually wanted. + - The command option --collect-systime has been enhanced to specify the unit used to record the elapsed time spent during system calls. The command option now accepts the values no|yes|msec|usec|nsec, diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in index 1daa15da23..fea114bf49 100644 --- a/cachegrind/cg_annotate.in +++ b/cachegrind/cg_annotate.in @@ -123,11 +123,11 @@ my $default_threshold = 0.1; my $single_threshold = $default_threshold; # If on, show a percentage for each non-zero count. -my $show_percs = 0; +my $show_percs = 1; # If on, automatically annotates all files that are involved in getting over # all the threshold counts. -my $auto_annotate = 0; +my $auto_annotate = 1; # Number of lines to show around each annotated line. my $context = 8; @@ -152,9 +152,9 @@ usage: cg_annotate [options] cachegrind-out-file [source-files...] --sort=A,B,C sort columns by events A,B,C [event column order] --threshold=<0--20> a function is shown if it accounts for more than x% of the counts of the primary sort event [$default_threshold] - --show-percs=yes|no show a percentage for each non-zero count + --show-percs=yes|no show a percentage for each non-zero count [yes] --auto=yes|no annotate all source files containing functions - that helped reach the event count threshold [no] + that helped reach the event count threshold [yes] --context=N print N lines of context before and after annotated lines [8] -I --include= add to list of directories to search for diff --git a/cachegrind/docs/cg-manual.xml b/cachegrind/docs/cg-manual.xml index d90a3be9c2..73b58b634e 100644 --- a/cachegrind/docs/cg-manual.xml +++ b/cachegrind/docs/cg-manual.xml @@ -368,16 +368,16 @@ and from libraries (e.g. getc.c) Line-by-line Counts -There are two ways to annotate source files -- by specifying them -manually as arguments to cg_annotate, or with the - option. For example, the output from running -cg_annotate <filename> concord.c for our example -produces the same output as above followed by an annotated version of -concord.c, a section of which looks like: +By default, all source code annotation is also shown. (Filenames to be +annotated can also by specified manually as arguments to cg_annotate, but this +is rarely needed.) For example, the output from running cg_annotate +<filename> for our example produces the same output as above +followed by an annotated version of concord.c, a section +of which looks like: controlled by the option. -To get automatic annotation, use the option. +Automatic annotation is enabled by default. cg_annotate will automatically annotate every source file it can find that is mentioned in the function-by-function summary. Therefore, the files chosen for auto-annotation are affected by @@ -946,7 +946,7 @@ small differences like these; it works in the same way as - + When enabled, a percentage is printed next to all event counts. @@ -957,7 +957,7 @@ small differences like these; it works in the same way as - + When enabled, automatically annotates every file that diff --git a/cachegrind/tests/ann1.vgtest b/cachegrind/tests/ann1.vgtest index 81243d3bde..676fe31996 100644 --- a/cachegrind/tests/ann1.vgtest +++ b/cachegrind/tests/ann1.vgtest @@ -2,5 +2,5 @@ # the post-processing of the cgout-test file. prog: ../../tests/true vgopts: --cachegrind-out-file=cachegrind.out -post: perl ../../cachegrind/cg_annotate --show=Ir,I1mr,ILmr --auto=yes cgout-test +post: perl ../../cachegrind/cg_annotate --show=Ir,I1mr,ILmr --show-percs=no cgout-test cleanup: rm cachegrind.out diff --git a/cachegrind/tests/ann2.vgtest b/cachegrind/tests/ann2.vgtest index b46da02602..5acc68b8d5 100644 --- a/cachegrind/tests/ann2.vgtest +++ b/cachegrind/tests/ann2.vgtest @@ -2,5 +2,5 @@ # the post-processing of the cgout-test file. prog: ../../tests/true vgopts: --cachegrind-out-file=cachegrind.out -post: perl ../../cachegrind/cg_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --show-percs=yes cgout-test +post: perl ../../cachegrind/cg_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes cgout-test cleanup: rm cachegrind.out diff --git a/callgrind/callgrind_annotate.in b/callgrind/callgrind_annotate.in index 8854aee137..16c0edf97c 100644 --- a/callgrind/callgrind_annotate.in +++ b/callgrind/callgrind_annotate.in @@ -139,11 +139,11 @@ my $default_threshold = 99; my $single_threshold = $default_threshold; # If on, show a percentage for each non-zero count. -my $show_percs = 0; +my $show_percs = 1; # If on, automatically annotates all files that are involved in getting over # all the threshold counts. -my $auto_annotate = 0; +my $auto_annotate = 1; # Number of lines to show around each annotated line. my $context = 8; @@ -211,9 +211,9 @@ usage: callgrind_annotate [options] [callgrind-out-file [source-files...]] Each event can optionally be followed by a : and a threshold percentage. If some event specific threshold are given, --threshold value is ignored. - --show-percs=yes|no show a percentage for each non-zero count + --show-percs=yes|no show a percentage for each non-zero count [yes] --auto=yes|no annotate all source files containing functions - that helped reach the event count threshold [no] + that helped reach the event count threshold [yes] --context=N print N lines of context before and after annotated lines [8] --inclusive=yes|no add subroutine costs to functions calls [no] diff --git a/callgrind/docs/cl-manual.xml b/callgrind/docs/cl-manual.xml index 38dc73d90a..713c1b7453 100644 --- a/callgrind/docs/cl-manual.xml +++ b/callgrind/docs/cl-manual.xml @@ -156,7 +156,7 @@ has to rely on heuristics to detect calls and returns. - Use to get annotated source code + By default, you will also get annotated source code for all relevant functions for which the source can be found. In addition to source annotation as produced by cg_annotate, you will see the @@ -1307,7 +1307,7 @@ their arguments. - + Annotate all source files containing functions that helped diff --git a/callgrind/tests/ann1.vgtest b/callgrind/tests/ann1.vgtest index 6b80ee3632..4ad9ae3903 100644 --- a/callgrind/tests/ann1.vgtest +++ b/callgrind/tests/ann1.vgtest @@ -2,5 +2,5 @@ # the post-processing of the cgout-test file. prog: ../../tests/true vgopts: --callgrind-out-file=callgrind.out -post: perl ../../callgrind/callgrind_annotate --show=Ir,I1mr,ILmr --auto=yes --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test +post: perl ../../callgrind/callgrind_annotate --show=Ir,I1mr,ILmr --show-percs=no --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test cleanup: rm callgrind.out diff --git a/callgrind/tests/ann2.vgtest b/callgrind/tests/ann2.vgtest index e92f93ac4f..30e177907f 100644 --- a/callgrind/tests/ann2.vgtest +++ b/callgrind/tests/ann2.vgtest @@ -2,5 +2,5 @@ # the post-processing of the cgout-test file. prog: ../../tests/true vgopts: --callgrind-out-file=callgrind.out -post: perl ../../callgrind/callgrind_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --include=../../cachegrind/tests --show-percs=yes ../../cachegrind/tests/cgout-test +post: perl ../../callgrind/callgrind_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test cleanup: rm callgrind.out