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

Side by Side Diff: apps/benchmark/run_args.cc

Issue 1347063002: Teach `benchmark.mojo` to save the collected trace file to disk. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 | « apps/benchmark/run_args.h ('k') | mojo/devtools/common/mojo_benchmark » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "apps/benchmark/run_args.h" 5 #include "apps/benchmark/run_args.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return false; 61 return false;
62 } 62 }
63 int duration_int; 63 int duration_int;
64 if (!base::StringToInt(duration_str, &duration_int) || duration_int <= 0) { 64 if (!base::StringToInt(duration_str, &duration_int) || duration_int <= 0) {
65 LOG(ERROR) << "Could not parse the --duration value as a positive integer: " 65 LOG(ERROR) << "Could not parse the --duration value as a positive integer: "
66 << duration_str; 66 << duration_str;
67 return false; 67 return false;
68 } 68 }
69 result->duration = base::TimeDelta::FromSeconds(duration_int); 69 result->duration = base::TimeDelta::FromSeconds(duration_int);
70 70
71 result->write_output_file = false;
72 if (command_line.HasSwitch("trace-output")) {
73 result->write_output_file = true;
74 result->output_file_path =
75 base::FilePath(command_line.GetSwitchValueASCII("trace-output"));
76 }
77
71 // All regular arguments (not switches, ie. not preceded by "--") describe 78 // All regular arguments (not switches, ie. not preceded by "--") describe
72 // measurements. 79 // measurements.
73 for (const std::string& measurement_spec : command_line.GetArgs()) { 80 for (const std::string& measurement_spec : command_line.GetArgs()) {
74 Measurement measurement; 81 Measurement measurement;
75 if (!GetMeasurement(measurement_spec, &measurement)) { 82 if (!GetMeasurement(measurement_spec, &measurement)) {
76 return false; 83 return false;
77 } 84 }
78 result->measurements.push_back(measurement); 85 result->measurements.push_back(measurement);
79 } 86 }
80 87
81 return true; 88 return true;
82 } 89 }
83 90
84 } // namespace benchmark 91 } // namespace benchmark
OLDNEW
« no previous file with comments | « apps/benchmark/run_args.h ('k') | mojo/devtools/common/mojo_benchmark » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698