OLD | NEW |
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 TOOLS_GN_TRACE_H_ | 5 #ifndef TOOLS_GN_TRACE_H_ |
6 #define TOOLS_GN_TRACE_H_ | 6 #define TOOLS_GN_TRACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 | 15 |
16 class Label; | 16 class Label; |
17 | 17 |
18 class TraceItem { | 18 class TraceItem { |
19 public: | 19 public: |
20 enum Type { | 20 enum Type { |
21 TRACE_SETUP, | 21 TRACE_SETUP, |
22 TRACE_FILE_LOAD, | 22 TRACE_FILE_LOAD, |
23 TRACE_FILE_PARSE, | 23 TRACE_FILE_PARSE, |
24 TRACE_FILE_EXECUTE, | 24 TRACE_FILE_EXECUTE, |
25 TRACE_FILE_WRITE, | 25 TRACE_FILE_WRITE, |
26 TRACE_SCRIPT_EXECUTE, | 26 TRACE_SCRIPT_EXECUTE, |
27 TRACE_DEFINE_TARGET, | 27 TRACE_DEFINE_TARGET, |
| 28 TRACE_ON_RESOLVED, |
28 TRACE_CHECK_HEADER, // One file. | 29 TRACE_CHECK_HEADER, // One file. |
29 TRACE_CHECK_HEADERS, // All files. | 30 TRACE_CHECK_HEADERS, // All files. |
30 }; | 31 }; |
31 | 32 |
32 TraceItem(Type type, | 33 TraceItem(Type type, |
33 const std::string& name, | 34 const std::string& name, |
34 base::PlatformThreadId thread_id); | 35 base::PlatformThreadId thread_id); |
35 ~TraceItem(); | 36 ~TraceItem(); |
36 | 37 |
37 Type type() const { return type_; } | 38 Type type() const { return type_; } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void AddTrace(TraceItem* item); | 89 void AddTrace(TraceItem* item); |
89 | 90 |
90 // Returns a summary of the current traces, or the empty string if tracing is | 91 // Returns a summary of the current traces, or the empty string if tracing is |
91 // not enabled. | 92 // not enabled. |
92 std::string SummarizeTraces(); | 93 std::string SummarizeTraces(); |
93 | 94 |
94 // Saves the current traces to the given filename in JSON format. | 95 // Saves the current traces to the given filename in JSON format. |
95 void SaveTraces(const base::FilePath& file_name); | 96 void SaveTraces(const base::FilePath& file_name); |
96 | 97 |
97 #endif // TOOLS_GN_TRACE_H_ | 98 #endif // TOOLS_GN_TRACE_H_ |
OLD | NEW |