Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: gin/v8_platform.cc

Issue 1850603002: [tracing] Use trace event profiling for heap profiling Base URL: https://chromium.googlesource.com/chromium/src.git@all_categories
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gin/public/v8_platform.h ('k') | skia/ext/event_tracer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium 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 "gin/public/v8_platform.h" 5 #include "gin/public/v8_platform.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "base/threading/worker_pool.h" 10 #include "base/threading/worker_pool.h"
11 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
11 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
12 #include "gin/per_isolate_data.h" 13 #include "gin/per_isolate_data.h"
13 14
14 namespace gin { 15 namespace gin {
15 16
16 namespace { 17 namespace {
17 18
18 base::LazyInstance<V8Platform>::Leaky g_v8_platform = LAZY_INSTANCE_INITIALIZER; 19 base::LazyInstance<V8Platform>::Leaky g_v8_platform = LAZY_INSTANCE_INITIALIZER;
19 20
20 } // namespace 21 } // namespace
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 110
110 void V8Platform::UpdateTraceEventDuration(const uint8_t* category_enabled_flag, 111 void V8Platform::UpdateTraceEventDuration(const uint8_t* category_enabled_flag,
111 const char* name, 112 const char* name,
112 uint64_t handle) { 113 uint64_t handle) {
113 base::trace_event::TraceEventHandle traceEventHandle; 114 base::trace_event::TraceEventHandle traceEventHandle;
114 memcpy(&traceEventHandle, &handle, sizeof(handle)); 115 memcpy(&traceEventHandle, &handle, sizeof(handle));
115 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_enabled_flag, name, 116 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_enabled_flag, name,
116 traceEventHandle); 117 traceEventHandle);
117 } 118 }
118 119
120 void V8Platform::PushTracingPseudoStackFrame(const char* stack_frame) {
121 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread()
122 ->PushPseudoStackFrame(stack_frame);
123 }
124
125 void V8Platform::PopTracingPseudoStackFrame(const char* stack_frame) {
126 base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread()
127 ->PopPseudoStackFrame(stack_frame);
128 }
129
119 } // namespace gin 130 } // namespace gin
OLDNEW
« no previous file with comments | « gin/public/v8_platform.h ('k') | skia/ext/event_tracer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698