[Libreoffice-commits] core.git: bin/ios-mapfile-statistics

Tor Lillqvist tml at collabora.com
Fri Apr 25 00:25:07 PDT 2014


 bin/ios-mapfile-statistics |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 5743570619ee2ef1350b88f708f21cd3ec38bac2
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 25 10:20:49 2014 +0300

    Add -f option to filter in symbols from some libraries only
    
    You can specify a regular expression for the -f option, typically
    several library names combined with the '|' operator, as in:
    
    bin/ios-mapfile-statistics -s -f 'libswlo|libsclo' <workdir/TiledLibreOffice.map|c++filt
    
    Change-Id: I917fc392a41ed28c6b19ec5c2c16384d1186a532

diff --git a/bin/ios-mapfile-statistics b/bin/ios-mapfile-statistics
index 2e16ed7..4e1f803 100755
--- a/bin/ios-mapfile-statistics
+++ b/bin/ios-mapfile-statistics
@@ -6,7 +6,9 @@ use Getopt::Std;
 
 my %args;
 
-getopts('s', \%args);
+getopts('f:s', \%args);
+
+die "The -f switch makes sense only if -s is also used" if (defined($args{'f'}) && !defined($args{'s'}));
 
 my $state = 0;
 my %libofnumber;
@@ -23,10 +25,13 @@ while (<>) {
   } elsif ($state == 2 && m!^# Address\s+Size\s+File\s+Name!) {
     $state = 3;
   } elsif ($state == 3 && m!^0x[0-9A-F]+\s+(0x[0-9A-F]+)\s+\[ *([0-9]+)\] (.*)!) {
-    if (defined($libofnumber{$2})) {
-      $sizeoflib{$libofnumber{$2}} += hex($1);
+    my ($size,$libnum,$symbol) = ($1, $2, $3);
+    if (defined($libofnumber{$libnum})) {
+      $sizeoflib{$libofnumber{$libnum}} += hex($size);
+      if (!defined($args{'f'}) || $libofnumber{$libnum} =~ /$args{'f'}/) {
+	  $sizeofsym{$symbol} = hex($size);
+	}
     }
-    $sizeofsym{$3} = hex($1);
   }
 }
 


More information about the Libreoffice-commits mailing list