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

Side by Side Diff: include/libplatform/v8-tracing.h

Issue 2307163002: [Tracing] Expose trace serialization as part of tracing interface (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « BUILD.gn ('k') | src/libplatform/tracing/trace-serializer.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 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 <vector> 10 #include <vector>
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 std::unique_ptr<TraceBuffer> trace_buffer_; 240 std::unique_ptr<TraceBuffer> trace_buffer_;
241 std::unique_ptr<TraceConfig> trace_config_; 241 std::unique_ptr<TraceConfig> trace_config_;
242 Mode mode_ = DISABLED; 242 Mode mode_ = DISABLED;
243 243
244 // Disallow copy and assign 244 // Disallow copy and assign
245 TracingController(const TracingController&) = delete; 245 TracingController(const TracingController&) = delete;
246 void operator=(const TracingController&) = delete; 246 void operator=(const TracingController&) = delete;
247 }; 247 };
248 248
249 class TraceSerializer {
250 public:
251 explicit TraceSerializer(std::ostream& stream);
252 void WritePrefix();
253 void AppendTraceEvent(TraceObject* trace_event);
254 void WriteSuffix();
255
256 private:
257 void AppendArgValue(uint8_t type, TraceObject::ArgValue value);
258
259 std::ostream& stream_;
260 bool append_comma_ = false;
261 };
262
249 } // namespace tracing 263 } // namespace tracing
250 } // namespace platform 264 } // namespace platform
251 } // namespace v8 265 } // namespace v8
252 266
253 #endif // V8_LIBPLATFORM_V8_TRACING_H_ 267 #endif // V8_LIBPLATFORM_V8_TRACING_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/libplatform/tracing/trace-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698