Skip to content

Commit 40ab2f1

Browse files
committed
Flip the default value of --auto and --show-percs to yes.
In both `cg_annotate` and `callgrind_annotate`.
1 parent 22aa864 commit 40ab2f1

File tree

9 files changed

+31
-24
lines changed

9 files changed

+31
-24
lines changed

NEWS

+7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ support for X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux.
3535

3636
* Cachegrind:
3737

38+
- cg_annotate's --auto and --show-percs options now default to 'yes', because
39+
they are usually wanted.
40+
3841
* Callgrind:
42+
43+
- callgrind_annotate's --auto and --show-percs options now default to 'yes',
44+
because they are usually wanted.
45+
3946
- The command option --collect-systime has been enhanced to specify
4047
the unit used to record the elapsed time spent during system calls.
4148
The command option now accepts the values no|yes|msec|usec|nsec,

cachegrind/cg_annotate.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ my $default_threshold = 0.1;
123123
my $single_threshold = $default_threshold;
124124

125125
# If on, show a percentage for each non-zero count.
126-
my $show_percs = 0;
126+
my $show_percs = 1;
127127

128128
# If on, automatically annotates all files that are involved in getting over
129129
# all the threshold counts.
130-
my $auto_annotate = 0;
130+
my $auto_annotate = 1;
131131

132132
# Number of lines to show around each annotated line.
133133
my $context = 8;
@@ -152,9 +152,9 @@ usage: cg_annotate [options] cachegrind-out-file [source-files...]
152152
--sort=A,B,C sort columns by events A,B,C [event column order]
153153
--threshold=<0--20> a function is shown if it accounts for more than x% of
154154
the counts of the primary sort event [$default_threshold]
155-
--show-percs=yes|no show a percentage for each non-zero count
155+
--show-percs=yes|no show a percentage for each non-zero count [yes]
156156
--auto=yes|no annotate all source files containing functions
157-
that helped reach the event count threshold [no]
157+
that helped reach the event count threshold [yes]
158158
--context=N print N lines of context before and after
159159
annotated lines [8]
160160
-I<d> --include=<d> add <d> to list of directories to search for

cachegrind/docs/cg-manual.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,16 @@ and from libraries (e.g. <filename>getc.c</filename>)</para>
368368
<sect2 id="cg-manual.line-by-line" xreflabel="Line-by-line Counts">
369369
<title>Line-by-line Counts</title>
370370

371-
<para>There are two ways to annotate source files -- by specifying them
372-
manually as arguments to cg_annotate, or with the
373-
<option>--auto=yes</option> option. For example, the output from running
374-
<filename>cg_annotate &lt;filename&gt; concord.c</filename> for our example
375-
produces the same output as above followed by an annotated version of
376-
<filename>concord.c</filename>, a section of which looks like:</para>
371+
<para>By default, all source code annotation is also shown. (Filenames to be
372+
annotated can also by specified manually as arguments to cg_annotate, but this
373+
is rarely needed.) For example, the output from running <filename>cg_annotate
374+
&lt;filename&gt; </filename> for our example produces the same output as above
375+
followed by an annotated version of <filename>concord.c</filename>, a section
376+
of which looks like:</para>
377377

378378
<programlisting><![CDATA[
379379
--------------------------------------------------------------------------------
380-
-- User-annotated source: concord.c
380+
-- Auto-annotated source: concord.c
381381
--------------------------------------------------------------------------------
382382
Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw
383383
@@ -437,7 +437,7 @@ part of a file the shown code comes from, eg:</para>
437437
controlled by the <option>--context</option>
438438
option.</para>
439439

440-
<para>To get automatic annotation, use the <option>--auto=yes</option> option.
440+
<para>Automatic annotation is enabled by default.
441441
cg_annotate will automatically annotate every source file it can
442442
find that is mentioned in the function-by-function summary.
443443
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
946946

947947
<varlistentry>
948948
<term>
949-
<option><![CDATA[--show-percs=<no|yes> [default: no] ]]></option>
949+
<option><![CDATA[--show-percs=<no|yes> [default: yes] ]]></option>
950950
</term>
951951
<listitem>
952952
<para>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
957957

958958
<varlistentry>
959959
<term>
960-
<option><![CDATA[--auto=<no|yes> [default: no] ]]></option>
960+
<option><![CDATA[--auto=<no|yes> [default: yes] ]]></option>
961961
</term>
962962
<listitem>
963963
<para>When enabled, automatically annotates every file that

cachegrind/tests/ann1.vgtest

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# the post-processing of the cgout-test file.
33
prog: ../../tests/true
44
vgopts: --cachegrind-out-file=cachegrind.out
5-
post: perl ../../cachegrind/cg_annotate --show=Ir,I1mr,ILmr --auto=yes cgout-test
5+
post: perl ../../cachegrind/cg_annotate --show=Ir,I1mr,ILmr --show-percs=no cgout-test
66
cleanup: rm cachegrind.out

cachegrind/tests/ann2.vgtest

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# the post-processing of the cgout-test file.
33
prog: ../../tests/true
44
vgopts: --cachegrind-out-file=cachegrind.out
5-
post: perl ../../cachegrind/cg_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --show-percs=yes cgout-test
5+
post: perl ../../cachegrind/cg_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes cgout-test
66
cleanup: rm cachegrind.out

callgrind/callgrind_annotate.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ my $default_threshold = 99;
139139
my $single_threshold = $default_threshold;
140140

141141
# If on, show a percentage for each non-zero count.
142-
my $show_percs = 0;
142+
my $show_percs = 1;
143143

144144
# If on, automatically annotates all files that are involved in getting over
145145
# all the threshold counts.
146-
my $auto_annotate = 0;
146+
my $auto_annotate = 1;
147147

148148
# Number of lines to show around each annotated line.
149149
my $context = 8;
@@ -211,9 +211,9 @@ usage: callgrind_annotate [options] [callgrind-out-file [source-files...]]
211211
Each event can optionally be followed by a :
212212
and a threshold percentage. If some event specific
213213
threshold are given, --threshold value is ignored.
214-
--show-percs=yes|no show a percentage for each non-zero count
214+
--show-percs=yes|no show a percentage for each non-zero count [yes]
215215
--auto=yes|no annotate all source files containing functions
216-
that helped reach the event count threshold [no]
216+
that helped reach the event count threshold [yes]
217217
--context=N print N lines of context before and after
218218
annotated lines [8]
219219
--inclusive=yes|no add subroutine costs to functions calls [no]

callgrind/docs/cl-manual.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ has to rely on heuristics to detect calls and returns.</para>
156156
</listitem>
157157
</itemizedlist>
158158

159-
<para>Use <option>--auto=yes</option> to get annotated source code
159+
<para>By default, you will also get annotated source code
160160
for all relevant functions for which the source can be found. In
161161
addition to source annotation as produced by
162162
<computeroutput>cg_annotate</computeroutput>, you will see the
@@ -1307,7 +1307,7 @@ their arguments.</para>
13071307

13081308
<varlistentry>
13091309
<term>
1310-
<option><![CDATA[--auto=<yes|no> [default: no] ]]></option>
1310+
<option><![CDATA[--auto=<yes|no> [default: yes] ]]></option>
13111311
</term>
13121312
<listitem>
13131313
<para>Annotate all source files containing functions that helped

callgrind/tests/ann1.vgtest

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# the post-processing of the cgout-test file.
33
prog: ../../tests/true
44
vgopts: --callgrind-out-file=callgrind.out
5-
post: perl ../../callgrind/callgrind_annotate --show=Ir,I1mr,ILmr --auto=yes --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test
5+
post: perl ../../callgrind/callgrind_annotate --show=Ir,I1mr,ILmr --show-percs=no --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test
66
cleanup: rm callgrind.out

callgrind/tests/ann2.vgtest

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# the post-processing of the cgout-test file.
33
prog: ../../tests/true
44
vgopts: --callgrind-out-file=callgrind.out
5-
post: perl ../../callgrind/callgrind_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --include=../../cachegrind/tests --show-percs=yes ../../cachegrind/tests/cgout-test
5+
post: perl ../../callgrind/callgrind_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test
66
cleanup: rm callgrind.out

0 commit comments

Comments
 (0)