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

Unified Diff: tools/gn/trace.cc

Issue 2424233002: [gn] Add trace entries for loading and blocking on imports (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/trace.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/trace.cc
diff --git a/tools/gn/trace.cc b/tools/gn/trace.cc
index 2a1b460d56b11e856cbc121186a541b4439c35e7..74a3e71c03e73d8bcda5560ff93ad9868a97b839 100644
--- a/tools/gn/trace.cc
+++ b/tools/gn/trace.cc
@@ -170,6 +170,10 @@ void EnableTracing() {
trace_log = new TraceLog;
}
+bool TracingEnabled() {
+ return !!trace_log;
+}
+
void AddTrace(TraceItem* item) {
trace_log->Add(item);
}
@@ -203,6 +207,8 @@ std::string SummarizeTraces() {
case TraceItem::TRACE_CHECK_HEADER:
headers_checked++;
break;
+ case TraceItem::TRACE_IMPORT_LOAD:
+ case TraceItem::TRACE_IMPORT_BLOCK:
case TraceItem::TRACE_SETUP:
case TraceItem::TRACE_FILE_LOAD:
case TraceItem::TRACE_FILE_WRITE:
@@ -281,6 +287,12 @@ void SaveTraces(const base::FilePath& file_name) {
case TraceItem::TRACE_FILE_WRITE:
out << "\"file_write\"";
break;
+ case TraceItem::TRACE_IMPORT_LOAD:
+ out << "\"import_load\"";
+ break;
+ case TraceItem::TRACE_IMPORT_BLOCK:
+ out << "\"import_block\"";
+ break;
case TraceItem::TRACE_SCRIPT_EXECUTE:
out << "\"script_exec\"";
break;
« no previous file with comments | « tools/gn/trace.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698