Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: runtime/vm/profiler_service.cc

Issue 1826743002: Function profile should respect --show-invisible-frames (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/profiler_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 09d4d433f4bad784d0d5386bb35f39c79cf311b2..f47078f431e4e703a89cbf8ad219281ed7422138 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -17,6 +17,7 @@ namespace dart {
DECLARE_FLAG(int, max_profile_depth);
DECLARE_FLAG(int, profile_period);
+DECLARE_FLAG(bool, show_invisible_frames);
DEFINE_FLAG(bool, trace_profiler, false, "Trace profiler.");
@@ -137,6 +138,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) {
@@ -1615,6 +1625,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) {
THR_Print("S[%" Pd "]F[%" Pd "] %s %s 0x%" Px "\n",
« no previous file with comments | « runtime/vm/profiler_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698