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

Unified Diff: src/debug/debug.h

Issue 1478613004: [debugger] track debugger feature usage via histogram. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « src/counters.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.h
diff --git a/src/debug/debug.h b/src/debug/debug.h
index d8e7596a9b53dca5319a0a0a4d2c5258273f7846..03980950ad67a6ccc23f0bad96432fe479811eea 100644
--- a/src/debug/debug.h
+++ b/src/debug/debug.h
@@ -343,6 +343,28 @@ class LockingCommandMessageQueue BASE_EMBEDDED {
};
+class DebugFeatureTracker {
+ public:
+ enum Feature {
+ kActive = 1,
+ kBreakPoint = 2,
+ kStepping = 3,
+ kHeapSnapshot = 4,
+ kAllocationTracking = 5,
+ kProfiler = 6,
+ kLiveEdit = 7,
+ };
+
+ explicit DebugFeatureTracker(Isolate* isolate)
+ : isolate_(isolate), bitfield_(0) {}
+ void Track(Feature feature);
+
+ private:
+ Isolate* isolate_;
+ uint32_t bitfield_;
+};
+
+
// This class contains the debugger support. The main purpose is to handle
// setting break points in the code.
//
@@ -508,6 +530,8 @@ class Debug {
StepAction last_step_action() { return thread_local_.last_step_action_; }
+ DebugFeatureTracker* feature_tracker() { return &feature_tracker_; }
+
private:
explicit Debug(Isolate* isolate);
@@ -606,6 +630,9 @@ class Debug {
// before returning to the DebugBreakCallHelper.
Address after_break_target_;
+ // Used to collect histogram data on debugger feature usage.
+ DebugFeatureTracker feature_tracker_;
+
// Per-thread data.
class ThreadLocal {
public:
« no previous file with comments | « src/counters.h ('k') | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698