perf tools: Fix build error on read only source.
[sfrench/cifs-2.6.git] / scripts / bloat-o-meter
old mode 100644 (file)
new mode 100755 (executable)
index 75f21d8..6501a50
@@ -18,7 +18,9 @@ def getsizes(file):
     for l in os.popen("nm --size-sort " + file).readlines():
         size, type, name = l[:-1].split()
         if type in "tTdDbB":
-            sym[name] = int(size, 16)
+            # function names begin with '.' on 64-bit powerpc
+            if "." in name[1:]: name = "static." + name.split(".")[0]
+            sym[name] = sym.get(name, 0) + int(size, 16)
     return sym
 
 old = getsizes(sys.argv[1])