OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |