summaryrefslogtreecommitdiffstats
path: root/chromium/base/trace_event/blame_context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/base/trace_event/blame_context.cc')
-rw-r--r--chromium/base/trace_event/blame_context.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chromium/base/trace_event/blame_context.cc b/chromium/base/trace_event/blame_context.cc
index 3c5f32ab464..e7599efa83f 100644
--- a/chromium/base/trace_event/blame_context.cc
+++ b/chromium/base/trace_event/blame_context.cc
@@ -40,6 +40,8 @@ BlameContext::~BlameContext() {
void BlameContext::Enter() {
DCHECK(WasInitialized());
+ if (LIKELY(!*category_group_enabled_))
+ return;
TRACE_EVENT_API_ADD_TRACE_EVENT(TRACE_EVENT_PHASE_ENTER_CONTEXT,
category_group_enabled_, name_, scope_, id_,
nullptr, TRACE_EVENT_FLAG_HAS_ID);
@@ -47,6 +49,8 @@ void BlameContext::Enter() {
void BlameContext::Leave() {
DCHECK(WasInitialized());
+ if (LIKELY(!*category_group_enabled_))
+ return;
TRACE_EVENT_API_ADD_TRACE_EVENT(TRACE_EVENT_PHASE_LEAVE_CONTEXT,
category_group_enabled_, name_, scope_, id_,
nullptr, TRACE_EVENT_FLAG_HAS_ID);
@@ -55,7 +59,7 @@ void BlameContext::Leave() {
void BlameContext::TakeSnapshot() {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(WasInitialized());
- if (!*category_group_enabled_)
+ if (LIKELY(!*category_group_enabled_))
return;
std::unique_ptr<trace_event::TracedValue> snapshot(
new trace_event::TracedValue);