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 TIME = "LONG" 12 TEST_CATEGORY = "Benchmark" 13 TEST_CLASS = "telemetry" 14 TEST_TYPE = "server" 15 16 DOC = """ 17 Run a pre-defined set of benchmarks on the DUT and create a sampled profile 18 of the chrome execution. The profile is generated in AFDO format. 19 See go/chromeos-toolchain and search for AFDO for more information about AFDO. 20 For now, this test can only run on devices that support LBR PMU events and 21 that have at lest 2GB of space in /tmp (autotest limitation). 22 23 Example invocation: 24 /usr/bin/test_that --debug --board=lumpy <DUT IP> 25 --args="ignore_failures=True local=True gs_test_location=True" 26 telemetry_AFDOGenerate 27 """ 28 29 args_dict = utils.args_to_dict(args) 30 31 profiler = 'custom_perf' 32 # These are arguments to the linux "perf" tool. 33 # The -e value is processor specific and comes from the Intel SDM vol 3b 34 profiler_args = 'record -a -e r20c4 -c 500000 -b ' 35 36 job.default_profile_only = True 37 job.profilers.add(profiler, profiler_args) 38 39 def run_telemetry_AFDOGenerate(machine): 40 run_host = hosts.create_host(machine) 41 42 # TODO (llozano): 43 # Pass "disable_sysinfo=True" to run_test since it would be nice 44 # to avoid copying all the logs back to the server. However, we 45 # cannot do this because of crosbug 308646 46 job.run_test('telemetry_AFDOGenerate', host=run_host, 47 args=args_dict) 48 49 job.parallel_simple(run_telemetry_AFDOGenerate, machines) 50 51 if profiler: 52 job.profilers.delete(profiler) 53