|
From: <sv...@va...> - 2007-02-08 06:47:21
|
Author: sewardj
Date: 2007-02-08 06:47:19 +0000 (Thu, 08 Feb 2007)
New Revision: 6573
Log:
Add a new flag --cachegrind-log-file to cg_annotate, which tells it
precisely the name of the profile data file it should use (instead of
assuming cachegrind.out.<pid> where <pid> is specified by the --<pid>
flag). The old mechanism is still supported though.
Modified:
trunk/cachegrind/cg_annotate.in
trunk/cachegrind/docs/cg-manual.xml
Modified: trunk/cachegrind/cg_annotate.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/cg_annotate.in 2007-02-07 19:55:30 UTC (rev 6572)
+++ trunk/cachegrind/cg_annotate.in 2007-02-08 06:47:19 UTC (rev 6573)
@@ -142,11 +142,13 @@
=20
# Usage message.
my $usage =3D <<END
-usage: cg_annotate [options] --<pid> [source-files]
+usage: cg_annotate [options] [source-files]
=20
options for the user, with defaults in [ ], are:
-h --help show this message
-v --version show version
+ --<pid> read profile data from cachegrind.out.<pid>
+ --cachegrind-out-file=3D<file> read profile data from <file>
--show=3DA,B,C only show figures for events A,B,C [all]
--sort=3DA,B,C sort columns by events A,B,C [event column o=
rder]
--threshold=3D<0--100> percentage of counts (of primary sort event)=
we
@@ -158,8 +160,11 @@
-I<d> --include=3D<d> add <d> to list of directories to search for=
=20
source files
=20
- Cachegrind is Copyright (C) 2002-2005 Nicholas Nethercote.
- Both are licensed under the GNU General Public License, version 2.
+ You must use either --<pid> or --cachegrind-out-file exactly once
+ in order that cg_annotate knows what file to read profile data from.
+
+ cg_annotate is Copyright (C) 2002-2007 Nicholas Nethercote.
+ and licensed under the GNU General Public License, version 2.
Bug reports, feedback, admiration, abuse, etc, to: njn\@valgrind.org.
=20
END
@@ -236,12 +241,23 @@
$inc =3D~ s|/$||; # trim trailing '/'
push(@include_dirs, "$inc/");
=20
+ # --cachegrind-out-file=3D<filename>
+ } elsif ($arg =3D~ /^--cachegrind-out-file=3D(.*)$/) {
+ if (not defined $input_file) {
+ $input_file =3D $1;
+ } else {
+ die("You may only specify one input file\n" .
+ "using the --<pid> and --cachegrind-out-file opt=
ions.\n");
+ }
+
+ # --<pid>
} elsif ($arg =3D~ /^--(\d+)$/) {
my $pid =3D $1;
if (not defined $input_file) {
$input_file =3D "cachegrind.out.$pid";
} else {
- die("One cachegrind.out.<pid> file at a time, please=
\n");
+ die("You may only specify one input file\n" .
+ "using the --<pid> and --cachegrind-out-file opt=
ions.\n");
}
=20
} else { # -h and --help fall under this case
@@ -307,7 +323,8 @@
=20
sub read_input_file()=20
{
- open(INPUTFILE, "< $input_file") || die "File $input_file not opened=
\n";
+ open(INPUTFILE, "< $input_file")=20
+ || die "Cannot open $input_file for reading\n";
=20
# Read "desc:" lines.
my $line;
Modified: trunk/cachegrind/docs/cg-manual.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/docs/cg-manual.xml 2007-02-07 19:55:30 UTC (rev 6572=
)
+++ trunk/cachegrind/docs/cg-manual.xml 2007-02-08 06:47:19 UTC (rev 6573=
)
@@ -278,13 +278,17 @@
recycled).</para>
<para>
To use a basename other than the default
- <computeroutput>cachegrind.out.</computeroutput>,
+ <computeroutput>cachegrind.out</computeroutput>,
use the <computeroutput>--cachegrind-out-file</computeroutput>
switch.</para>
<para>
To add further qualifiers to the output filename you can use=20
the core's <computeroutput>--log-file-qualifier</computeroutput>
- flag.</para>
+ flag. This extends the file name further with the text
+ <computeroutput>.lfq.</computeroutput>followed by the
+ contents of the environment variable specified by=20
+ <computeroutput>--log-file-qualifier</computeroutput>.
+ </para>
</listitem>
<listitem>
<para>It can be huge: <computeroutput>ls -l</computeroutput>
@@ -359,9 +363,10 @@
<option><![CDATA[--cachegrind-out-file=3D<basename> ]]></option>
</term>
<listitem>
- <para>Write the profile data to <![CDATA[<basename>.<pid>]]>
+ <para>Write the profile data to=20
+ <computeroutput>basename.pid</computeroutput>
rather than to the default output file,=20
- <![CDATA[cachegrind.out.<pid>]]>.
+ <computeroutput>cachegrind.out.pid</computeroutput>.
</para>
</listitem>
</varlistentry>
@@ -732,11 +737,28 @@
=20
<listitem id=3D"pid">
<para><computeroutput>--pid</computeroutput></para>
- <para>Indicates which
- <computeroutput>cachegrind.out.pid</computeroutput> file to
- read. Not actually an option -- it is required.</para>
+ <para>Indicates that profile data should be read from=20
+ the file
+ <computeroutput>cachegrind.out.pid</computeroutput>.
+ read. =20
+ Note that you must specify either
+ <computeroutput>--pid</computeroutput>
+ or <computeroutput>--cachegrind-out-file=3Dfilename</computeroutput>
+ exactly once.
+ </para>
</listitem>
=20
+ <listitem id=3D"cachegrind-out-file">
+ <para><computeroutput>--cachegrind-out-file=3Dfilename</computeroutp=
ut></para>
+ <para>Indicates that profile data
+ should be read from <computeroutput>filename</computeroutput>.
+ Note that you must specify either
+ <computeroutput>--pid</computeroutput>
+ or <computeroutput>--cachegrind-out-file=3Dfilename</computeroutput>
+ exactly once.
+ </para>
+ </listitem>
+ =20
<listitem>
<para><computeroutput>-h, --help</computeroutput></para>
<para><computeroutput>-v, --version</computeroutput></para>
|