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/debug/trace_event_impl.h" | 5 #include "base/debug/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 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2042 void TraceLog::CancelWatchEvent() { | 2042 void TraceLog::CancelWatchEvent() { |
2043 AutoLock lock(lock_); | 2043 AutoLock lock(lock_); |
2044 subtle::NoBarrier_Store(&watch_category_, 0); | 2044 subtle::NoBarrier_Store(&watch_category_, 0); |
2045 watch_event_name_ = ""; | 2045 watch_event_name_ = ""; |
2046 watch_event_callback_.Reset(); | 2046 watch_event_callback_.Reset(); |
2047 } | 2047 } |
2048 | 2048 |
2049 void TraceLog::AddMetadataEventsWhileLocked() { | 2049 void TraceLog::AddMetadataEventsWhileLocked() { |
2050 lock_.AssertAcquired(); | 2050 lock_.AssertAcquired(); |
2051 | 2051 |
2052 #if !defined(OS_NACL) // NaCl shouldn't expose the process id. | |
Ruud van Asseldonk
2015/12/02 17:00:54
Either the comment is wrong, or the #if should not
| |
2053 InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), | |
2054 0, | |
2055 "num_cpus", "number", | |
2056 base::SysInfo::NumberOfProcessors()); | |
2057 #endif | |
2058 | |
2059 | |
2052 int current_thread_id = static_cast<int>(base::PlatformThread::CurrentId()); | 2060 int current_thread_id = static_cast<int>(base::PlatformThread::CurrentId()); |
2053 if (process_sort_index_ != 0) { | 2061 if (process_sort_index_ != 0) { |
2054 InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), | 2062 InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), |
2055 current_thread_id, | 2063 current_thread_id, |
2056 "process_sort_index", "sort_index", | 2064 "process_sort_index", "sort_index", |
2057 process_sort_index_); | 2065 process_sort_index_); |
2058 } | 2066 } |
2059 | 2067 |
2060 if (process_name_.size()) { | 2068 if (process_name_.size()) { |
2061 InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), | 2069 InitializeMetadataEvent(AddEventToThreadSharedChunkWhileLocked(NULL, false), |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2420 } | 2428 } |
2421 | 2429 |
2422 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 2430 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
2423 if (*category_group_enabled_) { | 2431 if (*category_group_enabled_) { |
2424 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, | 2432 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, |
2425 name_, event_handle_); | 2433 name_, event_handle_); |
2426 } | 2434 } |
2427 } | 2435 } |
2428 | 2436 |
2429 } // namespace trace_event_internal | 2437 } // namespace trace_event_internal |
OLD | NEW |