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

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

Issue 277883002: Add cpu count to trace metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/debug/trace_event_unittest.cc » ('j') | 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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698