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 #include "tools/gn/trace.h" | 5 #include "tools/gn/trace.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <sstream> | 9 #include <sstream> |
10 #include <vector> | 10 #include <vector> |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 out << std::endl; | 213 out << std::endl; |
214 SummarizeFileExecs(file_execs, out); | 214 SummarizeFileExecs(file_execs, out); |
215 out << std::endl; | 215 out << std::endl; |
216 SummarizeScriptExecs(script_execs, out); | 216 SummarizeScriptExecs(script_execs, out); |
217 out << std::endl; | 217 out << std::endl; |
218 | 218 |
219 // Generally there will only be one header check, but it's theoretically | 219 // Generally there will only be one header check, but it's theoretically |
220 // possible for more than one to run if more than one build is going in | 220 // possible for more than one to run if more than one build is going in |
221 // parallel. Just report the total of all of them. | 221 // parallel. Just report the total of all of them. |
222 if (!check_headers.empty()) { | 222 if (!check_headers.empty()) { |
223 float check_headers_time = 0; | 223 double check_headers_time = 0; |
224 for (const auto& cur : check_headers) | 224 for (const auto& cur : check_headers) |
225 check_headers_time += cur->delta().InMillisecondsF(); | 225 check_headers_time += cur->delta().InMillisecondsF(); |
226 | 226 |
227 out << "Header check time: (total time in ms, files checked)\n"; | 227 out << "Header check time: (total time in ms, files checked)\n"; |
228 out << base::StringPrintf(" %8.2f %d\n", | 228 out << base::StringPrintf(" %8.2f %d\n", |
229 check_headers_time, headers_checked); | 229 check_headers_time, headers_checked); |
230 } | 230 } |
231 | 231 |
232 return out.str(); | 232 return out.str(); |
233 } | 233 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 out << "}"; | 313 out << "}"; |
314 } | 314 } |
315 | 315 |
316 out << "]}"; | 316 out << "]}"; |
317 | 317 |
318 std::string out_str = out.str(); | 318 std::string out_str = out.str(); |
319 base::WriteFile(file_name, out_str.data(), | 319 base::WriteFile(file_name, out_str.data(), |
320 static_cast<int>(out_str.size())); | 320 static_cast<int>(out_str.size())); |
321 } | 321 } |
OLD | NEW |