| 321 | } |
| 322 | |
| 323 | void Timeline::OutputTimeline() { |
| 324 | string outfile = strings::Printf("%s_%lld", outfile_.c_str(), step()); |
| 325 | Status s = |
| 326 | WriteStringToFile(Env::Default(), outfile, chrome_formatter_.Format()); |
| 327 | if (!s.ok()) { |
| 328 | fprintf(stderr, "Failed to write timeline file: %s\nError: %s\n", |
| 329 | outfile.c_str(), s.ToString().c_str()); |
| 330 | return; |
| 331 | } |
| 332 | fprintf(stdout, "\n******************************************************\n"); |
| 333 | fprintf(stdout, |
| 334 | "Timeline file is written to %s.\n" |
| 335 | "Open a Chrome browser, enter URL chrome://tracing and " |
| 336 | "load the timeline file.", |
| 337 | outfile.c_str()); |
| 338 | fprintf(stdout, "\n******************************************************\n"); |
| 339 | fflush(stdout); |
| 340 | } |
| 341 | |
| 342 | void Timeline::AllocateLanes() { |
| 343 | for (auto& process : tnodes_) { |