1 # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 from autotest_lib.client.common_lib import utils 6 7 AUTHOR = "llozano (a] chromium.org c-compiler-chrome (a] google.com" 8 NAME = "telemetry_AFDOGenerate" 9 PURPOSE = "Produce profile (AFDO format) of normal browsing for optimization." 10 ATTRIBUTES = "suite:AFDO_record" 11 SUITE = "AFDO_record" 12 TIME = "LONG" 13 TEST_CATEGORY = "Benchmark" 14 TEST_CLASS = "telemetry" 15 TEST_TYPE = "server" 16 # The test uses gsutil to do upload, which is not supported in container. 17 REQUIRE_SSP = False 18 19 DOC = """ 20 Run a pre-defined set of benchmarks on the DUT and create a sampled profile 21 of the chrome execution. The profile is generated in AFDO format. 22 See go/afdo for more information about AFDO. 23 For now, this test is only designed to run on lumpy and parrot boards. 24 It will fail if run on other boards. 25 26 Example invocation: 27 /usr/bin/test_that --debug --board=lumpy <DUT IP> 28 --args="ignore_failures=True local=True gs_test_location=True" 29 telemetry_PGOGenerate 30 """ 31 32 args_dict = utils.args_to_dict(args) 33 34 profiler = 'custom_perf' 35 # These are arguments to the linux "perf" tool. 36 # The -e value is processor specific and comes from the Intel SDM vol 3b 37 profiler_args = 'record -a -e r20c4 -c 500000 -b ' 38 39 job.default_profile_only = True 40 job.profilers.add(profiler, profiler_args) 41 42 def run_telemetry_AFDOGenerate(machine): 43 run_host = hosts.create_host(machine) 44 45 # TODO (llozano): 46 # Pass "disable_sysinfo=True" to run_test since it would be nice 47 # to avoid copying all the logs back to the server. However, we 48 # cannot do this because of crosbug 308646 49 job.run_test('telemetry_AFDOGenerate', host=run_host, 50 args=args_dict) 51 52 job.parallel_simple(run_telemetry_AFDOGenerate, machines) 53 54 if profiler: 55 job.profilers.delete(profiler) 56