Function profile should respect --show-invisible-frames

This also improves the function profile by filtering out invisible frames.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1826743002 .
This commit is contained in:
John McCutchan
2016-03-23 15:01:21 -07:00
parent ef04426f17
commit afeae0eb69
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -18,6 +18,7 @@ namespace dart {
DECLARE_FLAG(int, max_profile_depth);
DECLARE_FLAG(int, profile_period);
DECLARE_FLAG(bool, show_invisible_frames);
#ifndef PRODUCT
@@ -136,6 +137,15 @@ const char* ProfileFunction::Name() const {
}
bool ProfileFunction::is_visible() const {
if (function_.IsNull()) {
// Some synthetic function.
return true;
}
return FLAG_show_invisible_frames || function_.is_visible();
}
void ProfileFunction::Tick(bool exclusive,
intptr_t inclusive_serial,
TokenPosition token_position) {
@@ -1624,6 +1634,9 @@ class ProfileBuilder : public ValueObject {
ProfileFunction* function,
TokenPosition token_position,
intptr_t code_index) {
if (!function->is_visible()) {
return current;
}
if (tick_functions_) {
if (FLAG_trace_profiler_verbose) {
THR_Print("S[%" Pd "]F[%" Pd "] %s %s 0x%" Px "\n",
+2
View File
@@ -77,6 +77,8 @@ class ProfileFunction : public ZoneAllocated {
return &function_;
}
bool is_visible() const;
intptr_t table_index() const {
return table_index_;
}