add metric for new glibc hwcaps

Bug #1922712 reported by Matthias Klose on 2021-04-06
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-report (Ubuntu)
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: added: fr-1265
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"
  },

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)
William Wilson (jawn-smith) wrote :

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

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
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
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.

Sebastien Bacher (seb128) wrote :

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

Matthias Klose (doko) on 2021-04-13
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers