Commit a3770c73 authored by Ali Ijaz Sheikh's avatar Ali Ijaz Sheikh Committed by Commit Bot

[tracing] add INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP

Change-Id: I3cc0dd01d5e33ca7579a4c0dc8f5e65e6b7c76f4
Reviewed-on: https://chromium-review.googlesource.com/924507Reviewed-by: 's avatarFadi Meawad <fmeawad@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
Cr-Commit-Position: refs/heads/master@{#52922}
parent 19617ec0
......@@ -242,16 +242,30 @@ enum CategoryGroupEnabledFlags {
} \
} while (0)
// Adds a trace event with a given id and timestamp. Not Implemented.
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( \
phase, category_group, name, id, timestamp, flags, ...) \
UNIMPLEMENTED()
// Adds a trace event with a given id and timestamp.
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( \
phase, category_group, name, id, timestamp, flags, ...) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \
unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \
v8::internal::tracing::TraceID trace_event_trace_id(id, \
&trace_event_flags); \
v8::internal::tracing::AddTraceEventWithTimestamp( \
phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \
v8::internal::tracing::kNoId, trace_event_flags, timestamp, \
##__VA_ARGS__); \
} \
} while (0)
// Adds a trace event with a given id, thread_id, and timestamp. Not
// Implemented.
// Adds a trace event with a given id, thread_id, and timestamp. This redirects
// to INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP as we presently do not care
// about the thread id.
#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
phase, category_group, name, id, thread_id, timestamp, flags, ...) \
UNIMPLEMENTED()
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) \
......
......@@ -263,7 +263,12 @@ TEST(TestEventWithTimestamp) {
TRACE_EVENT_SCOPE_GLOBAL, 4104, "val", 1);
TRACE_EVENT_MARK_WITH_TIMESTAMP2("v8-cat", "mark", 13832, "a", 1, "b", 2);
CHECK_EQ(3, GET_TRACE_OBJECTS_LIST->size());
TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0("v8-cat", "begin", 5,
20683);
TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0("v8-cat", "end", 5,
32832);
CHECK_EQ(5, GET_TRACE_OBJECTS_LIST->size());
CHECK_EQ(1729, GET_TRACE_OBJECT(0)->timestamp);
CHECK_EQ(0, GET_TRACE_OBJECT(0)->num_args);
......@@ -273,4 +278,7 @@ TEST(TestEventWithTimestamp) {
CHECK_EQ(13832, GET_TRACE_OBJECT(2)->timestamp);
CHECK_EQ(2, GET_TRACE_OBJECT(2)->num_args);
CHECK_EQ(20683, GET_TRACE_OBJECT(3)->timestamp);
CHECK_EQ(32832, GET_TRACE_OBJECT(4)->timestamp);
}
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