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:
@@ -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",
|
||||
|
||||
@@ -77,6 +77,8 @@ class ProfileFunction : public ZoneAllocated {
|
||||
return &function_;
|
||||
}
|
||||
|
||||
bool is_visible() const;
|
||||
|
||||
intptr_t table_index() const {
|
||||
return table_index_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user