Index: tools/tickprocessor.js |
diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js |
index c95a4e616edcfe7b3a39706fa4747014560abef7..7dfcc54570165b124308d12010b9d8ae8c7b565b 100644 |
--- a/tools/tickprocessor.js |
+++ b/tools/tickprocessor.js |
@@ -174,7 +174,7 @@ TickProcessor.prototype.processLogFile = function(fileName) { |
TickProcessor.prototype.processSharedLibrary = function( |
name, startAddr, endAddr) { |
- var entry = this.profile_.addStaticCode(name, startAddr, endAddr); |
+ var entry = this.profile_.addLibrary(name, startAddr, endAddr); |
this.setCodeType(entry.getName(), 'SHARED_LIB'); |
var self = this; |
@@ -380,14 +380,21 @@ CppEntriesProvider.prototype.parseVmSymbols = function( |
var prevEntry; |
- function addPrevEntry(end) { |
+ function addEntry(funcInfo) { |
// Several functions can be mapped onto the same address. To avoid |
// creating zero-sized entries, skip such duplicates. |
// Also double-check that function belongs to the library address space. |
- if (prevEntry && prevEntry.start < end && |
- prevEntry.start >= libStart && end <= libEnd) { |
- processorFunc(prevEntry.name, prevEntry.start, end); |
+ if (prevEntry && !('end' in prevEntry) && |
Kasper Lund
2009/07/14 07:52:57
The 'end' in prevEntry stuff looks a bit weird to
Mikhail Naganov
2009/07/14 09:45:47
You're right, zero is a forbidden value here. Chan
|
+ prevEntry.start < funcInfo.start && |
+ prevEntry.start >= libStart && funcInfo.start <= libEnd) { |
+ processorFunc(prevEntry.name, prevEntry.start, funcInfo.start); |
} |
+ if ('end' in funcInfo && |
+ (!prevEntry || prevEntry.start != funcInfo.start) && |
+ funcInfo.start >= libStart && funcInfo.end <= libEnd) { |
+ processorFunc(funcInfo.name, funcInfo.start, funcInfo.end); |
+ } |
+ prevEntry = funcInfo; |
} |
while (true) { |
@@ -400,10 +407,12 @@ CppEntriesProvider.prototype.parseVmSymbols = function( |
if (funcInfo.start < libStart && funcInfo.start < libEnd - libStart) { |
funcInfo.start += libStart; |
} |
- addPrevEntry(funcInfo.start); |
- prevEntry = funcInfo; |
+ if ('size' in funcInfo) { |
Kasper Lund
2009/07/14 07:52:57
Is this because you worry that size can be zero?
Mikhail Naganov
2009/07/14 09:45:47
Done.
|
+ funcInfo.end = funcInfo.start + funcInfo.size; |
+ } |
+ addEntry(funcInfo); |
} |
- addPrevEntry(libEnd); |
+ addEntry({name: '', start: libEnd}); |
}; |
@@ -424,15 +433,16 @@ function UnixCppEntriesProvider(nmExec) { |
inherits(UnixCppEntriesProvider, CppEntriesProvider); |
-UnixCppEntriesProvider.FUNC_RE = /^([0-9a-fA-F]{8}) [tTwW] (.*)$/; |
+UnixCppEntriesProvider.FUNC_RE = |
+ /^([0-9a-fA-F]{8}) ([0-9a-fA-F]{8} )?[tTwW] (.*)$/; |
UnixCppEntriesProvider.prototype.loadSymbols = function(libName) { |
this.parsePos = 0; |
try { |
this.symbols = [ |
- os.system(this.nmExec, ['-C', '-n', libName], -1, -1), |
- os.system(this.nmExec, ['-C', '-n', '-D', libName], -1, -1) |
+ os.system(this.nmExec, ['-C', '-n', '-S', libName], -1, -1), |
+ os.system(this.nmExec, ['-C', '-n', '-S', '-D', libName], -1, -1) |
]; |
} catch (e) { |
// If the library cannot be found on this system let's not panic. |
@@ -455,7 +465,14 @@ UnixCppEntriesProvider.prototype.parseNextLine = function() { |
var line = this.symbols[0].substring(this.parsePos, lineEndPos); |
this.parsePos = lineEndPos + 1; |
var fields = line.match(UnixCppEntriesProvider.FUNC_RE); |
- return fields ? { name: fields[2], start: parseInt(fields[1], 16) } : null; |
+ var funcInfo = null; |
+ if (fields) { |
+ funcInfo = { name: fields[3], start: parseInt(fields[1], 16) }; |
+ if (fields[2]) { |
+ funcInfo.size = parseInt(fields[2], 16); |
+ } |
+ } |
+ return funcInfo; |
}; |