| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 | 7 |
| 8 #include "include/libplatform/v8-tracing.h" | 8 #include "include/libplatform/v8-tracing.h" |
| 9 | 9 |
| 10 #include "src/base/platform/mutex.h" | 10 #include "src/base/platform/mutex.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 v8::base::AtomicWord g_category_index = g_num_builtin_categories; | 39 v8::base::AtomicWord g_category_index = g_num_builtin_categories; |
| 40 | 40 |
| 41 void TracingController::Initialize(TraceBuffer* trace_buffer) { | 41 void TracingController::Initialize(TraceBuffer* trace_buffer) { |
| 42 trace_buffer_.reset(trace_buffer); | 42 trace_buffer_.reset(trace_buffer); |
| 43 } | 43 } |
| 44 | 44 |
| 45 uint64_t TracingController::AddTraceEvent( | 45 uint64_t TracingController::AddTraceEvent( |
| 46 char phase, const uint8_t* category_enabled_flag, const char* name, | 46 char phase, const uint8_t* category_enabled_flag, const char* name, |
| 47 const char* scope, uint64_t id, uint64_t bind_id, int num_args, | 47 const char* scope, uint64_t id, uint64_t bind_id, int num_args, |
| 48 const char** arg_names, const uint8_t* arg_types, | 48 const char** arg_names, const uint8_t* arg_types, |
| 49 const uint64_t* arg_values, unsigned int flags) { | 49 const uint64_t* arg_values, |
| 50 std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables, |
| 51 unsigned int flags) { |
| 50 uint64_t handle; | 52 uint64_t handle; |
| 51 TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle); | 53 TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle); |
| 52 if (trace_object) { | 54 if (trace_object) { |
| 53 trace_object->Initialize(phase, category_enabled_flag, name, scope, id, | 55 trace_object->Initialize(phase, category_enabled_flag, name, scope, id, |
| 54 bind_id, num_args, arg_names, arg_types, | 56 bind_id, num_args, arg_names, arg_types, |
| 55 arg_values, flags); | 57 arg_values, arg_convertables, flags); |
| 56 } | 58 } |
| 57 return handle; | 59 return handle; |
| 58 } | 60 } |
| 59 | 61 |
| 60 void TracingController::UpdateTraceEventDuration( | 62 void TracingController::UpdateTraceEventDuration( |
| 61 const uint8_t* category_enabled_flag, const char* name, uint64_t handle) { | 63 const uint8_t* category_enabled_flag, const char* name, uint64_t handle) { |
| 62 TraceObject* trace_object = trace_buffer_->GetEventByHandle(handle); | 64 TraceObject* trace_object = trace_buffer_->GetEventByHandle(handle); |
| 63 if (!trace_object) return; | 65 if (!trace_object) return; |
| 64 trace_object->UpdateDuration(); | 66 trace_object->UpdateDuration(); |
| 65 } | 67 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } else { | 170 } else { |
| 169 category_group_enabled = | 171 category_group_enabled = |
| 170 &g_category_group_enabled[g_category_categories_exhausted]; | 172 &g_category_group_enabled[g_category_categories_exhausted]; |
| 171 } | 173 } |
| 172 return category_group_enabled; | 174 return category_group_enabled; |
| 173 } | 175 } |
| 174 | 176 |
| 175 } // namespace tracing | 177 } // namespace tracing |
| 176 } // namespace platform | 178 } // namespace platform |
| 177 } // namespace v8 | 179 } // namespace v8 |
| OLD | NEW |