Skip to content

Commit

Permalink
Fix scoped trace events
Browse files Browse the repository at this point in the history
The macro was introducing an additional scope that was not the
scope we intend to trace.

Test: ./external/chromium-trace/systrace.py -t 10 -o /tmp/maps.html -a com.google.android.apps.maps gfx sched freq idle am wm gfx view sync irq binder_driver
Examine trace for markers and verify they are expected size.

Bug: angleproject:3176
Change-Id: I593b8685c5e72a844bebec4b98e1373110a235ad
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1492012
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@google.com>
  • Loading branch information
courtney-g authored and Commit Bot committed Mar 5, 2019
1 parent 912ac85 commit a8300e5
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/third_party/trace_event/trace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,20 +462,16 @@
// Implementation detail: internal macro to create static category and add begin
// event if the category is enabled. Also adds the end event when the scope
// ends.
#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, ...) \
do \
{ \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \
gl::TraceEvent::TraceEndOnScopeClose INTERNALTRACEEVENTUID(profileScope); \
if (*INTERNALTRACEEVENTUID(catstatic)) \
{ \
gl::TraceEvent::addTraceEvent( \
TRACE_EVENT_PHASE_BEGIN, INTERNALTRACEEVENTUID(catstatic), name, \
gl::TraceEvent::noEventId, TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \
INTERNALTRACEEVENTUID(profileScope) \
.initialize(INTERNALTRACEEVENTUID(catstatic), name); \
} \
} while (0)
#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, ...) \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \
gl::TraceEvent::TraceEndOnScopeClose INTERNALTRACEEVENTUID(profileScope); \
if (*INTERNALTRACEEVENTUID(catstatic)) \
{ \
gl::TraceEvent::addTraceEvent(TRACE_EVENT_PHASE_BEGIN, INTERNALTRACEEVENTUID(catstatic), \
name, gl::TraceEvent::noEventId, TRACE_EVENT_FLAG_NONE, \
##__VA_ARGS__); \
INTERNALTRACEEVENTUID(profileScope).initialize(INTERNALTRACEEVENTUID(catstatic), name); \
}

// Implementation detail: internal macro to create static category and add
// event if the category is enabled.
Expand Down

0 comments on commit a8300e5

Please sign in to comment.