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
5from autotest_lib.client.common_lib import utils
6
7AUTHOR = "llozano@chromium.org c-compiler-chrome@google.com"
8NAME = "telemetry_AFDOGenerate"
9PURPOSE = "Produce profile (AFDO format) of normal browsing for optimization."
10ATTRIBUTES = "suite:AFDO_record"
11TIME = "LONG"
12MAX_RESULT_SIZE_KB = 512000
13TEST_CATEGORY = "Benchmark"
14TEST_CLASS = "telemetry"
15TEST_TYPE = "server"
16
17DOC = """
18Run a pre-defined set of benchmarks on the DUT and create a sampled profile
19of the chrome execution. The profile is generated in AFDO format.
20See go/chromeos-toolchain and search for AFDO for more information about AFDO.
21For now, this test can only run on devices that support LBR PMU events and
22that have at lest 2GB of space in /tmp (autotest limitation).
23
24Example invocation:
25/usr/bin/test_that --debug --board=lumpy <DUT IP>
26  --args="ignore_failures=True local=True gs_test_location=True"
27  telemetry_AFDOGenerate
28"""
29
30args_dict = utils.args_to_dict(args)
31
32
33def run_telemetry_AFDOGenerate(machine):
34    run_host = hosts.create_host(machine)
35
36    # TODO (llozano):
37    # Pass "disable_sysinfo=True" to run_test since it would be nice
38    # to avoid copying all the logs back to the server. However, we
39    # cannot do this because of crosbug 308646
40    job.run_test('telemetry_AFDOGenerate', host=run_host, args=args_dict)
41
42
43job.parallel_simple(run_telemetry_AFDOGenerate, machines)
44