Chromium Code Reviews| Index: scripts/slave/runtest.py |
| =================================================================== |
| --- scripts/slave/runtest.py (revision 147800) |
| +++ scripts/slave/runtest.py (working copy) |
| @@ -303,6 +303,44 @@ |
| print '@@@STEP_TEXT@%s@@@' % desc |
| +def upload_profiling_data(options): |
| + """Using the target build configuration, archive the profiling data to Google |
| + Storage. |
| + """ |
| + build_dir = os.path.normpath(os.path.abspath(options.build_dir)) |
| + |
| + # Profiling data is in /b/build/slave/SLAVE_NAME/build/src/chrome/test/data |
| + profiling_data_dir = os.path.join(build_dir, 'src', 'chrome', 'test', 'data') |
| + if not os.path.exists(profiling_data_dir): |
| + return True |
| + |
| + profiling_file = os.path.join(profiling_data_dir, 'task_profile.json') |
| + if not os.path.exists(profiling_file): |
| + return True |
| + |
| + # Profiling tool is in |
| + # /b/build/slave/SLAVE_NAME/build/src/build/scripts/slave/chromium |
| + profiling_archive_tool = os.path.join(build_dir, 'src', 'build', 'scripts', |
| + 'slave', 'chromium', |
| + 'archive_profiling_data.py') |
|
cmp
2012/08/07 18:15:08
is it possible to collapse this logic into archive
ramant (doing other things)
2012/08/07 22:23:55
Done. Should we move the archive_profiling_data.py
cmp
2012/08/07 23:34:39
Sure!
ramant (doing other things)
2012/08/07 23:44:44
Done.
|
| + |
| + if sys.platform == 'win32': |
| + python = 'python_slave' |
| + else: |
| + python = 'python' |
| + |
| + # TODO(rtenneti): get test name. |
| + run_id = '%s_%s_%s' % (options.build_properties['got_revision'], |
| + options.build_properties['buildername'], |
| + options.gtest_filter[0:12]) |
| + cmd = [python, |
| + profiling_archive_tool, |
| + '--run-id', run_id, |
| + '--profiling-data-dir', profiling_data_dir] |
| + |
| + return chromium_utils.RunCommand(cmd) |
| + |
| + |
| def main_mac(options, args): |
| if len(args) < 1: |
| raise chromium_utils.MissingArgument('Usage: %s' % USAGE) |
| @@ -703,6 +741,12 @@ |
| sys.stderr.write('Unknown sys.platform value %s\n' % repr(sys.platform)) |
| return 1 |
| + if ('buildername' in options.build_properties and |
| + options.build_properties['buildername'] == 'XP Perf (1)' and |
|
cmp
2012/08/07 18:15:08
let's collapse lines 744 and 745 into:
if (option
ramant (doing other things)
2012/08/07 22:23:55
Done.
|
| + options.build_properties.get('mastername') == 'chromium.perf' and |
| + options.gtest_filter == 'StartupTest.*:ShutdownTest.*'): |
| + upload_profiling_data(options) |
| + |
| new_temp_files = get_temp_count() |
| if temp_files > new_temp_files: |
| print >> sys.stderr, ( |