OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SHELL_TRACER_H_ | 5 #ifndef SHELL_TRACER_H_ |
6 #define SHELL_TRACER_H_ | 6 #define SHELL_TRACER_H_ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
15 #include "mojo/common/trace_provider_impl.h" | 15 #include "mojo/common/trace_provider_impl.h" |
16 #include "mojo/data_pipe_utils/data_pipe_drainer.h" | 16 #include "mojo/data_pipe_utils/data_pipe_drainer.h" |
17 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 17 #include "mojo/services/tracing/interfaces/tracing.mojom.h" |
18 | 18 |
19 namespace shell { | 19 namespace shell { |
20 | 20 |
21 // Tracer collects tracing data from base/trace_event and from externally | 21 // Tracer collects tracing data from base/trace_event and from externally |
22 // configured sources, aggregates it into a single stream, and writes it out to | 22 // configured sources, aggregates it into a single stream, and writes it out to |
23 // a file. It should be constructed very early in a process' lifetime before any | 23 // a file. It should be constructed very early in a process' lifetime before any |
24 // initialization that may be interesting to trace has occured and be shut down | 24 // initialization that may be interesting to trace has occured and be shut down |
25 // as late as possible to capture as much initialization/shutdown code as | 25 // as late as possible to capture as much initialization/shutdown code as |
26 // possible. | 26 // possible. |
27 class Tracer : public mojo::common::DataPipeDrainer::Client { | 27 class Tracer : public mojo::common::DataPipeDrainer::Client { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Trace file, if open. | 96 // Trace file, if open. |
97 FILE* trace_file_; | 97 FILE* trace_file_; |
98 std::string trace_filename_; | 98 std::string trace_filename_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(Tracer); | 100 DISALLOW_COPY_AND_ASSIGN(Tracer); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace shell | 103 } // namespace shell |
104 | 104 |
105 #endif // SHELL_TRACER_H_ | 105 #endif // SHELL_TRACER_H_ |
OLD | NEW |