OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 | 8 |
9 #include "lib/stacktrace.h" | 9 #include "lib/stacktrace.h" |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 6456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6467 Dart_Timeline_Event_Type type, | 6467 Dart_Timeline_Event_Type type, |
6468 intptr_t argument_count, | 6468 intptr_t argument_count, |
6469 const char** argument_names, | 6469 const char** argument_names, |
6470 const char** argument_values) { | 6470 const char** argument_values) { |
6471 if (!FLAG_support_timeline) { | 6471 if (!FLAG_support_timeline) { |
6472 return; | 6472 return; |
6473 } | 6473 } |
6474 if (type < Dart_Timeline_Event_Begin) { | 6474 if (type < Dart_Timeline_Event_Begin) { |
6475 return; | 6475 return; |
6476 } | 6476 } |
6477 if (type > Dart_Timeline_Event_Counter) { | 6477 if (type > Dart_Timeline_Event_Flow_End) { |
6478 return; | 6478 return; |
6479 } | 6479 } |
6480 TimelineStream* stream = Timeline::GetEmbedderStream(); | 6480 TimelineStream* stream = Timeline::GetEmbedderStream(); |
6481 ASSERT(stream != NULL); | 6481 ASSERT(stream != NULL); |
6482 TimelineEvent* event = stream->StartEvent(); | 6482 TimelineEvent* event = stream->StartEvent(); |
6483 if (event == NULL) { | 6483 if (event == NULL) { |
6484 return; | 6484 return; |
6485 } | 6485 } |
6486 label = strdup(label); | 6486 label = strdup(label); |
6487 switch (type) { | 6487 switch (type) { |
(...skipping 14 matching lines...) Expand all Loading... |
6502 break; | 6502 break; |
6503 case Dart_Timeline_Event_Async_End: | 6503 case Dart_Timeline_Event_Async_End: |
6504 event->AsyncEnd(label, timestamp1_or_async_id, timestamp0); | 6504 event->AsyncEnd(label, timestamp1_or_async_id, timestamp0); |
6505 break; | 6505 break; |
6506 case Dart_Timeline_Event_Async_Instant: | 6506 case Dart_Timeline_Event_Async_Instant: |
6507 event->AsyncInstant(label, timestamp1_or_async_id, timestamp0); | 6507 event->AsyncInstant(label, timestamp1_or_async_id, timestamp0); |
6508 break; | 6508 break; |
6509 case Dart_Timeline_Event_Counter: | 6509 case Dart_Timeline_Event_Counter: |
6510 event->Counter(label, timestamp0); | 6510 event->Counter(label, timestamp0); |
6511 break; | 6511 break; |
| 6512 case Dart_Timeline_Event_Flow_Begin: |
| 6513 event->FlowBegin(label, timestamp1_or_async_id, timestamp0); |
| 6514 break; |
| 6515 case Dart_Timeline_Event_Flow_Step: |
| 6516 event->FlowStep(label, timestamp1_or_async_id, timestamp0); |
| 6517 break; |
| 6518 case Dart_Timeline_Event_Flow_End: |
| 6519 event->FlowEnd(label, timestamp1_or_async_id, timestamp0); |
| 6520 break; |
6512 default: | 6521 default: |
6513 FATAL("Unknown Dart_Timeline_Event_Type"); | 6522 FATAL("Unknown Dart_Timeline_Event_Type"); |
6514 } | 6523 } |
6515 event->set_owns_label(true); | 6524 event->set_owns_label(true); |
6516 event->SetNumArguments(argument_count); | 6525 event->SetNumArguments(argument_count); |
6517 for (intptr_t i = 0; i < argument_count; i++) { | 6526 for (intptr_t i = 0; i < argument_count; i++) { |
6518 event->CopyArgument(i, argument_names[i], argument_values[i]); | 6527 event->CopyArgument(i, argument_names[i], argument_values[i]); |
6519 } | 6528 } |
6520 event->Complete(); | 6529 event->Complete(); |
6521 } | 6530 } |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6991 } | 7000 } |
6992 | 7001 |
6993 | 7002 |
6994 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { | 7003 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { |
6995 #ifndef PRODUCT | 7004 #ifndef PRODUCT |
6996 Profiler::DumpStackTrace(context); | 7005 Profiler::DumpStackTrace(context); |
6997 #endif | 7006 #endif |
6998 } | 7007 } |
6999 | 7008 |
7000 } // namespace dart | 7009 } // namespace dart |
OLD | NEW |