Commit e0fd36b7 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

v8: Prep for removing TRACE_EVENT_SCOPED_CONTEXT.

It's only used in tests, and for some reason v8 refers to a macro defined
in src.git, so I need to remove this in v8 first before I can remove it
in Chromium.

Bug: chromium:934255
Change-Id: I31ea32aa43cf7a5f518def7b91dce99dcb268709
Reviewed-on: https://chromium-review.googlesource.com/c/1480911Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59769}
parent 16de69bd
......@@ -270,27 +270,6 @@ enum CategoryGroupEnabledFlags {
INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( \
phase, category_group, name, id, timestamp, flags, ##__VA_ARGS__)
// Enter and leave a context based on the current scope.
#define INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \
struct INTERNAL_TRACE_EVENT_UID(ScopedContext) { \
public: \
INTERNAL_TRACE_EVENT_UID(ScopedContext)(uint64_t cid) : cid_(cid) { \
TRACE_EVENT_ENTER_CONTEXT(category_group, name, cid_); \
} \
~INTERNAL_TRACE_EVENT_UID(ScopedContext)() { \
TRACE_EVENT_LEAVE_CONTEXT(category_group, name, cid_); \
} \
\
private: \
/* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \
INTERNAL_TRACE_EVENT_UID(ScopedContext) \
(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {} \
void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {} \
uint64_t cid_; \
}; \
INTERNAL_TRACE_EVENT_UID(ScopedContext) \
INTERNAL_TRACE_EVENT_UID(scoped_context)(context);
#define TRACE_EVENT_CALL_STATS_SCOPED(isolate, category_group, name) \
INTERNAL_TRACE_EVENT_CALL_STATS_SCOPED(isolate, category_group, name)
......
......@@ -234,26 +234,6 @@ TEST(TestEventWithId) {
CHECK_EQ(event_id, GET_TRACE_OBJECT(1)->id);
}
TEST(TestEventInContext) {
MockTracingPlatform platform;
static uint64_t isolate_id = 0x20151021;
{
TRACE_EVENT_SCOPED_CONTEXT("v8-cat", "Isolate", isolate_id);
TRACE_EVENT0("v8-cat", "e");
}
CHECK_EQ(3, GET_TRACE_OBJECTS_LIST->size());
CHECK_EQ(TRACE_EVENT_PHASE_ENTER_CONTEXT, GET_TRACE_OBJECT(0)->phase);
CHECK_EQ("Isolate", GET_TRACE_OBJECT(0)->name);
CHECK_EQ(isolate_id, GET_TRACE_OBJECT(0)->id);
CHECK_EQ(TRACE_EVENT_PHASE_COMPLETE, GET_TRACE_OBJECT(1)->phase);
CHECK_EQ("e", GET_TRACE_OBJECT(1)->name);
CHECK_EQ(TRACE_EVENT_PHASE_LEAVE_CONTEXT, GET_TRACE_OBJECT(2)->phase);
CHECK_EQ("Isolate", GET_TRACE_OBJECT(2)->name);
CHECK_EQ(isolate_id, GET_TRACE_OBJECT(2)->id);
}
TEST(TestEventWithTimestamp) {
MockTracingPlatform platform;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment