|
From: <sv...@va...> - 2010-12-17 00:45:29
|
Author: njn
Date: 2010-12-17 00:45:19 +0000 (Fri, 17 Dec 2010)
New Revision: 11488
Log:
Added a --mod-funcname option to cg_diff.
Modified:
trunk/NEWS
trunk/cachegrind/cg_diff.in
trunk/cachegrind/docs/cg-manual.xml
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-12-08 23:22:53 UTC (rev 11487)
+++ trunk/NEWS 2010-12-17 00:45:19 UTC (rev 11488)
@@ -1,4 +1,10 @@
+Release 3.7.0 (???)
+~~~~~~~~~~~~~~~~~~~
+- Added the --mod-funcname option to cg_diff.
+
+
+
Release 3.6.0 (21 October 2010)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3.6.0 is a feature release with many significant improvements and the
Modified: trunk/cachegrind/cg_diff.in
===================================================================
--- trunk/cachegrind/cg_diff.in 2010-12-08 23:22:53 UTC (rev 11487)
+++ trunk/cachegrind/cg_diff.in 2010-12-17 00:45:19 UTC (rev 11488)
@@ -50,6 +50,7 @@
-v --version show version
--mod-filename=<expr> a Perl search-and-replace expression that is applied
to filenames, eg. --mod-filename='s/prog[0-9]/projN/'
+ --mod-funcname=<expr> like --mod-filename, but applied to function names
cg_diff is Copyright (C) 2010-2010 Nicholas Nethercote.
and licensed under the GNU General Public License, version 2.
@@ -61,6 +62,9 @@
# --mod-filename expression
my $mod_filename = undef;
+# --mod-funcname expression
+my $mod_funcname = undef;
+
#-----------------------------------------------------------------------------
# Argument and option handling
#-----------------------------------------------------------------------------
@@ -78,6 +82,9 @@
} elsif ($arg =~ /^--mod-filename=(.*)/) {
$mod_filename = $1;
+ } elsif ($arg =~ /^--mod-funcname=(.*)/) {
+ $mod_funcname = $1;
+
} else { # -h and --help fall under this case
die($usage);
}
@@ -201,7 +208,11 @@
} elsif (s/^fn=(.*)$//) {
defined($currFileName) || die;
- $currFileFuncName = "$currFileName#$1";
+ my $tmpFuncName = $1;
+ if (defined $mod_funcname) {
+ eval "\$tmpFuncName =~ $mod_funcname";
+ }
+ $currFileFuncName = "$currFileName#$tmpFuncName";
$currCC = $CCs{$currFileFuncName};
if (not defined $currCC) {
$currCC = [];
Modified: trunk/cachegrind/docs/cg-manual.xml
===================================================================
--- trunk/cachegrind/docs/cg-manual.xml 2010-12-08 23:22:53 UTC (rev 11487)
+++ trunk/cachegrind/docs/cg-manual.xml 2010-12-17 00:45:19 UTC (rev 11488)
@@ -787,6 +787,14 @@
<option>--mod-filename='s/version[0-9]/versionN/'</option> will suffice for
this case.</para>
+<para>
+Similarly, sometimes compilers auto-generate certain functions and give them
+randomized names. For example, GCC sometimes auto-generates functions with
+names like <function>T.1234</function>, and the suffixes vary from build to
+build. You can use the <option>--mod-funcname</option> option to remove
+small differences like these; it works in the same way as
+<option>--mod-filename</option>.</para>
+
</sect2>
@@ -1029,6 +1037,17 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>
+ <option><![CDATA[--mod-funcname=<expr> [default: none]]]></option>
+ </term>
+ <listitem>
+ <para>Like <option>--mod-filename</option>, but for filenames.
+ Useful for removing minor differences in randomized names of
+ auto-generated functions generated by some compilers.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
<!-- end of xi:include in the manpage -->
|