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

Side by Side Diff: tools/gn/trace.cc

Issue 644433003: Type conversion fixes, tools/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « tools/gn/generate_test_gn_data.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/gn/generate_test_gn_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698