OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/tracing/trace-event.h" | 5 #include "src/tracing/trace-event.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "src/counters.h" | 9 #include "src/counters.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 void CallStatsScopedTracer::Initialize(v8::internal::Isolate* isolate, | 39 void CallStatsScopedTracer::Initialize(v8::internal::Isolate* isolate, |
40 const uint8_t* category_group_enabled, | 40 const uint8_t* category_group_enabled, |
41 const char* name) { | 41 const char* name) { |
42 data_.isolate = isolate; | 42 data_.isolate = isolate; |
43 data_.category_group_enabled = category_group_enabled; | 43 data_.category_group_enabled = category_group_enabled; |
44 data_.name = name; | 44 data_.name = name; |
45 p_data_ = &data_; | 45 p_data_ = &data_; |
46 RuntimeCallStats* table = isolate->counters()->runtime_call_stats(); | 46 RuntimeCallStats* table = isolate->counters()->runtime_call_stats(); |
47 has_parent_scope_ = table->InUse(); | 47 has_parent_scope_ = table->InUse(); |
48 if (!has_parent_scope_ && table->current_timer() == NULL) table->Reset(); | 48 if (!has_parent_scope_) table->Reset(); |
49 v8::internal::tracing::AddTraceEvent( | 49 v8::internal::tracing::AddTraceEvent( |
50 TRACE_EVENT_PHASE_BEGIN, category_group_enabled, name, | 50 TRACE_EVENT_PHASE_BEGIN, category_group_enabled, name, |
51 v8::internal::tracing::kGlobalScope, v8::internal::tracing::kNoId, | 51 v8::internal::tracing::kGlobalScope, v8::internal::tracing::kNoId, |
52 TRACE_EVENT_FLAG_NONE, v8::internal::tracing::kNoId); | 52 TRACE_EVENT_FLAG_NONE, v8::internal::tracing::kNoId); |
53 } | 53 } |
54 | 54 |
55 } // namespace tracing | 55 } // namespace tracing |
56 } // namespace internal | 56 } // namespace internal |
57 } // namespace v8 | 57 } // namespace v8 |
OLD | NEW |