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

Unified Diff: runtime/vm/profiler.h

Issue 2183993007: Add debug only counters to profiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | runtime/vm/profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.h
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index b6b24171a8b046b05f2ea5bbd59ccd3cd4625e03..dcea1d4205dad835d52e892c588326c9041eb595 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -27,6 +27,23 @@ class Sample;
class SampleBuffer;
class ProfileTrieNode;
+struct ProfilerCounters {
+ // Count of bail out reasons:
+ int64_t bail_out_unknown_task;
+ int64_t bail_out_jump_to_exception_handler;
+ int64_t bail_out_check_isolate;
+ // Count of single frame sampling reasons:
+ int64_t single_frame_sample_deoptimizing;
+ int64_t single_frame_sample_register_check;
+ int64_t single_frame_sample_get_and_validate_stack_bounds;
+ // Count of stack walkers used:
+ int64_t stack_walker_native;
+ int64_t stack_walker_dart_exit;
+ int64_t stack_walker_dart;
+ int64_t stack_walker_none;
+};
+
+
class Profiler : public AllStatic {
public:
static void InitOnce();
@@ -54,6 +71,11 @@ class Profiler : public AllStatic {
static void SampleThread(Thread* thread,
const InterruptedThreadState& state);
+ static ProfilerCounters counters() {
+ // Copies the counter values.
+ return counters_;
+ }
+
private:
// Does not walk the thread's stack.
static void SampleThreadSingleFrame(Thread* thread, uintptr_t pc);
@@ -61,6 +83,8 @@ class Profiler : public AllStatic {
static SampleBuffer* sample_buffer_;
+ static ProfilerCounters counters_;
+
friend class Thread;
};
« no previous file with comments | « no previous file | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698