| Index: chrome/test/perf/perf_test.cc
|
| diff --git a/chrome/test/perf/perf_test.cc b/chrome/test/perf/perf_test.cc
|
| index ae887649f3f04fbe96dd9b3bb817e9f829ee23fe..d9c655658c981c8ef577602b681a6c1c977ed67d 100644
|
| --- a/chrome/test/perf/perf_test.cc
|
| +++ b/chrome/test/perf/perf_test.cc
|
| @@ -10,152 +10,10 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "chrome/test/base/chrome_process_util.h"
|
| -
|
| -namespace {
|
| -
|
| -std::string ResultsToString(const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& values,
|
| - const std::string& prefix,
|
| - const std::string& suffix,
|
| - const std::string& units,
|
| - bool important) {
|
| - // <*>RESULT <graph_name>: <trace_name>= <value> <units>
|
| - // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units>
|
| - // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units>
|
| - return base::StringPrintf("%sRESULT %s%s: %s= %s%s%s %s\n",
|
| - important ? "*" : "", measurement.c_str(), modifier.c_str(),
|
| - trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(),
|
| - units.c_str());
|
| -}
|
| -
|
| -void PrintResultsImpl(const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& values,
|
| - const std::string& prefix,
|
| - const std::string& suffix,
|
| - const std::string& units,
|
| - bool important) {
|
| - fflush(stdout);
|
| - printf("%s", ResultsToString(measurement, modifier, trace, values,
|
| - prefix, suffix, units, important).c_str());
|
| - fflush(stdout);
|
| -}
|
| -
|
| -} // namespace
|
| +#include "testing/perf/perf_test.h"
|
|
|
| namespace perf_test {
|
|
|
| -void PrintResult(const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - size_t value,
|
| - const std::string& units,
|
| - bool important) {
|
| - PrintResultsImpl(measurement,
|
| - modifier,
|
| - trace,
|
| - base::UintToString(value),
|
| - std::string(),
|
| - std::string(),
|
| - units,
|
| - important);
|
| -}
|
| -
|
| -void AppendResult(std::string& output,
|
| - const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - size_t value,
|
| - const std::string& units,
|
| - bool important) {
|
| - output += ResultsToString(measurement,
|
| - modifier,
|
| - trace,
|
| - base::UintToString(value),
|
| - std::string(),
|
| - std::string(),
|
| - units,
|
| - important);
|
| -}
|
| -
|
| -void PrintResult(const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& value,
|
| - const std::string& units,
|
| - bool important) {
|
| - PrintResultsImpl(measurement,
|
| - modifier,
|
| - trace,
|
| - value,
|
| - std::string(),
|
| - std::string(),
|
| - units,
|
| - important);
|
| -}
|
| -
|
| -void AppendResult(std::string& output,
|
| - const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& value,
|
| - const std::string& units,
|
| - bool important) {
|
| - output += ResultsToString(measurement,
|
| - modifier,
|
| - trace,
|
| - value,
|
| - std::string(),
|
| - std::string(),
|
| - units,
|
| - important);
|
| -}
|
| -
|
| -void PrintResultMeanAndError(const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& mean_and_error,
|
| - const std::string& units,
|
| - bool important) {
|
| - PrintResultsImpl(measurement, modifier, trace, mean_and_error,
|
| - "{", "}", units, important);
|
| -}
|
| -
|
| -void AppendResultMeanAndError(std::string& output,
|
| - const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& mean_and_error,
|
| - const std::string& units,
|
| - bool important) {
|
| - output += ResultsToString(measurement, modifier, trace, mean_and_error,
|
| - "{", "}", units, important);
|
| -}
|
| -
|
| -void PrintResultList(const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& values,
|
| - const std::string& units,
|
| - bool important) {
|
| - PrintResultsImpl(measurement, modifier, trace, values,
|
| - "[", "]", units, important);
|
| -}
|
| -
|
| -void AppendResultList(std::string& output,
|
| - const std::string& measurement,
|
| - const std::string& modifier,
|
| - const std::string& trace,
|
| - const std::string& values,
|
| - const std::string& units,
|
| - bool important) {
|
| - output += ResultsToString(measurement, modifier, trace, values,
|
| - "[", "]", units, important);
|
| -}
|
| -
|
| void PrintIOPerfInfo(const std::string& test_name,
|
| const ChromeProcessList& chrome_processes,
|
| base::ProcessId browser_pid) {
|
| @@ -551,33 +409,4 @@ std::string MemoryUsageInfoToString(const std::string& test_name,
|
| return output;
|
| }
|
|
|
| -void PrintSystemCommitCharge(const std::string& test_name,
|
| - size_t charge,
|
| - bool important) {
|
| - PrintSystemCommitCharge(stdout, test_name, charge, important);
|
| -}
|
| -
|
| -void PrintSystemCommitCharge(FILE* target,
|
| - const std::string& test_name,
|
| - size_t charge,
|
| - bool important) {
|
| - fprintf(target, "%s", SystemCommitChargeToString(test_name, charge,
|
| - important).c_str());
|
| -}
|
| -
|
| -std::string SystemCommitChargeToString(const std::string& test_name,
|
| - size_t charge,
|
| - bool important) {
|
| - std::string trace_name(test_name);
|
| - std::string output;
|
| - AppendResult(output,
|
| - "commit_charge",
|
| - std::string(),
|
| - "cc" + trace_name,
|
| - charge,
|
| - "kb",
|
| - important);
|
| - return output;
|
| -}
|
| -
|
| } // namespace perf_test
|
|
|