Project

General

Profile

Bug #10897

topo_sensor_state_name() needs work

Added by Rob Johnston 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2019-05-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Libtopo implements an interface, topo_sensor_state_name(), which takes a sensor state value and returns a string containing a descriptive representation of the sensor state.

The primary consumers of this interface are fmtopo and hwgrok, both of which use it to provide a more human-readable representation of the sensor state.

There are two issues with how it's currently implemented:

1) It makes the assumption that only one discrete state will be asserted at any time. This is true for some sensors, but not all sensors.

2) Because it's working with a raw state value from IPMI, where certain reserved bits haven't been masked off, there no way for it to return a string to indicate the situation where no state are asserted (which is the normal state for many sensors). The facility/state property method should be masking off reserved bits - such that when no states are asserted, the state value is 0.

History

#1

Updated by Rob Johnston 6 months ago

This change has already been integrated into illumos-joyent via the commit below:

commit 52767bdcffaf8c9d0a1cbfac8fa46b8506ee88cd
Author: Rob Johnston <rob.johnston@joyent.com>
Date:   Mon Mar 18 21:13:23 2019 +0000

    OS-7241 topo_sensor_state_name() needs work
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Jordan Hendricks <jordan.hendricks@joyent.com>

So this issue is simply to track getting the above change pushed upstream.

See the SmartOS ticket for details on how this change was tested:

https://smartos.org/bugview/OS-7241

#2

Updated by Electric Monk 5 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 881aaecd29563bc45bf78a3c8f1e534275021925

commit  881aaecd29563bc45bf78a3c8f1e534275021925
Author: Rob Johnston <rob.johnston@joyent.com>
Date:   2019-05-14T19:00:56.000Z

    10897 topo_sensor_state_name() needs work
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF