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

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

Issue 11438022: Add ability to retrieve a thread_name given a thread_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the try servers happier. Created 7 years, 11 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 | « base/base.gypi ('k') | 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/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/leak_annotations.h" 10 #include "base/debug/leak_annotations.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 "tracing categories exhausted; must increase TRACE_EVENT_MAX_CATEGORIES", 58 "tracing categories exhausted; must increase TRACE_EVENT_MAX_CATEGORIES",
59 "__metadata", 59 "__metadata",
60 }; 60 };
61 // The enabled flag is char instead of bool so that the API can be used from C. 61 // The enabled flag is char instead of bool so that the API can be used from C.
62 unsigned char g_category_enabled[TRACE_EVENT_MAX_CATEGORIES] = { 0 }; 62 unsigned char g_category_enabled[TRACE_EVENT_MAX_CATEGORIES] = { 0 };
63 const int g_category_already_shutdown = 0; 63 const int g_category_already_shutdown = 0;
64 const int g_category_categories_exhausted = 1; 64 const int g_category_categories_exhausted = 1;
65 const int g_category_metadata = 2; 65 const int g_category_metadata = 2;
66 int g_category_index = 3; // skip initial 3 categories 66 int g_category_index = 3; // skip initial 3 categories
67 67
68 // The most-recently captured name of the current thread 68 // The name of the current thread. This is used to decide if the current
69 // thread name has changed. We combine all the seen thread names into the
70 // output name for the thread.
69 LazyInstance<ThreadLocalPointer<const char> >::Leaky 71 LazyInstance<ThreadLocalPointer<const char> >::Leaky
70 g_current_thread_name = LAZY_INSTANCE_INITIALIZER; 72 g_current_thread_name = LAZY_INSTANCE_INITIALIZER;
71 73
72 } // namespace 74 } // namespace
73 75
74 //////////////////////////////////////////////////////////////////////////////// 76 ////////////////////////////////////////////////////////////////////////////////
75 // 77 //
76 // TraceEvent 78 // TraceEvent
77 // 79 //
78 //////////////////////////////////////////////////////////////////////////////// 80 ////////////////////////////////////////////////////////////////////////////////
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 unsigned long long pid = static_cast<unsigned long long>(process_id_); 793 unsigned long long pid = static_cast<unsigned long long>(process_id_);
792 process_id_hash_ = (offset_basis ^ pid) * fnv_prime; 794 process_id_hash_ = (offset_basis ^ pid) * fnv_prime;
793 } 795 }
794 796
795 void TraceLog::SetTimeOffset(TimeDelta offset) { 797 void TraceLog::SetTimeOffset(TimeDelta offset) {
796 time_offset_ = offset; 798 time_offset_ = offset;
797 } 799 }
798 800
799 } // namespace debug 801 } // namespace debug
800 } // namespace base 802 } // namespace base
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698