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, | 49 const uint64_t* arg_values, unsigned int flags) { |
50 std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables, | |
51 unsigned int flags) { | |
52 uint64_t handle; | 50 uint64_t handle; |
53 TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle); | 51 TraceObject* trace_object = trace_buffer_->AddTraceEvent(&handle); |
54 if (trace_object) { | 52 if (trace_object) { |
55 trace_object->Initialize(phase, category_enabled_flag, name, scope, id, | 53 trace_object->Initialize(phase, category_enabled_flag, name, scope, id, |
56 bind_id, num_args, arg_names, arg_types, | 54 bind_id, num_args, arg_names, arg_types, |
57 arg_values, arg_convertables, flags); | 55 arg_values, flags); |
58 } | 56 } |
59 return handle; | 57 return handle; |
60 } | 58 } |
61 | 59 |
62 void TracingController::UpdateTraceEventDuration( | 60 void TracingController::UpdateTraceEventDuration( |
63 const uint8_t* category_enabled_flag, const char* name, uint64_t handle) { | 61 const uint8_t* category_enabled_flag, const char* name, uint64_t handle) { |
64 TraceObject* trace_object = trace_buffer_->GetEventByHandle(handle); | 62 TraceObject* trace_object = trace_buffer_->GetEventByHandle(handle); |
65 if (!trace_object) return; | 63 if (!trace_object) return; |
66 trace_object->UpdateDuration(); | 64 trace_object->UpdateDuration(); |
67 } | 65 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } else { | 168 } else { |
171 category_group_enabled = | 169 category_group_enabled = |
172 &g_category_group_enabled[g_category_categories_exhausted]; | 170 &g_category_group_enabled[g_category_categories_exhausted]; |
173 } | 171 } |
174 return category_group_enabled; | 172 return category_group_enabled; |
175 } | 173 } |
176 | 174 |
177 } // namespace tracing | 175 } // namespace tracing |
178 } // namespace platform | 176 } // namespace platform |
179 } // namespace v8 | 177 } // namespace v8 |
OLD | NEW |