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_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <android/log.h> // NOLINT | 10 #include <android/log.h> // NOLINT |
11 #include <errno.h> // NOLINT | 11 #include <errno.h> // NOLINT |
12 #include <limits.h> // NOLINT | 12 #include <limits.h> // NOLINT |
13 #include <malloc.h> // NOLINT | 13 #include <malloc.h> // NOLINT |
14 #include <time.h> // NOLINT | 14 #include <time.h> // NOLINT |
15 #include <sys/resource.h> // NOLINT | 15 #include <sys/resource.h> // NOLINT |
16 #include <sys/time.h> // NOLINT | 16 #include <sys/time.h> // NOLINT |
17 #include <sys/types.h> // NOLINT | 17 #include <sys/types.h> // NOLINT |
18 #include <unistd.h> // NOLINT | 18 #include <unistd.h> // NOLINT |
19 | 19 |
20 #include "platform/utils.h" | 20 #include "platform/utils.h" |
21 #include "vm/code_observers.h" | 21 #include "vm/code_observers.h" |
22 #include "vm/dart.h" | 22 #include "vm/dart.h" |
23 #include "vm/debuginfo.h" | 23 #include "vm/debuginfo.h" |
24 #include "vm/isolate.h" | 24 #include "vm/isolate.h" |
| 25 #include "vm/vtune.h" |
25 #include "vm/zone.h" | 26 #include "vm/zone.h" |
26 | 27 |
27 | 28 |
28 namespace dart { | 29 namespace dart { |
29 | 30 |
30 // Android CodeObservers. | 31 // Android CodeObservers. |
31 | 32 |
32 DEFINE_FLAG(bool, generate_gdb_symbols, false, | 33 DEFINE_FLAG(bool, generate_gdb_symbols, false, |
33 "Generate symbols of generated dart functions for debugging with GDB"); | 34 "Generate symbols of generated dart functions for debugging with GDB"); |
34 DEFINE_FLAG(bool, generate_perf_events_symbols, false, | 35 DEFINE_FLAG(bool, generate_perf_events_symbols, false, |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 if (FLAG_generate_perf_events_symbols) { | 375 if (FLAG_generate_perf_events_symbols) { |
375 CodeObservers::Register(new PerfCodeObserver); | 376 CodeObservers::Register(new PerfCodeObserver); |
376 } | 377 } |
377 if (FLAG_generate_gdb_symbols) { | 378 if (FLAG_generate_gdb_symbols) { |
378 CodeObservers::Register(new GdbCodeObserver); | 379 CodeObservers::Register(new GdbCodeObserver); |
379 } | 380 } |
380 if (FLAG_generate_pprof_symbols != NULL) { | 381 if (FLAG_generate_pprof_symbols != NULL) { |
381 CodeObservers::Register(new PprofCodeObserver); | 382 CodeObservers::Register(new PprofCodeObserver); |
382 } | 383 } |
383 #if defined(DART_VTUNE_SUPPORT) | 384 #if defined(DART_VTUNE_SUPPORT) |
384 Register(new VTuneCodeObserver); | 385 CodeObservers::Register(new VTuneCodeObserver); |
385 #endif | 386 #endif |
386 } | 387 } |
387 | 388 |
388 | 389 |
389 void OS::PrintErr(const char* format, ...) { | 390 void OS::PrintErr(const char* format, ...) { |
390 va_list args; | 391 va_list args; |
391 va_start(args, format); | 392 va_start(args, format); |
392 VFPrint(stderr, format, args); | 393 VFPrint(stderr, format, args); |
393 // Forward to the Android log for remote access. | 394 // Forward to the Android log for remote access. |
394 __android_log_vprint(ANDROID_LOG_ERROR, "DartVM", format, args); | 395 __android_log_vprint(ANDROID_LOG_ERROR, "DartVM", format, args); |
(...skipping 20 matching lines...) Expand all Loading... |
415 } | 416 } |
416 | 417 |
417 | 418 |
418 void OS::Exit(int code) { | 419 void OS::Exit(int code) { |
419 exit(code); | 420 exit(code); |
420 } | 421 } |
421 | 422 |
422 } // namespace dart | 423 } // namespace dart |
423 | 424 |
424 #endif // defined(TARGET_OS_ANDROID) | 425 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |