Commit 384a51da authored by jgruber's avatar jgruber Committed by Commit Bot

[prof] Attribute ticks in embedded builtins correctly

When attributing ticks to a function, we first check if the current pc
matches a section within the dynamic library. If we find a match here,
then we don't continue looking within dynamically generated range
information, e.g. for JS functions and builtins.

This logic breaks when embedded builtins come into play. They live
within the libv8.so shared library, and are found when looking up
statics. But what we really want is to look up the dynamically
generated code-range, which contains more precise information.

In this CL, this case is detected by matching the found symbol name.
If it's the embedded blob, then we continue to dynamic lookup.

Bug: v8:6666
Change-Id: I7cea2cd4898f5a08381a071bdbc2f862b9c80880
Reviewed-on: https://chromium-review.googlesource.com/1023422
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52723}
parent 7d32cf4e
......@@ -178,6 +178,15 @@ CodeMap.prototype.findInTree_ = function(tree, addr) {
return node && this.isAddressBelongsTo_(addr, node) ? node : null;
};
/**
* Embedded builtins are located in the shared library but should be attributed
* according to the dynamically generated code-create events.
*
* @private
*/
CodeMap.prototype.isEmbeddedBuiltin_ = function(entry) {
return entry.type == "CPP" && /v8_\w*embedded_blob_/.test(entry.name);
};
/**
* Finds a code entry that contains the specified address. Both static and
......@@ -196,7 +205,10 @@ CodeMap.prototype.findAddress = function(addr) {
result = this.findInTree_(this.libraries_, addr);
if (!result) return null;
}
return { entry : result.value, offset : addr - result.key };
if (!this.isEmbeddedBuiltin_(result.value)) {
// Embedded builtins are handled in the following dynamic section.
return { entry : result.value, offset : addr - result.key };
}
}
var min = this.dynamics_.findMin();
var max = this.dynamics_.findMax();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment