Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #include "platform/globals.h" | |
| 6 #if defined(TARGET_OS_LINUX) | |
| 7 | |
| 8 #include "bin/vmstats_impl.h" | |
| 9 | |
| 10 #include <signal.h> // NOLINT | |
| 11 | |
| 12 | |
| 13 static void sig_handler(int sig) { | |
| 14 if (sig == SIGQUIT) { | |
| 15 VmStats::DumpStack(); | |
| 16 } | |
|
siva
2013/04/04 00:47:15
You should not be handling any other signals right
Tom Ball
2013/04/04 20:05:53
Done.
| |
| 17 } | |
| 18 | |
| 19 void VmStats::Initialize() { | |
| 20 // Enable SIGQUIT (ctrl-\) stack dumps. | |
| 21 if (signal(SIGQUIT, sig_handler) == SIG_ERR) { | |
|
siva
2013/04/04 00:47:15
You should be using the sigaction call here and no
Tom Ball
2013/04/04 20:05:53
Replaced with sigaction, except for Windows becaus
| |
| 22 perror("Adding SIGQUIT signal handler failed"); | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 #endif // defined(TARGET_OS_LINUX) | |
| OLD | NEW |