Commit Graph
529 Commits
Author SHA1 Message Date
Jean Delvare e4d51acf7d Fix error propagation during expression evaluation.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5581 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-11 10:00:19 +00:00
Jean Delvare c541b7e523 Spelling fixes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5536 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-12-07 15:27:00 +00:00
Jean Delvare 755fd99aeb Strip trailing whitespace.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5535 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-12-07 13:17:54 +00:00
Jean Delvare 2e954a6580 Move the help section of sensors.conf.eg to sensors.conf.5, so that
we have only one document to maintain. This change also speeds up
sensors by 2.5% when using the default configuration file.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5534 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-12-07 13:14:39 +00:00
Jean Delvare 51a621be43 Add support for current sensors.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5379 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-10-24 09:04:26 +00:00
Jean Delvare d766935c47 Add support for instantaneous power sensors.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5378 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-10-24 09:03:18 +00:00
Jean Delvare 5b218864d0 Typo fix.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5340 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-09-26 14:54:32 +00:00
Jean Delvare 9fcfb654af The free_expr() function is no longer static in lib/init.c (it is also
used in lib/conf-parse.y), and therefore must be renamed according to
the libsensors naming conventions.
Based on an original patch from Sergey Vlasov.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5302 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-07-14 16:21:48 +00:00
Jean Delvare d53ba9bb1c Prepare for release.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5254 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-05-18 16:07:48 +00:00
Jean Delvare 0f2d2724a6 Bugfix: add carriage return ('\r') to the BLANK character class.
This closes ticket #2284.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5251 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-05-12 11:44:33 +00:00
Darrick J. Wong bb840c486c Subject: [PATCH 1/3 v3] libsensors: Support energy and power meters
Add power and sensor meters to libsensors, with minor tweaks and
documentation updates as suggested by Jean Delvare.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>



git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5183 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-17 01:27:22 +00:00
Jean Delvare fdd8139afc Trivial alignment fix.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5177 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-14 15:29:49 +00:00
Jean Delvare 39b96fa477 Add support for virtual hwmon devices. This closes Red Hat bug #437637
and ticket #2305.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5176 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-14 15:27:59 +00:00
Jean Delvare c84fd9820e We start at the end of the chip list, going backwards, and we want the
late compute statements to override the early ones (as documented in the
sensors.conf manual page), so we must stop as soon as any match is found.

This fixes Debian bug #474596:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474596


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5175 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-11 20:41:31 +00:00
Darrick J. Wong 7566fa5b1c Subject: [PATCH 1/4] libsensors: Detect OpenFirmware hwmon devices
On a QS22 blade, the BMC containing the (ibmpex) power meters is enumerated
via Open Firmware.  Check for "of_platform" to handle this case.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5174 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-10 23:24:57 +00:00
Jean Delvare 4293c939a7 Fix typo.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5171 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-08 15:07:31 +00:00
Jean Delvare 399410079f The configuration file is currently parsed in the locale set by the main
program using the library. This means that if the decimal separator
(defined in LC_NUMERIC) is not '.' the values in the compute lines are
truncated. This happens for example with sensors-applet and a French
locale.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=469333

Parsing the configuration file in C locale fixes the problem.
Original patch from Aurelien Jarno.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5169 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-04-08 14:50:13 +00:00
Jean Delvare f2e518511d Patch from Aurelien Jarno:
I have just noticed that the FSF address is the old one in all files
except COPYING. Please find a patch below to fix that.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5163 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-03-26 13:37:12 +00:00
Hans de Goede e4870c50f9 The platform case
acts as a fallback solution so it must be last in the list.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5145 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-03-16 12:51:18 +00:00
Jean Delvare 24ee53d80e Use __func__ instead of __FUNCTION__. The former is standard, the latter
is not.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5134 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-03-05 07:44:16 +00:00
Jean Delvare 3af8a8e6b8 Prepare for release.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5114 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-28 17:47:23 +00:00
Jean Delvare 9815a9f31b Add support for drivers that place the hwmon attributes in the hwmon
class device directory rather than directly in the device directory.
The latter is what all drivers do at the moment, but in the long run
the former is preferred as it prevents attribute name collisions.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5093 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-05 15:20:13 +00:00
Jean Delvare 5af7917c1f Get the device type from the subsystem symlink, rather than
guessing it from how the device identifier looks like. For kernels
<= 2.6.17, we use the bus symlink instead. For kernels <= 2.6.11,
neither symlink exist so we fallback to the old type guessing
approach. It doesn't really matter as all hwmon devices were
i2c devices back then.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5092 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-05 12:31:55 +00:00
Jean Delvare 32cc1171bc Returned error values are supposed to be negative.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5077 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-12-18 10:06:58 +00:00
Mark M. Hoffman 48c6b26c20 libsensors: minor cleanup
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5075 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-12-16 19:37:11 +00:00
Jean Delvare 67218f03c3 libsensors: No longer depend on libsysfs.
Instead, access sysfs directly, using 3 embedded helper
functions. My motivations for doing this are:
* As far as I know, libsysfs is no longer maintained.
* libsysfs does much more than we need. For example, when asking for a
device attribute list, libsysfs will read the contents and permissions
of all attributes. Not only does this waste CPU cycles per se, but in
the case of hwmon driver it also triggers register reads, which can be
slow for SMBus chips.
* libsysfs enforces the difference between devices and class devices,
while future changes will be easier if we can handle both types alike.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5067 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-12-10 13:30:22 +00:00
Jean Delvare f1a894e4e1 No warnings about ld configuration for staged installations, as these
make no sense: we have no idea how the target system will be configured.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5047 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-11-26 13:54:31 +00:00
Jean Delvare 35a5a7dbce Use /etc/sensors3.conf as the default configuration file. If it can't
be found, fallback to /etc/sensors.conf. This allows for an old
libsensors and a new libsensors to be installed in parallel, and each
one has its own configuration file.

One important change here is that the default configuration file will
be installed as /etc/sensors3.conf by "make install".


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4990 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:59:05 +00:00
Jean Delvare de00b0aad4 Make the configuration file optional. Although in most cases it's not
very useful to use libsensors without a configuration file, I fail to
see the rationale for making a configuration file mandatory.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4989 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:52:46 +00:00
Jean Delvare 58b3284058 Clean up if something goes wrong during initialization. Otherwise
we're leaking memory.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4988 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:51:19 +00:00
Jean Delvare fb920578a9 Let libsensors know the default path to its configuration file.
That way, applications no longer have to care.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4985 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:48:18 +00:00
Hans de Goede 0aee76dbbb make SENSORS_API_VERSION hexadecimal
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4978 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-22 19:27:38 +00:00
Hans de Goede 2c41310ba0 add SENSORS_API_VERSION define to sensors.h
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4975 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-22 09:39:15 +00:00
Jean Delvare 647b47cb6a Add my copyright everywhere it is missing.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4902 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-29 19:18:15 +00:00
Jean Delvare 8a62e5f651 libsensors: Report I/O errors as such.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4899 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-29 18:48:20 +00:00
Jean Delvare 2c642d01e1 libsensors: Differentiate between different read error types.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4896 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-29 12:46:36 +00:00
Jean Delvare 301e18b511 libsensors: Notify the caller when writing a value fails.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4895 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-29 11:57:37 +00:00
Jean Delvare 6c229f7a3c Drop SENSORS_ERR_NO_DEVS: we return success, not error, when no device
is found.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4879 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-24 16:34:56 +00:00
Jean Delvare 38d16d299d Add support for platform devices with no ID.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4878 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-24 15:22:01 +00:00
Jean Delvare 01c2d7d046 SENSORS_NO_MAPPING is no longer used, delete it.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4871 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-24 11:22:24 +00:00
Jean Delvare 56e301c8b5 Document struct_feature.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4860 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 18:00:20 +00:00
Jean Delvare 55a29cc2ce Reserve some room in struct sensors_feature for future extension.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4859 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 17:48:57 +00:00
Jean Delvare d1b374cc38 Renumber feature and subfeature types to leave more room if we later
need to add more feature or subfeature types.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4858 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 17:42:27 +00:00
Jean Delvare 55e467b151 Don't arbitrarily write errors to stderr. In production mode,
simply ignore the errors. In debug mode, call sensors_fatal_error().

As a side note, there is certainly room for improvement in the way
errors are reported by libsensors. sensors_fatal_error() is fatal,
and sensors_parse_error() is too specific, so we lack a more general
error reporting function. printf-like formatting for error messages
would also be a good idea.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4855 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 14:34:42 +00:00
Jean Delvare ab36c5b0f8 Delete unused SENSORS_ERR_ACCESS.
Rename SENSORS_ERR_PROC to the more neutral SENSORS_ERR_KERNEL.
Introduce SENSORS_ERR_NO_DEVS for finer-grained error reporting.
Use SENSORS_ERR_KERNEL and SENSORS_ERR_NO_DEVS where appropriate.
No error message for invalid error codes.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4854 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 13:53:11 +00:00
Jean Delvare 2fea711456 Alignment.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4852 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 13:33:32 +00:00
Jean Delvare 06a8d04b5d Preserve error values returned by sensors_read_sysfs_attr() and
sensors_write_sysfs_attr().


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4851 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 13:17:53 +00:00
Jean Delvare 9ba88a7d1f Better prototype for get_type_scaling().
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4850 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:49:47 +00:00
Jean Delvare 5742812cfe Hide a warning in flex-generated file.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4848 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:36:56 +00:00
Jean Delvare e01466d993 New public library function: sensors_get_subfeature(). Applications can
use it to retrieve a specific subfeature by type. While it is slighly
less efficient than looping over sensors_get_all_subfeatures(), it
often makes the application code much more elegant.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4846 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:30:28 +00:00