OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 V8_LIBPLATFORM_V8_TRACING_H_ | 5 #ifndef V8_LIBPLATFORM_V8_TRACING_H_ |
6 #define V8_LIBPLATFORM_V8_TRACING_H_ | 6 #define V8_LIBPLATFORM_V8_TRACING_H_ |
7 | 7 |
8 #include <fstream> | 8 #include <fstream> |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Echo to console. Events are discarded. | 178 // Echo to console. Events are discarded. |
179 ECHO_TO_CONSOLE, | 179 ECHO_TO_CONSOLE, |
180 }; | 180 }; |
181 | 181 |
182 class V8_PLATFORM_EXPORT TraceConfig { | 182 class V8_PLATFORM_EXPORT TraceConfig { |
183 public: | 183 public: |
184 typedef std::vector<std::string> StringList; | 184 typedef std::vector<std::string> StringList; |
185 | 185 |
186 static TraceConfig* CreateDefaultTraceConfig(); | 186 static TraceConfig* CreateDefaultTraceConfig(); |
187 | 187 |
188 TraceConfig() | 188 TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {} |
189 : enable_sampling_(false), | |
190 enable_systrace_(false), | |
191 enable_argument_filter_(false) {} | |
192 TraceRecordMode GetTraceRecordMode() const { return record_mode_; } | 189 TraceRecordMode GetTraceRecordMode() const { return record_mode_; } |
193 bool IsSamplingEnabled() const { return enable_sampling_; } | |
194 bool IsSystraceEnabled() const { return enable_systrace_; } | 190 bool IsSystraceEnabled() const { return enable_systrace_; } |
195 bool IsArgumentFilterEnabled() const { return enable_argument_filter_; } | 191 bool IsArgumentFilterEnabled() const { return enable_argument_filter_; } |
196 | 192 |
197 void SetTraceRecordMode(TraceRecordMode mode) { record_mode_ = mode; } | 193 void SetTraceRecordMode(TraceRecordMode mode) { record_mode_ = mode; } |
198 void EnableSampling() { enable_sampling_ = true; } | |
199 void EnableSystrace() { enable_systrace_ = true; } | 194 void EnableSystrace() { enable_systrace_ = true; } |
200 void EnableArgumentFilter() { enable_argument_filter_ = true; } | 195 void EnableArgumentFilter() { enable_argument_filter_ = true; } |
201 | 196 |
202 void AddIncludedCategory(const char* included_category); | 197 void AddIncludedCategory(const char* included_category); |
203 void AddExcludedCategory(const char* excluded_category); | 198 void AddExcludedCategory(const char* excluded_category); |
204 | 199 |
205 bool IsCategoryGroupEnabled(const char* category_group) const; | 200 bool IsCategoryGroupEnabled(const char* category_group) const; |
206 | 201 |
207 private: | 202 private: |
208 TraceRecordMode record_mode_; | 203 TraceRecordMode record_mode_; |
209 bool enable_sampling_ : 1; | |
210 bool enable_systrace_ : 1; | 204 bool enable_systrace_ : 1; |
211 bool enable_argument_filter_ : 1; | 205 bool enable_argument_filter_ : 1; |
212 StringList included_categories_; | 206 StringList included_categories_; |
213 StringList excluded_categories_; | 207 StringList excluded_categories_; |
214 | 208 |
215 // Disallow copy and assign | 209 // Disallow copy and assign |
216 TraceConfig(const TraceConfig&) = delete; | 210 TraceConfig(const TraceConfig&) = delete; |
217 void operator=(const TraceConfig&) = delete; | 211 void operator=(const TraceConfig&) = delete; |
218 }; | 212 }; |
219 | 213 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Disallow copy and assign | 263 // Disallow copy and assign |
270 TracingController(const TracingController&) = delete; | 264 TracingController(const TracingController&) = delete; |
271 void operator=(const TracingController&) = delete; | 265 void operator=(const TracingController&) = delete; |
272 }; | 266 }; |
273 | 267 |
274 } // namespace tracing | 268 } // namespace tracing |
275 } // namespace platform | 269 } // namespace platform |
276 } // namespace v8 | 270 } // namespace v8 |
277 | 271 |
278 #endif // V8_LIBPLATFORM_V8_TRACING_H_ | 272 #endif // V8_LIBPLATFORM_V8_TRACING_H_ |
OLD | NEW |