| 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/os.h" | 5 #include "vm/os.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <limits.h> | 8 #include <limits.h> |
| 9 #include <malloc.h> | 9 #include <malloc.h> |
| 10 #include <time.h> | 10 #include <time.h> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace dart { | 24 namespace dart { |
| 25 | 25 |
| 26 // Linux CodeObservers. | 26 // Linux CodeObservers. |
| 27 | 27 |
| 28 DEFINE_FLAG(bool, generate_gdb_symbols, false, | 28 DEFINE_FLAG(bool, generate_gdb_symbols, false, |
| 29 "Generate symbols of generated dart functions for debugging with GDB"); | 29 "Generate symbols of generated dart functions for debugging with GDB"); |
| 30 DEFINE_FLAG(bool, generate_perf_events_symbols, false, | 30 DEFINE_FLAG(bool, generate_perf_events_symbols, false, |
| 31 "Generate events symbols for profiling with perf"); | 31 "Generate events symbols for profiling with perf"); |
| 32 DEFINE_FLAG(charp, generate_pprof_symbols, NULL, | 32 DEFINE_FLAG(charp, generate_pprof_symbols, NULL, |
| 33 "Generate events symbols for profiling with pprof"); | 33 "Writes pprof events symbols to the provided file"); |
| 34 | 34 |
| 35 class PerfCodeObserver : public CodeObserver { | 35 class PerfCodeObserver : public CodeObserver { |
| 36 public: | 36 public: |
| 37 PerfCodeObserver() { | 37 PerfCodeObserver() { |
| 38 Dart_FileOpenCallback file_open = Isolate::file_open_callback(); | 38 Dart_FileOpenCallback file_open = Isolate::file_open_callback(); |
| 39 if (file_open == NULL) { | 39 if (file_open == NULL) { |
| 40 return; | 40 return; |
| 41 } | 41 } |
| 42 const char* format = "/tmp/perf-%ld.map"; | 42 const char* format = "/tmp/perf-%ld.map"; |
| 43 intptr_t pid = getpid(); | 43 intptr_t pid = getpid(); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 void OS::Abort() { | 400 void OS::Abort() { |
| 401 abort(); | 401 abort(); |
| 402 } | 402 } |
| 403 | 403 |
| 404 | 404 |
| 405 void OS::Exit(int code) { | 405 void OS::Exit(int code) { |
| 406 exit(code); | 406 exit(code); |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace dart | 409 } // namespace dart |
| OLD | NEW |