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

Unified Diff: sky/tools/debugger/prompt/prompt.cc

Issue 854833004: Add pprof support to skydb (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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 | « sky/tools/debugger/prompt/BUILD.gn ('k') | sky/tools/skydb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/debugger/prompt/prompt.cc
diff --git a/sky/tools/debugger/prompt/prompt.cc b/sky/tools/debugger/prompt/prompt.cc
index 1c7154eb84b289866d26dc439c1e3e9eb0deebe7..0432d09f9df17183c7a52761d0fb12ea09caf0d6 100644
--- a/sky/tools/debugger/prompt/prompt.cc
+++ b/sky/tools/debugger/prompt/prompt.cc
@@ -5,7 +5,7 @@
#include <algorithm>
#include "base/bind.h"
-#include "base/files/file_path.h"
+#include "base/debug/profiler.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@@ -91,6 +91,10 @@ class Prompt : public mojo::ApplicationDelegate,
Quit(connection_id);
else if (info.path == "/load")
Load(connection_id, info.data);
+ else if (info.path == "/start_profiling")
+ StartProfiling(connection_id);
+ else if (info.path == "/stop_profiling")
+ StopProfiling(connection_id);
else {
Help(info.path, connection_id);
}
@@ -172,6 +176,16 @@ class Prompt : public mojo::ApplicationDelegate,
Respond(connection_id, trace);
}
+ void StartProfiling(int connection_id) {
+ base::debug::StartProfiling("sky_viewer.pprof");
+ Respond(connection_id, "Starting profiling (type 'stop_profiling' to stop");
+ }
+
+ void StopProfiling(int connection_id) {
+ base::debug::StopProfiling();
+ Respond(connection_id, "Stopped profiling");
+ }
+
bool is_tracing_;
DebuggerPtr debugger_;
tracing::TraceCoordinatorPtr tracing_;
« no previous file with comments | « sky/tools/debugger/prompt/BUILD.gn ('k') | sky/tools/skydb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698