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

Unified Diff: sky/tools/skydb

Issue 812573006: Sky should symbolize pprof traces (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/prompt.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/skydb
diff --git a/sky/tools/skydb b/sky/tools/skydb
index ab84fae44b9ff49b0c93d98188d0f9c8778c9dfc..5a5c836f9bc1042fd307c44d5dd506355df6565b 100755
--- a/sky/tools/skydb
+++ b/sky/tools/skydb
@@ -320,6 +320,16 @@ class SkyDebugger(object):
url = args.url_or_path
self._send_command_to_sky('/load', url)
+ def stop_profiling_command(self, args):
+ self._send_command_to_sky('/stop_profiling')
+ # We need to munge the profile to replace foo.mojo with libfoo.so so
+ # that pprof knows this represents an SO.
+ with open("sky_viewer.pprof", "r+") as profile_file:
+ data = profile_file.read()
+ profile_file.seek(0)
+ profile_file.write(re.sub(r'(\w+)\.mojo', r'lib\1_library.so', data))
+ profile_file.truncate()
+
def _command_base_url(self):
return 'http://localhost:%s' % self.pids['sky_command_port']
@@ -507,8 +517,10 @@ class SkyDebugger(object):
'stop the running sky instance')
self._add_basic_command(subparsers, 'start_profiling', '/start_profiling',
'starts profiling the running sky instance (Linux only)')
- self._add_basic_command(subparsers, 'stop_profiling', '/stop_profiling',
- 'stios profiling the running sky instance (Linux only)')
+
+ stop_profiling_parser = subparsers.add_parser('stop_profiling',
+ help='stops profiling the running sky instance (Linux only)')
+ stop_profiling_parser.set_defaults(func=self.stop_profiling_command)
load_parser = subparsers.add_parser('load',
help='load a new page in the currently running sky')
« no previous file with comments | « sky/tools/debugger/prompt/prompt.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698