Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 clock_fd_ = -1; | 145 clock_fd_ = -1; |
| 146 clock_id_ = kInvalidClockId; | 146 clock_id_ = kInvalidClockId; |
| 147 code_sequence_ = 0; | 147 code_sequence_ = 0; |
| 148 Dart_FileOpenCallback file_open = Isolate::file_open_callback(); | 148 Dart_FileOpenCallback file_open = Isolate::file_open_callback(); |
| 149 Dart_FileWriteCallback file_write = Isolate::file_write_callback(); | 149 Dart_FileWriteCallback file_write = Isolate::file_write_callback(); |
| 150 Dart_FileCloseCallback file_close = Isolate::file_close_callback(); | 150 Dart_FileCloseCallback file_close = Isolate::file_close_callback(); |
| 151 if ((file_open == NULL) || (file_write == NULL) || (file_close == NULL)) { | 151 if ((file_open == NULL) || (file_write == NULL) || (file_close == NULL)) { |
| 152 return; | 152 return; |
| 153 } | 153 } |
| 154 // The Jitdump code observer writes all jitted code into | 154 // The Jitdump code observer writes all jitted code into |
| 155 // /tmp/jit-<pid>.dump, we open the file once on initialization and close | 155 // ./perf-<pid>.jitdump, we open the file once on initialization and close |
| 156 // it when the VM is going down. | 156 // it when the VM is going down. |
| 157 { | 157 { |
| 158 // Open the file. | 158 // Open the file. |
| 159 const char* format = "/tmp/jit-%" Pd ".dump"; | 159 const char* format = "perf-%" Pd ".jitdump"; |
|
Vyacheslav Egorov (Google)
2014/08/20 20:14:39
perf is writing output into perf.data so I think w
| |
| 160 intptr_t pid = getpid(); | 160 intptr_t pid = getpid(); |
| 161 intptr_t len = OS::SNPrint(NULL, 0, format, pid); | 161 intptr_t len = OS::SNPrint(NULL, 0, format, pid); |
| 162 char* filename = new char[len + 1]; | 162 char* filename = new char[len + 1]; |
| 163 OS::SNPrint(filename, len + 1, format, pid); | 163 OS::SNPrint(filename, len + 1, format, pid); |
| 164 out_file_ = (*file_open)(filename, true); | 164 out_file_ = (*file_open)(filename, true); |
| 165 ASSERT(out_file_ != NULL); | 165 ASSERT(out_file_ != NULL); |
| 166 // Write the jit dump header. | 166 // Write the jit dump header. |
| 167 WriteHeader(); | 167 WriteHeader(); |
| 168 } | 168 } |
| 169 // perf uses an internal clock and because our output is merged with data | 169 // perf uses an internal clock and because our output is merged with data |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 620 } | 620 } |
| 621 | 621 |
| 622 | 622 |
| 623 void OS::Exit(int code) { | 623 void OS::Exit(int code) { |
| 624 exit(code); | 624 exit(code); |
| 625 } | 625 } |
| 626 | 626 |
| 627 } // namespace dart | 627 } // namespace dart |
| 628 | 628 |
| 629 #endif // defined(TARGET_OS_LINUX) | 629 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |