| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/test/ui/ui_perf_test.h" | 5 #include "chrome/test/ui/ui_perf_test.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
| 10 #include "chrome/test/chrome_process_util.h" | 10 #include "chrome/test/chrome_process_util.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // <*>RESULT <graph_name>: <trace_name>= <value> <units> | 60 // <*>RESULT <graph_name>: <trace_name>= <value> <units> |
| 61 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> | 61 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> |
| 62 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> | 62 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> |
| 63 printf("%sRESULT %s%s: %s= %s%s%s %s\n", | 63 printf("%sRESULT %s%s: %s= %s%s%s %s\n", |
| 64 important ? "*" : "", measurement.c_str(), modifier.c_str(), | 64 important ? "*" : "", measurement.c_str(), modifier.c_str(), |
| 65 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), | 65 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), |
| 66 units.c_str()); | 66 units.c_str()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void UIPerfTest::PrintIOPerfInfo(const char* test_name) { | 69 void UIPerfTest::PrintIOPerfInfo(const char* test_name) { |
| 70 ChromeProcessList chrome_processes(GetRunningChromeProcesses(process_id_)); | 70 ChromeProcessList chrome_processes( |
| 71 GetRunningChromeProcesses(browser_process_id())); |
| 71 | 72 |
| 72 size_t read_op_b = 0; | 73 size_t read_op_b = 0; |
| 73 size_t read_op_r = 0; | 74 size_t read_op_r = 0; |
| 74 size_t write_op_b = 0; | 75 size_t write_op_b = 0; |
| 75 size_t write_op_r = 0; | 76 size_t write_op_r = 0; |
| 76 size_t other_op_b = 0; | 77 size_t other_op_b = 0; |
| 77 size_t other_op_r = 0; | 78 size_t other_op_r = 0; |
| 78 size_t total_op_b = 0; | 79 size_t total_op_b = 0; |
| 79 size_t total_op_r = 0; | 80 size_t total_op_r = 0; |
| 80 | 81 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 PrintResult("other_op_r", "", "o_op_r" + t_name, other_op_r, "", false); | 167 PrintResult("other_op_r", "", "o_op_r" + t_name, other_op_r, "", false); |
| 167 PrintResult("total_op_r", "", "IO_op_r" + t_name, total_op_r, "", true); | 168 PrintResult("total_op_r", "", "IO_op_r" + t_name, total_op_r, "", true); |
| 168 | 169 |
| 169 PrintResult("read_byte_r", "", "r_r" + t_name, read_byte_r, "kb", false); | 170 PrintResult("read_byte_r", "", "r_r" + t_name, read_byte_r, "kb", false); |
| 170 PrintResult("write_byte_r", "", "w_r" + t_name, write_byte_r, "kb", false); | 171 PrintResult("write_byte_r", "", "w_r" + t_name, write_byte_r, "kb", false); |
| 171 PrintResult("other_byte_r", "", "o_r" + t_name, other_byte_r, "kb", false); | 172 PrintResult("other_byte_r", "", "o_r" + t_name, other_byte_r, "kb", false); |
| 172 PrintResult("total_byte_r", "", "IO_r" + t_name, total_byte_r, "kb", true); | 173 PrintResult("total_byte_r", "", "IO_r" + t_name, total_byte_r, "kb", true); |
| 173 } | 174 } |
| 174 | 175 |
| 175 void UIPerfTest::PrintMemoryUsageInfo(const char* test_name) { | 176 void UIPerfTest::PrintMemoryUsageInfo(const char* test_name) { |
| 176 ChromeProcessList chrome_processes(GetRunningChromeProcesses(process_id_)); | 177 ChromeProcessList chrome_processes( |
| 178 GetRunningChromeProcesses(browser_process_id())); |
| 177 | 179 |
| 178 size_t browser_virtual_size = 0; | 180 size_t browser_virtual_size = 0; |
| 179 size_t browser_working_set_size = 0; | 181 size_t browser_working_set_size = 0; |
| 180 size_t renderer_virtual_size = 0; | 182 size_t renderer_virtual_size = 0; |
| 181 size_t renderer_working_set_size = 0; | 183 size_t renderer_working_set_size = 0; |
| 182 size_t total_virtual_size = 0; | 184 size_t total_virtual_size = 0; |
| 183 size_t total_working_set_size = 0; | 185 size_t total_working_set_size = 0; |
| 184 #if defined(OS_WIN) | 186 #if defined(OS_WIN) |
| 185 size_t browser_peak_virtual_size = 0; | 187 size_t browser_peak_virtual_size = 0; |
| 186 size_t browser_peak_working_set_size = 0; | 188 size_t browser_peak_working_set_size = 0; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 dir = dir.AppendASCII("reference_build"); | 319 dir = dir.AppendASCII("reference_build"); |
| 318 #if defined(OS_WIN) | 320 #if defined(OS_WIN) |
| 319 dir = dir.AppendASCII("chrome"); | 321 dir = dir.AppendASCII("chrome"); |
| 320 #elif defined(OS_LINUX) | 322 #elif defined(OS_LINUX) |
| 321 dir = dir.AppendASCII("chrome_linux"); | 323 dir = dir.AppendASCII("chrome_linux"); |
| 322 #elif defined(OS_MACOSX) | 324 #elif defined(OS_MACOSX) |
| 323 dir = dir.AppendASCII("chrome_mac"); | 325 dir = dir.AppendASCII("chrome_mac"); |
| 324 #endif | 326 #endif |
| 325 SetBrowserDirectory(dir); | 327 SetBrowserDirectory(dir); |
| 326 } | 328 } |
| OLD | NEW |