add metric for new glibc hwcaps

Bug #1922712 reported by Matthias Klose
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-report (Ubuntu)
Fix Released
Low
William Wilson

Bug Description

FFe: We would like to collect that information with 21.04 to get a better view of supported hardware for the new hwcaps. The risk should be minimal, only adding an extra flag, and the server side collecting the data can handle that, according to Didier.

pull request at https://github.com/ubuntu/ubuntu-report/pull/34

we want to collect information which most recent hwcap is supported by a machine. The result should be a string like "x86-64-v2", "x86-64-v3", "x86-64-v4", "z13", "z14", "p9", "p10" depending on "ld-linux --help" output. The string should be empty for architectures without glibc hwcaps (currently armhf, arm64, i386, riscv64). The string should be empty if no specific hwcaps is supported (e.g. on a power8 machine). The string should be "" (empty), when trying to run ld-linux on a release with glibc (<< 2.33). The string should be "-" (dash) when not having any hwcaps mentioned.

Note that lexical sorting won't work for "p9", "p10".

if test -x /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2; then
  lddynload=/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
elif test -x /lib/powerpc64le-linux-gnu/ld64.so.2; then
  lddynload=/lib/powerpc64le-linux-gnu/ld64.so.2
elif test -x /lib/s390x-linux-gnu/ld64.so.1; then
  lddynload=/lib/s390x-linux-gnu/ld64.so.1
fi

supported=
if [ -n "$lddynload" ]; then
  $lddynload --help 2>&1 | awk '/^Subdirectories/,/^$/'
  supported=$($lddynload --help 2>&1 | awk '/^Subdirectories/,/^$/' | awk '/supported/ {print $1}')
fi

Here, $supported has listed all supported hwcaps, not just the best supported one.

Tags: patch fr-1265
tags: added: fr-1265
Revision history for this message
Balint Reczey (rbalint) wrote :

What is the point for that?
Ubuntu-report already collects the CPU string from which the hwcap can be computed:

$ ubuntu-report interactive
This is the result of hardware and optional installer/upgrader that we collected:
{
...
  "CPU": {
    "OpMode": "32-bit, 64-bit",
    "CPUs": "4",
    "Threads": "2",
    "Cores": "2",
    "Sockets": "1",
    "Vendor": "GenuineIntel",
    "Family": "6",
    "Model": "142",
    "Stepping": "9",
    "Name": "Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz",
    "Virtualization": "VT-x"
  },

Revision history for this message
Matthias Klose (doko) wrote :

it's much more work to build up a table for each cpu and map that to some base level, and continue to update that table. just take that information from the glibc hwcaps.

Changed in ubuntu-report (Ubuntu):
assignee: nobody → William Wilson (jawn-smith)
Revision history for this message
William Wilson (jawn-smith) wrote :

Attached is a patch to add the hwcap metric to ubuntu-report.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp1922712.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Sebastien Bacher (seb128) wrote :

@William, thanks for working on a patch. The project is hosted on github, is there a chance that you could set up a proper pull request on https://github.com/ubuntu/ubuntu-report/pulls ? that would make reviewing and merging easier than having to comment on a non trivial patch in a comment on launchpad...

Changed in ubuntu-report (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
William Wilson (jawn-smith) wrote :

Seb, I have made a PR in the github repo. This PR also pulls in the changes in version 1.6.3, which were previously not present.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks! I've added a trello card to review the PR in our trello backlog

Matthias Klose (doko)
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Oh man, this is *late*. It's also quite a big change too - only collecting new information, but still. But yeah, it's either now or in 21.10, so eh. If the desktop team +1's the PR and considers it 'safe' to land, this has a +1 from the release team.

Changed in ubuntu-report (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I reviewed the branch and after some fixes, we +1 on it.
CI is passing, the new code is covered by the same amount of testing than the rest of the code.

I did a run-try locally with ubuntu-report --show:
{
  "Version": "21.04",
  "OEM": {
    "Vendor": "Entroware",
    "Product": "Kratos",
    "Family": "Not Applicable"
  },
  "BIOS": {
    "Vendor": "American Megatrends Inc.",
    "Version": "1.05.02E"
  },
  "CPU": {
    "OpMode": "32-bit, 64-bit",
    "CPUs": "8",
    "Threads": "2",
    "Cores": "4",
    "Sockets": "1",
    "Vendor": "GenuineIntel",
    "Family": "6",
    "Model": "158",
    "Stepping": "10",
    "Name": "Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz",
    "Virtualization": "VT-x"
  },
  "Arch": "amd64",
  "HwCap": "x86-64-v3",
  "GPU": [
    {
      "Vendor": "8086",
      "Model": "3e9b"
    },
    {
      "Vendor": "10de",
      "Model": "1c8d"
    }
  ],
  "RAM": 16.2,
  "Partitions": [
    0.5
  ],
  "Screens": [
    {
      "Size": "344mmx194mm",
      "Resolution": "1920x1080",
      "Frequency": "60.02"
    },
    {
      "Size": "527mmx296mm",
      "Resolution": "1920x1080",
      "Frequency": "60.00"
    }
  ],
  "Autologin": false,
  "LivePatch": false,
  "Session": {
    "DE": "ubuntu:GNOME",
    "Name": "ubuntu",
    "Type": "x11"
  },
  "Language": "fr_FR",
  "Timezone": "Europe/Paris",
  "Install": {
    "Media": "Ubuntu 20.04 LTS \"Focal Fossa\" - Release amd64 (20200423)",
    "Type": "GTK",
    "OEM": false,
    "PartitionMethod": "use_zfs",
    "DownloadUpdates": true,
    "Language": "fr",
    "Minimal": false,
    "RestrictedAddons": true,
    "Stages": {
      "0": "language",
      "3": "console_setup",
      "53": "wireless",
      "82": "prepare",
      "130": "partman",
      "135": "partman",
      "137": "start_install",
      "141": "timezone",
      "142": "usersetup",
      "156": "user_done",
      "406": "done"
    }
  }
}

You can note the new entry is present: "HwCap": "x86-64-v3",

Matthias Klose (doko)
Changed in ubuntu-report (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-report - 1.6.4

---------------
ubuntu-report (1.6.4) hirsute; urgency=medium

  * Add new metric for glibc hwcaps (LP: #1922712)

 -- William 'jawn-smith' Wilson <email address hidden> Wed, 07 Apr 2021 16:52:26 -0500

Changed in ubuntu-report (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.