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

Side by Side Diff: base/trace_event/trace_event_impl.cc

Issue 920963002: [tracing] Add a DCHECK to ensure that trace events have a valid timestamp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 4
5 #include "base/trace_event/trace_event_impl.h" 5 #include "base/trace_event/trace_event_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 1914
1915 // Avoid re-entrance of AddTraceEvent. This may happen in GPU process when 1915 // Avoid re-entrance of AddTraceEvent. This may happen in GPU process when
1916 // ECHO_TO_CONSOLE is enabled: AddTraceEvent -> LOG(ERROR) -> 1916 // ECHO_TO_CONSOLE is enabled: AddTraceEvent -> LOG(ERROR) ->
1917 // GpuProcessLogMessageHandler -> PostPendingTask -> TRACE_EVENT ... 1917 // GpuProcessLogMessageHandler -> PostPendingTask -> TRACE_EVENT ...
1918 if (thread_is_in_trace_event_.Get()) 1918 if (thread_is_in_trace_event_.Get())
1919 return handle; 1919 return handle;
1920 1920
1921 AutoThreadLocalBoolean thread_is_in_trace_event(&thread_is_in_trace_event_); 1921 AutoThreadLocalBoolean thread_is_in_trace_event(&thread_is_in_trace_event_);
1922 1922
1923 DCHECK(name); 1923 DCHECK(name);
1924 DCHECK(!timestamp.is_null());
1924 1925
1925 if (flags & TRACE_EVENT_FLAG_MANGLE_ID) 1926 if (flags & TRACE_EVENT_FLAG_MANGLE_ID)
1926 id ^= process_id_hash_; 1927 id ^= process_id_hash_;
1927 1928
1928 TimeTicks now = OffsetTimestamp(timestamp); 1929 TimeTicks now = OffsetTimestamp(timestamp);
1929 TimeTicks thread_now = ThreadNow(); 1930 TimeTicks thread_now = ThreadNow();
1930 1931
1931 ThreadLocalEventBuffer* thread_local_event_buffer = NULL; 1932 ThreadLocalEventBuffer* thread_local_event_buffer = NULL;
1932 // A ThreadLocalEventBuffer needs the message loop 1933 // A ThreadLocalEventBuffer needs the message loop
1933 // - to know when the thread exits; 1934 // - to know when the thread exits;
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2598 } 2599 }
2599 2600
2600 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { 2601 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() {
2601 if (*category_group_enabled_) { 2602 if (*category_group_enabled_) {
2602 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, 2603 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_,
2603 name_, event_handle_); 2604 name_, event_handle_);
2604 } 2605 }
2605 } 2606 }
2606 2607
2607 } // namespace trace_event_internal 2608 } // namespace trace_event_internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698