Hi Jim,

On Wed, 2012-02-08 at 08:37 -0800, Jim Mank wrote:
> All,
> 
> I would like to start contributing to the ipmitool project and as a 
> initial task I thought I would resolve the open bug associated with 
> ipmitool's inability to display percentage units correctly 
> (https://sourceforge.net/tracker/?func=detail&aid=3014014&group_id=95200&atid=610550).
>     
> I'm currently working for Hewlett Packard in their Proliant server 
> organization and I and others are starting to look at how we can better 
> serve our customers by helping make ipmitool more robust.   I only have 
> access to HP Proliant servers, so I'll be doing my testing on various HP 
> Proliant servers.    I'm not very familiar with IPMI so I'll be learning 
> as I work though problems, any and all help with IPMI would much 
> appreciated.
> 
> In investigating this problem, I found in the IPMI v2.0 spec that the 
> percentage units are identified by bit 0 == 1 in byte 21 of the Full and 
> Compact Sensor Records.   In looking at the ipmitool code, the 
> sdr_record_full_sensor and sdr_record_compact_sensor both properly 
> declare the percentage bit (pct), but no code looks at this.    So, 
> display of percentage units correctly in the ipmitool requires correct 
> interpretation of this bit in the sensor records.   As I understand the 
> spec, if the pct bit is set to one, then the units are a percentage and 
> the Base Unit  would be unspecified.

While this is the 99.9% case, I believe it is legal for the base unit to
be specified.  Looking through the units list "% hit" and "% miss" seem
like reasonable base units to go with "%".  There might be other
possibilities when you add the rate unit and modifier units (i.e. "% X /
Y" or "% X per Y").

My code here is probably not perfect, but perhaps this can give you
hints on some of the corner cases that can be expected:

http://svn.savannah.gnu.org/viewvc/trunk/libfreeipmi/util/ipmi-sensor-units-util.c?revision=8165&root=freeipmi&view=markup

Al

> The code for displaying units in the sensor records is replicated in 
> multiple places in the code, each doing pretty much the exact same 
> decoding.    There does exist one function for decoding the units, 
> ipmi_sdr_get_unit_string, so I've changed  the code so this routine will 
> be used for all units decoding and I updated this function to display a 
> new unit named "percent".
> 
> In doing these modifications, I'm wondering if it would be ok for me to 
> to do some local variable cleanup in ipmi_sdr_print_sensor_full.   I 
> noticed that the local variable do_unit is set to one, but never 
> changed, so could this code be removed?
> 
> When I have these changes available, should I just send a patch to this 
> email alias?
> 
-- 
Albert Chu
ch...@llnl.gov
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory



------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to