summaryrefslogtreecommitdiffstats
path: root/src/parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.cc')
-rw-r--r--src/parser.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser.cc b/src/parser.cc
index 5f303c5..139a347 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -20,7 +20,10 @@
using namespace std;
bool Parser::Load(const string& filename, string* err, Lexer* parent) {
- METRIC_RECORD(".ninja parse");
+ // If |parent| is not NULL, metrics collection has been started by a parent
+ // Parser::Load() in our call stack. Do not start a new one here to avoid
+ // over-counting parsing times.
+ METRIC_RECORD_IF(".ninja parse", parent == NULL);
string contents;
string read_err;
if (file_reader_->ReadFile(filename, &contents, &read_err) !=