Tool get_device_info

Tool get_device_info is used to collect either machine-info, software-config or trace-result proto buffers that are ready for uploading to the trace-result database. We'll look at all three scenarios in details below. However, you should look to tool Harvest to collect machine-info and software-config data from connected devices and automatically upload the result to the trace-result DB.

This document makes reference to trace-result DB protobufs. The definitions for these protobufs are found at https://chromium.googlesource.com/chromiumos/config/+/HEAD/go/api/test/results

Collecting machine information

  1. Copy the get_device_info to the Chrome-OS device:
    -> scp get_device_info <cros-device-IP>
    
  2. On the Chrome-OS device, in the shell:
    -> get_device_info machine-info -owner user/gwink > machine-info.pb
    -> cat machine-info.pb
    {
      "name": {
        "value": "b9ecaf8a-3bfd-411e-8240-89354a796065"
      },
      "createTime": "2020-10-27T23:57:20Z",
      "owner": "user/gwink",
      "hwid": "HELIOS-YVRQ C5B-A4E-C4V-42Q-A3L"
    }
    
  3. Copy the protobuf back to your workstation for uploading to the DB.

Note: Tool Harvest automates all these steps for any connected DUT. It will also assign a more readable and consistent machine name than the UUID shown above. It is highly recommended to Harvest instead of running get_device_info directly.

Collecting software configuration

Use the same steps as above, but in step 2, collect the software-info instead:

-> get_device_info software-info -skip-packages > software-config.pb
-> cat software-config.pb
{
"id": {
 "value": "8caff65e-b70b-46ee-ab21-f52e16e58d88"
},
"createTime": "2020-10-28T00:08:44Z",
"kernelRelease": "4.19.152",
"kernelVersion": "#3 SMP PREEMPT Wed Oct 21 18:14:32 MDT 2020",
"chromeos": {
 "board": "hatch-borealis",
 "buildNumber": 13545,
 "buildType": "Test Build - gwink",
 "chromeMilestone": 88,
 "description": "13545.0.2020_10_21_2021 (Test Build - gwink) developer-build hatch-borealis",
 "keyset": "devkeys",
 "name": "Chromium OS",
 "patchNumber": "2020_10_21_2021",
 "track": "testimage-channel",
 "version": "13545.0.2020_10_21_2021"
},
"os": {
 "buildId": "13545.0.2020_10_21_2021",
 "id": "chromeos",
 "name": "Chrome OS",
 "versionId": "88",
 "version": "88"
},
"biosVersion": "Google_Helios.12672.117.0",
"ecVersion": "0x44"
}

Notes:

  1. You can also run get_device_info to collect software config on guest devices such as Crostini or Steam VM.
  2. Again, you should use tool Harvest to collect software-configurations from connected DUTs. It automates all the steps. When pointed at a guest device, Harvest will automatically collect software-config from the guest and the host.

Collecting trace results

This last use of get_device_info runs on your workstation. It is designed to process trace-profiles generated by tool Harvest into protobufs ready to be uploaded to the trace-result DB.

First, you need to know that Harvest appends extra data the profile generated by ApiTrace. For instance, the output of a simple FPS ApiTrace run collected with Harvest looks as follows:

-> cat tvc_steam_728880-overcooked__2-20200528_090359.trace.20200928-174541.crostini
Rendered 6408 frames in 272.566 secs, average of 23.5099 fps
>>>>>> Extra Tracing Info <<<<<<
CMD: DISPLAY=:0 WAFFLE_PLATFORM=sl LD_LIBRARY_PATH=/home/gwink/lib/x86_64-linux-gnu /home/gwink/apitrace/glretrace  -b /home/gwink/traces/tvc_steam_728880-overcooked__2-20200528_090359.trace > /tmp/tmp.bft0MYHEIw
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Mesa/X.org (0x1af4)
    Device: virgl (0x1010)
    Version: 20.3.0
    Accelerated: yes
    Video memory: 0MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.3
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: virgl
OpenGL core profile version string: 4.3 (Core Profile) Mesa 20.3.0-devel
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.1 Mesa 20.3.0-devel
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.3.0-devel
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

TRACE_ID: tvc_steam_728880-overcooked__2-20200528_090359
EXEC_ENV: crostini
MACHINE_NAME: gwink-sona-C097462

To generate a trace-result protobufs for that profile you would run get_device_info as shown below. But pay attention to a couple of things:

  1. You must specify the software-info ID to assign to the protobuf on the command line, either as the ID itself, or as a file path to the software-config protobufs for the device.
  2. Tool get_device_info will pick up the machine name from the input file, if it is there. Otherwise, you must also specify it on the cmd line.
-> get_device_info trace-result \
    -software software_info_crostini_gwink-sona-C097462.json  \
    tvc_steam_728880-overcooked__2-20200528_090359.trace.20200928-174541.crostini.prof > overcooked_2_pb.json
-> cat overcooked_2_pb.json
{
  "value": [
    {
      "id": {
        "value": "user/gwink-tvc_steam_728880-overcooked__2-20200528_090359-20200928-174541"
      },
      "startTime": "2020-09-28T23:45:41Z",
      "endTime": "2020-09-28T23:50:13Z",
      "machine": {
        "value": "gwink-sona-C097462"
      },
      "softwareConfig": {
        "value": "9146de0d-1378-4c83-968e-a9427ac5f91f"
      },
      "executionEnvironment": "CROSTINI",
      "invocationSource": "user/gwink",
      "commandLine": "DISPLAY=:0 WAFFLE_PLATFORM=sl LD_LIBRARY_PATH=/home/gwink/lib/x86_64-linux-gnu /home/gwink/apitrace/glretrace  -b /home/gwink/traces/tvc_steam_728880-overcooked__2-20200528_090359.trace \u003e /tmp/tmp.bft0MYHEIw",
      "benchmark": "apitrace",
      "trace": {
        "value": "tvc_steam_728880-overcooked__2-20200528_090359"
      },
      "metrics": [
        {
          "name": "frame_count",
          "value": 6408,
          "units": "frames"
        },
        {
          "name": "duration",
          "value": 272.566,
          "units": "seconds"
        },
        {
          "name": "frame_rate",
          "value": 23.5099,
          "units": "fps",
          "largerIsBetter": true
        }
      ],
      "primaryMetricName": "frame_rate",
      "labels": [
        {
          "name": "CMD",
          "value": "DISPLAY=:0 WAFFLE_PLATFORM=sl LD_LIBRARY_PATH=/home/gwink/lib/x86_64-linux-gnu /home/gwink/apitrace/glretrace  -b /home/gwink/traces/tvc_steam_728880-overcooked__2-20200528_090359.trace \u003e /tmp/tmp.bft0MYHEIw",
          "grouping": "apitrace"
        },
        {
          "name": "vendor",
          "value": "Mesa/X.org",
          "grouping": "glxinfo"
        },
        {
          "name": "renderer",
          "value": "virgl",
          "grouping": "glxinfo"
        },
        {
          "name": "core profile version",
          "value": "4.3 (Core Profile) Mesa 20.3.0-devel",
          "grouping": "glxinfo"
        },
        {
          "name": "core profile shading language version",
          "value": "4.30",
          "grouping": "glxinfo"
        },
        {
          "name": "version",
          "value": "3.1 Mesa 20.3.0-devel",
          "grouping": "glxinfo"
        },
        {
          "name": "shading language version",
          "value": "1.40",
          "grouping": "glxinfo"
        },
        {
          "name": "ES profile version",
          "value": "OpenGL ES 3.2 Mesa 20.3.0-devel",
          "grouping": "glxinfo"
        },
        {
          "name": "ES profile shading language version",
          "value": "OpenGL ES GLSL ES 3.20",
          "grouping": "glxinfo"
        }
      ]
    }
  ]
}

Uploading trace-results to the DB

When it comes time to upload trace-result protobufs to the DB, look for python script bq_insert_pb.py in https://chromium.googlesource.com/chromiumos/platform/graphics/+/HEAD/src/results_database/