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

Side by Side Diff: content/browser/tracing/tracing_controller_impl.h

Issue 717083003: Report trace buffer usage as number of events, not only percentage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 6 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
6 #define CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 6 #define CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 25 matching lines...) Expand all
36 const base::debug::TraceOptions& trace_options, 36 const base::debug::TraceOptions& trace_options,
37 const EnableMonitoringDoneCallback& callback) override; 37 const EnableMonitoringDoneCallback& callback) override;
38 bool DisableMonitoring( 38 bool DisableMonitoring(
39 const DisableMonitoringDoneCallback& callback) override; 39 const DisableMonitoringDoneCallback& callback) override;
40 void GetMonitoringStatus( 40 void GetMonitoringStatus(
41 bool* out_enabled, 41 bool* out_enabled,
42 base::debug::CategoryFilter* out_category_filter, 42 base::debug::CategoryFilter* out_category_filter,
43 base::debug::TraceOptions* out_trace_options) override; 43 base::debug::TraceOptions* out_trace_options) override;
44 bool CaptureMonitoringSnapshot( 44 bool CaptureMonitoringSnapshot(
45 const scoped_refptr<TraceDataSink>& sink) override; 45 const scoped_refptr<TraceDataSink>& sink) override;
46 bool GetTraceBufferPercentFull( 46 bool GetTraceBufferUsage(
47 const GetTraceBufferPercentFullCallback& callback) override; 47 const GetTraceBufferUsageCallback& callback) override;
48 bool SetWatchEvent(const std::string& category_name, 48 bool SetWatchEvent(const std::string& category_name,
49 const std::string& event_name, 49 const std::string& event_name,
50 const WatchEventCallback& callback) override; 50 const WatchEventCallback& callback) override;
51 bool CancelWatchEvent() override; 51 bool CancelWatchEvent() override;
52 52
53 void RegisterTracingUI(TracingUI* tracing_ui); 53 void RegisterTracingUI(TracingUI* tracing_ui);
54 void UnregisterTracingUI(TracingUI* tracing_ui); 54 void UnregisterTracingUI(TracingUI* tracing_ui);
55 55
56 private: 56 private:
57 typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterSet; 57 typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterSet;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 const std::vector<std::string>& known_category_groups); 109 const std::vector<std::string>& known_category_groups);
110 110
111 #if defined(OS_CHROMEOS) || defined(OS_WIN) 111 #if defined(OS_CHROMEOS) || defined(OS_WIN)
112 void OnEndSystemTracingAcked( 112 void OnEndSystemTracingAcked(
113 const scoped_refptr<base::RefCountedString>& events_str_ptr); 113 const scoped_refptr<base::RefCountedString>& events_str_ptr);
114 #endif 114 #endif
115 115
116 void OnCaptureMonitoringSnapshotAcked( 116 void OnCaptureMonitoringSnapshotAcked(
117 TraceMessageFilter* trace_message_filter); 117 TraceMessageFilter* trace_message_filter);
118 118
119 void OnTraceBufferPercentFullReply( 119 void OnTraceBufferUsageReply(TraceMessageFilter* trace_message_filter,
120 TraceMessageFilter* trace_message_filter, 120 float percent_full,
121 float percent_full); 121 size_t approximate_event_count);
122 122
123 void OnWatchEventMatched(); 123 void OnWatchEventMatched();
124 124
125 void SetEnabledOnFileThread( 125 void SetEnabledOnFileThread(
126 const base::debug::CategoryFilter& category_filter, 126 const base::debug::CategoryFilter& category_filter,
127 int mode, 127 int mode,
128 const base::debug::TraceOptions& trace_options, 128 const base::debug::TraceOptions& trace_options,
129 const base::Closure& callback); 129 const base::Closure& callback);
130 void SetDisabledOnFileThread(const base::Closure& callback); 130 void SetDisabledOnFileThread(const base::Closure& callback);
131 void OnEnableRecordingDone(const base::debug::CategoryFilter& category_filter, 131 void OnEnableRecordingDone(const base::debug::CategoryFilter& category_filter,
132 const base::debug::TraceOptions& trace_options, 132 const base::debug::TraceOptions& trace_options,
133 const EnableRecordingDoneCallback& callback); 133 const EnableRecordingDoneCallback& callback);
134 void OnDisableRecordingDone(); 134 void OnDisableRecordingDone();
135 void OnEnableMonitoringDone( 135 void OnEnableMonitoringDone(
136 const base::debug::CategoryFilter& category_filter, 136 const base::debug::CategoryFilter& category_filter,
137 const base::debug::TraceOptions& trace_options, 137 const base::debug::TraceOptions& trace_options,
138 const EnableMonitoringDoneCallback& callback); 138 const EnableMonitoringDoneCallback& callback);
139 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback); 139 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback);
140 140
141 void OnMonitoringStateChanged(bool is_monitoring); 141 void OnMonitoringStateChanged(bool is_monitoring);
142 142
143 TraceMessageFilterSet trace_message_filters_; 143 TraceMessageFilterSet trace_message_filters_;
144 144
145 // Pending acks for DisableRecording. 145 // Pending acks for DisableRecording.
146 int pending_disable_recording_ack_count_; 146 int pending_disable_recording_ack_count_;
147 TraceMessageFilterSet pending_disable_recording_filters_; 147 TraceMessageFilterSet pending_disable_recording_filters_;
148 // Pending acks for CaptureMonitoringSnapshot. 148 // Pending acks for CaptureMonitoringSnapshot.
149 int pending_capture_monitoring_snapshot_ack_count_; 149 int pending_capture_monitoring_snapshot_ack_count_;
150 TraceMessageFilterSet pending_capture_monitoring_filters_; 150 TraceMessageFilterSet pending_capture_monitoring_filters_;
151 // Pending acks for GetTraceBufferPercentFull. 151 // Pending acks for GetTraceBufferUsage.
152 int pending_trace_buffer_percent_full_ack_count_; 152 int pending_trace_buffer_percent_full_ack_count_;
alph 2014/11/14 10:59:31 s/percent_full/buffer_usage/
yurys 2014/11/14 13:03:47 Done.
153 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_; 153 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_;
alph 2014/11/14 10:59:30 ditto
yurys 2014/11/14 13:03:47 Done.
154 float maximum_trace_buffer_percent_full_; 154 float maximum_trace_buffer_percent_full_;
155 size_t approximate_event_count_;
155 156
156 #if defined(OS_CHROMEOS) || defined(OS_WIN) 157 #if defined(OS_CHROMEOS) || defined(OS_WIN)
157 bool is_system_tracing_; 158 bool is_system_tracing_;
158 #endif 159 #endif
159 bool is_recording_; 160 bool is_recording_;
160 bool is_monitoring_; 161 bool is_monitoring_;
161 base::debug::TraceOptions trace_options_; 162 base::debug::TraceOptions trace_options_;
162 163
163 GetCategoriesDoneCallback pending_get_categories_done_callback_; 164 GetCategoriesDoneCallback pending_get_categories_done_callback_;
164 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_; 165 GetTraceBufferUsageCallback pending_trace_buffer_percent_full_callback_;
alph 2014/11/14 10:59:31 ditto
yurys 2014/11/14 13:03:47 Done.
165 166
166 std::string watch_category_name_; 167 std::string watch_category_name_;
167 std::string watch_event_name_; 168 std::string watch_event_name_;
168 WatchEventCallback watch_event_callback_; 169 WatchEventCallback watch_event_callback_;
169 170
170 std::set<std::string> known_category_groups_; 171 std::set<std::string> known_category_groups_;
171 std::set<TracingUI*> tracing_uis_; 172 std::set<TracingUI*> tracing_uis_;
172 scoped_refptr<TraceDataSink> trace_data_sink_; 173 scoped_refptr<TraceDataSink> trace_data_sink_;
173 scoped_refptr<TraceDataSink> monitoring_data_sink_; 174 scoped_refptr<TraceDataSink> monitoring_data_sink_;
174 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); 175 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl);
175 }; 176 };
176 177
177 } // namespace content 178 } // namespace content
178 179
179 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 180 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698