diff options
-rw-r--r-- | sbin/sysctl/sysctl.c | 7 | ||||
-rw-r--r-- | sys/sys/sensors.h | 4 | ||||
-rw-r--r-- | usr.bin/systat/sensors.c | 8 | ||||
-rw-r--r-- | usr.sbin/sensorsd/sensorsd.c | 8 | ||||
-rw-r--r-- | usr.sbin/snmpd/mib.c | 4 |
5 files changed, 22 insertions, 9 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index fe26c1f0107..d01e9c753bd 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.177 2011/07/08 18:30:17 yasuoka Exp $ */ +/* $OpenBSD: sysctl.c,v 1.178 2011/09/16 15:44:31 yuo Exp $ */ /* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */ /* @@ -2463,6 +2463,9 @@ print_sensor(struct sensor *s) case SENSOR_FANRPM: printf("%lld RPM", s->value); break; + case SENSOR_VOLTS_AC: + printf("%.2f ADC", s->value / 1000000.0); + break; case SENSOR_VOLTS_DC: printf("%.2f VDC", s->value / 1000000.0); break; @@ -2535,7 +2538,7 @@ print_sensor(struct sensor *s) printf("%.2f%%", s->value / 1000.0); break; case SENSOR_FREQ: - printf("%lld Hz", s->value); + printf("%.2f Hz", s->value / 1000000.0); break; case SENSOR_ANGLE: printf("%3.4f degrees", s->value / 1000000.0); diff --git a/sys/sys/sensors.h b/sys/sys/sensors.h index c434244e729..9e7828faa5e 100644 --- a/sys/sys/sensors.h +++ b/sys/sys/sensors.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.h,v 1.30 2010/04/21 19:40:59 deraadt Exp $ */ +/* $OpenBSD: sensors.h,v 1.31 2011/09/16 15:44:31 yuo Exp $ */ /* * Copyright (c) 2003, 2004 Alexander Yurchenko <grange@openbsd.org> @@ -47,7 +47,7 @@ enum sensor_type { SENSOR_DRIVE, /* disk */ SENSOR_TIMEDELTA, /* system time error (nSec) */ SENSOR_HUMIDITY, /* humidity (m%RH) */ - SENSOR_FREQ, /* frequency (Hz) */ + SENSOR_FREQ, /* frequency (muHz) */ SENSOR_ANGLE, /* angle (mudegrees) */ SENSOR_MAX_TYPES }; diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c index 08ec4484a69..1effdbfc14e 100644 --- a/usr.bin/systat/sensors.c +++ b/usr.bin/systat/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.24 2011/03/02 06:48:17 jasper Exp $ */ +/* $OpenBSD: sensors.c,v 1.25 2011/09/16 15:44:31 yuo Exp $ */ /* * Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org> @@ -224,6 +224,10 @@ showsensor(struct sensinfo *s) case SENSOR_FANRPM: tbprintf("%11lld RPM", s->sn_value); break; + case SENSOR_VOLTS_AC: + tbprintf("%10.2f V AC", + s->sn_value / 1000000.0); + break; case SENSOR_VOLTS_DC: tbprintf("%10.2f V DC", s->sn_value / 1000000.0); @@ -266,7 +270,7 @@ showsensor(struct sensinfo *s) tbprintf("%3.2f%%", s->sn_value / 1000.0); break; case SENSOR_FREQ: - tbprintf("%11lld Hz", s->sn_value); + tbprintf("%11.2f Hz", s->sn_value / 1000000.0); break; case SENSOR_ANGLE: tbprintf("%3.4f degrees", s->sn_value / 1000000.0); diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c index b012e4d930b..9a91c95b8a3 100644 --- a/usr.sbin/sensorsd/sensorsd.c +++ b/usr.sbin/sensorsd/sensorsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensorsd.c,v 1.49 2010/04/21 04:07:13 deraadt Exp $ */ +/* $OpenBSD: sensorsd.c,v 1.50 2011/09/16 15:44:31 yuo Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -623,6 +623,9 @@ print_sensor(enum sensor_type type, int64_t value) case SENSOR_FANRPM: snprintf(fbuf, RFBUFSIZ, "%lld RPM", value); break; + case SENSOR_VOLTS_AC: + snprintf(fbuf, RFBUFSIZ, "%.2f V AC", value / 1000000.0); + break; case SENSOR_VOLTS_DC: snprintf(fbuf, RFBUFSIZ, "%.2f V DC", value / 1000000.0); break; @@ -662,6 +665,9 @@ print_sensor(enum sensor_type type, int64_t value) case SENSOR_ANGLE: snprintf(fbuf, RFBUFSIZ, "%lld", value); break; + case SENSOR_FREQ: + snprintf(fbuf, RFBUFSIZ, "%.2f Hz", value / 1000000.0); + break; default: snprintf(fbuf, RFBUFSIZ, "%lld ???", value); } diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c index 9c088a63d03..aa508785ff7 100644 --- a/usr.sbin/snmpd/mib.c +++ b/usr.sbin/snmpd/mib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mib.c,v 1.45 2011/07/04 04:34:14 claudio Exp $ */ +/* $OpenBSD: mib.c,v 1.46 2011/09/16 15:44:31 yuo Exp $ */ /* * Copyright (c) 2007, 2008 Reyk Floeter <reyk@vantronix.net> @@ -1378,6 +1378,7 @@ mib_sensorvalue(struct sensor *s) case SENSOR_WATTHOUR: case SENSOR_AMPHOUR: case SENSOR_LUX: + case SENSOR_FREQ: ret = asprintf(&v, "%.2f", s->value / 1000000.0); break; case SENSOR_INDICATOR: @@ -1398,7 +1399,6 @@ mib_sensorvalue(struct sensor *s) /* FALLTHROUGH */ case SENSOR_FANRPM: case SENSOR_INTEGER: - case SENSOR_FREQ: default: ret = asprintf(&v, "%lld", s->value); break; |