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

Unified Diff: runtime/bin/vmstats_impl_android.cc

Issue 13603002: Added ctrl-\ command that dumps isolate stacks to dart binary. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: runtime/bin/vmstats_impl_android.cc
===================================================================
--- runtime/bin/vmstats_impl_android.cc (revision 0)
+++ runtime/bin/vmstats_impl_android.cc (revision 0)
@@ -0,0 +1,26 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_ANDROID)
+
+#include "bin/vmstats_impl.h"
+
+#include <signal.h> // NOLINT
+
+
+static void sig_handler(int sig) {
+ if (sig == SIGQUIT) {
+ VmStats::DumpStack();
+ }
+}
+
+void VmStats::Initialize() {
+ // Enable SIGQUIT (ctrl-\) stack dumps.
+ if (signal(SIGQUIT, sig_handler) == SIG_ERR) {
+ perror("Adding SIGQUIT signal handler failed");
+ }
+}
+
+#endif // defined(TARGET_OS_ANDROID)

Powered by Google App Engine
This is Rietveld 408576698