ibm-openbmc / dev

Product Development Project Mgmt and Tracking
16 stars 2 forks source link

Properly detect CPU presence in adcsensor #3615

Closed spinler closed 1 year ago

spinler commented 1 year ago

The adcsensor daemon in dbus-sensors attempts to determine if an inventory path is a CPU by just checking for 'cpu' anwhere in the name here: https://github.com/openbmc/dbus-sensors/blob/master/src/ADCSensorMain.cpp#L348.

On IBM systems, that results in a bunch of extra calls because we have things in the inventory which have cpu in the name but aren't even cpus:

  │     │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0
  │     │ │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0/unit0
  │     │ │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0/unit1
  │     │ │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0/unit10
  │     │ │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0/unit11
  │     │ │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0/unit12
  │     │ │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0/unit13
  │     │ │ ├─/xyz/openbmc_project/inventory/system/chassis/motherboard/dcm3/cpu0/unit14

I think a proper solution would either a) check if the xyz.openbmc_project.Inventory.Item.Cpu interface exists on the path, or b) at least check for 'cpu' in the last segment. Whichever the maintainers like more.

lxwinspur commented 1 year ago

hey @spinler Please review: https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/58966

lxwinspur commented 1 year ago

@spinler This patch has been merged.