From 8afb3c315b2937366f837e358d293b84113a1787 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Tue, 9 Apr 2013 08:38:31 +0000 Subject: [PATCH] ID: 3608763 - 'lib/ipmi_sdr.c' - display hex values of Sensors Commit adds the hex value for the sensor type to displays so that the user can correlate sensor type values with their hex values without having to look them up in the IPMI spec. Commit for Dan Gora --- ipmitool/lib/ipmi_sdr.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/ipmitool/lib/ipmi_sdr.c b/ipmitool/lib/ipmi_sdr.c index 2a44be4..7b77ab4 100644 --- a/ipmitool/lib/ipmi_sdr.c +++ b/ipmitool/lib/ipmi_sdr.c @@ -1702,8 +1702,9 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf, if (!IS_THRESHOLD_SENSOR(sensor)) { /* Discrete */ - printf(" Sensor Type (Discrete): %s\n", - ipmi_sdr_get_sensor_type_desc(sensor->sensor.type)); + printf(" Sensor Type (Discrete): %s (0x%02x)\n", + ipmi_sdr_get_sensor_type_desc(sensor->sensor.type), + sensor->sensor.type); lprintf(LOG_DEBUG, " Event Type Code : 0x%02x", sensor->event_type); @@ -1763,8 +1764,9 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf, return 0; /* done */ } - printf(" Sensor Type (Threshold) : %s\n", - ipmi_sdr_get_sensor_type_desc(sensor->sensor.type)); + printf(" Sensor Type (Threshold) : %s (0x%02x)\n", + ipmi_sdr_get_sensor_type_desc(sensor->sensor.type), + sensor->sensor.type); printf(" Sensor Reading : "); if (sr->s_reading_valid) { @@ -2087,8 +2089,9 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf, printf("Entity ID : %d.%d (%s)\n", sensor->entity.id, sensor->entity.instance, val2str(sensor->entity.id, entity_id_vals)); - printf("Sensor Type : %s\n", - ipmi_sdr_get_sensor_type_desc(sensor->sensor_type)); + printf("Sensor Type : %s (0x%02x)\n", + ipmi_sdr_get_sensor_type_desc(sensor->sensor_type), + sensor->sensor_type); lprintf(LOG_DEBUG, "Event Type Code : 0x%02x", sensor->event_type); printf("\n"); @@ -4436,8 +4439,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type) strncasecmp(type, "list", 4) == 0) { printf("Sensor Types:\n"); for (x = 1; x < SENSOR_TYPE_MAX; x += 2) { - printf("\t%-25s %-25s\n", - sensor_type_desc[x], sensor_type_desc[x + 1]); + printf("\t%-25s (0x%02x) %-25s (0x%02x)\n", + sensor_type_desc[x], x, + sensor_type_desc[x + 1], x + 1); } return 0; } @@ -4462,9 +4466,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type) if (sensor_type != x) { printf("Sensor Types:\n"); for (x = 1; x < SENSOR_TYPE_MAX; x += 2) { - printf("\t%-25s %-25s\n", - sensor_type_desc[x], - sensor_type_desc[x + 1]); + printf("\t%-25s (0x%02x) %-25s (0x%02x)\n", + sensor_type_desc[x], x, + sensor_type_desc[x + 1], x + 1); } return 0; }