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

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

Issue 18587004: Add a sampling tracing to RenderWidget::DoDeferredUpdate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/debug/trace_event.h ('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 25 matching lines...) Expand all
36 public: 36 public:
37 static void Delete() { 37 static void Delete() {
38 Singleton<base::debug::TraceLog, 38 Singleton<base::debug::TraceLog,
39 StaticMemorySingletonTraits<base::debug::TraceLog> >::OnExit(0); 39 StaticMemorySingletonTraits<base::debug::TraceLog> >::OnExit(0);
40 } 40 }
41 }; 41 };
42 42
43 // Not supported in split-dll build. http://crbug.com/237249 43 // Not supported in split-dll build. http://crbug.com/237249
44 #if !defined(CHROME_SPLIT_DLL) 44 #if !defined(CHROME_SPLIT_DLL)
45 // The thread buckets for the sampling profiler. 45 // The thread buckets for the sampling profiler.
46 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state0; 46 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state[3];
47 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state1;
48 BASE_EXPORT TRACE_EVENT_API_ATOMIC_WORD g_trace_state2;
49 #endif 47 #endif
50 48
51 namespace base { 49 namespace base {
52 namespace debug { 50 namespace debug {
53 51
54 // Controls the number of trace events we will buffer in-memory 52 // Controls the number of trace events we will buffer in-memory
55 // before throwing them away. 53 // before throwing them away.
56 const size_t kTraceEventBufferSize = 500000; 54 const size_t kTraceEventBufferSize = 500000;
57 const size_t kTraceEventBatchSize = 1000; 55 const size_t kTraceEventBatchSize = 1000;
58 const size_t kTraceEventInitialBufferSize = 1024; 56 const size_t kTraceEventInitialBufferSize = 1024;
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 num_traces_recorded_++; 939 num_traces_recorded_++;
942 940
943 category_filter_ = CategoryFilter(category_filter); 941 category_filter_ = CategoryFilter(category_filter);
944 EnableIncludedCategoryGroups(); 942 EnableIncludedCategoryGroups();
945 943
946 // Not supported in split-dll build. http://crbug.com/237249 944 // Not supported in split-dll build. http://crbug.com/237249
947 #if !defined(CHROME_SPLIT_DLL) 945 #if !defined(CHROME_SPLIT_DLL)
948 if (options & ENABLE_SAMPLING) { 946 if (options & ENABLE_SAMPLING) {
949 sampling_thread_.reset(new TraceSamplingThread); 947 sampling_thread_.reset(new TraceSamplingThread);
950 sampling_thread_->RegisterSampleBucket( 948 sampling_thread_->RegisterSampleBucket(
951 &g_trace_state0, 949 &g_trace_state[0],
952 "bucket0", 950 "bucket0",
953 Bind(&TraceSamplingThread::DefaultSampleCallback)); 951 Bind(&TraceSamplingThread::DefaultSampleCallback));
954 sampling_thread_->RegisterSampleBucket( 952 sampling_thread_->RegisterSampleBucket(
955 &g_trace_state1, 953 &g_trace_state[1],
956 "bucket1", 954 "bucket1",
957 Bind(&TraceSamplingThread::DefaultSampleCallback)); 955 Bind(&TraceSamplingThread::DefaultSampleCallback));
958 sampling_thread_->RegisterSampleBucket( 956 sampling_thread_->RegisterSampleBucket(
959 &g_trace_state2, 957 &g_trace_state[2],
960 "bucket2", 958 "bucket2",
961 Bind(&TraceSamplingThread::DefaultSampleCallback)); 959 Bind(&TraceSamplingThread::DefaultSampleCallback));
962 if (!PlatformThread::Create( 960 if (!PlatformThread::Create(
963 0, sampling_thread_.get(), &sampling_thread_handle_)) { 961 0, sampling_thread_.get(), &sampling_thread_handle_)) {
964 DCHECK(false) << "failed to create thread"; 962 DCHECK(false) << "failed to create thread";
965 } 963 }
966 } 964 }
967 #endif 965 #endif
968 966
969 dispatching_to_observer_list_ = true; 967 dispatching_to_observer_list_ = true;
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 0, // num_args 1547 0, // num_args
1550 NULL, // arg_names 1548 NULL, // arg_names
1551 NULL, // arg_types 1549 NULL, // arg_types
1552 NULL, // arg_values 1550 NULL, // arg_values
1553 NULL, // convertable values 1551 NULL, // convertable values
1554 TRACE_EVENT_FLAG_NONE); // flags 1552 TRACE_EVENT_FLAG_NONE); // flags
1555 } 1553 }
1556 } 1554 }
1557 1555
1558 } // namespace trace_event_internal 1556 } // namespace trace_event_internal
OLDNEW
« no previous file with comments | « base/debug/trace_event.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698