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

Side by Side Diff: test/cctest/test-trace-event.cc

Issue 1710573002: Revert of Add Scoped Context Info (Isolate) to V8 Traces (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « src/tracing/trace-event.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <stdlib.h> 4 #include <stdlib.h>
5 #include <string.h> 5 #include <string.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/list.h" 9 #include "src/list.h"
10 #include "src/list-inl.h" 10 #include "src/list-inl.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 TRACE_EVENT_ASYNC_END0("v8-cat", "a1", event_id); 249 TRACE_EVENT_ASYNC_END0("v8-cat", "a1", event_id);
250 250
251 CHECK_EQ(2, GET_TRACE_OBJECTS_LIST->length()); 251 CHECK_EQ(2, GET_TRACE_OBJECTS_LIST->length());
252 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_BEGIN, GET_TRACE_OBJECT(0)->phase); 252 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_BEGIN, GET_TRACE_OBJECT(0)->phase);
253 CHECK_EQ(event_id, GET_TRACE_OBJECT(0)->id); 253 CHECK_EQ(event_id, GET_TRACE_OBJECT(0)->id);
254 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_END, GET_TRACE_OBJECT(1)->phase); 254 CHECK_EQ(TRACE_EVENT_PHASE_ASYNC_END, GET_TRACE_OBJECT(1)->phase);
255 CHECK_EQ(event_id, GET_TRACE_OBJECT(1)->id); 255 CHECK_EQ(event_id, GET_TRACE_OBJECT(1)->id);
256 256
257 i::V8::SetPlatformForTesting(old_platform); 257 i::V8::SetPlatformForTesting(old_platform);
258 } 258 }
259
260 TEST(TestEventInContext) {
261 v8::Platform* old_platform = i::V8::GetCurrentPlatform();
262 MockTracingPlatform platform(old_platform);
263 i::V8::SetPlatformForTesting(&platform);
264
265 static uint64_t isolate_id = 0x20151021;
266 {
267 TRACE_EVENT_SCOPED_CONTEXT("v8-cat", "Isolate", isolate_id);
268 TRACE_EVENT0("v8-cat", "e");
269 }
270
271 CHECK_EQ(3, GET_TRACE_OBJECTS_LIST->length());
272 CHECK_EQ(TRACE_EVENT_PHASE_ENTER_CONTEXT, GET_TRACE_OBJECT(0)->phase);
273 CHECK_EQ("Isolate", GET_TRACE_OBJECT(0)->name);
274 CHECK_EQ(isolate_id, GET_TRACE_OBJECT(0)->id);
275 CHECK_EQ(TRACE_EVENT_PHASE_COMPLETE, GET_TRACE_OBJECT(1)->phase);
276 CHECK_EQ("e", GET_TRACE_OBJECT(1)->name);
277 CHECK_EQ(TRACE_EVENT_PHASE_LEAVE_CONTEXT, GET_TRACE_OBJECT(2)->phase);
278 CHECK_EQ("Isolate", GET_TRACE_OBJECT(2)->name);
279 CHECK_EQ(isolate_id, GET_TRACE_OBJECT(2)->id);
280
281 i::V8::SetPlatformForTesting(old_platform);
282 }
OLDNEW
« no previous file with comments | « src/tracing/trace-event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698