standard sysfs interface. I don't think it makes much sense to
display the offset values as part of the output of "sensors" (it
would even probably confuse people) but having support for these
in libsensors makes it possible to adjust the offsets in
sensors.conf, which is convenient.
This closes ticket #2248.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4769 7894878c-1315-0410-8ee3-d5d059ff63e0
to add more "standard" feature types such as current or power,
we want to give them numbers that immediately follow the fan, voltage
and temperature features, so that the code is as simple as possible.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4767 7894878c-1315-0410-8ee3-d5d059ff63e0
* We don't need to compute the mapping during the first pass: this
field is overwritten when renumbering the features anyway.
* Only main features have features mapping to them.
* Only subfeatures have mappings, so we can stop the scan at the next
main feature.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4763 7894878c-1315-0410-8ee3-d5d059ff63e0
from its type, there's no need to store this scaling factor. We can
instead compute it at runtime. This saves some memory (about 10 kB
in my real-world test), and the runtime overhead is totally
negligible.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4762 7894878c-1315-0410-8ee3-d5d059ff63e0
idea is to have separate indexing for subfeatures with a compute
mapping and for subfeatures without it. They still follow each
other in the big table but this avoids wasting memory due to the
numbering gap between them.
This cuts the amount of memory (temporarily) allocated by
sensors_read_dynamic_chip() almost by half, and also speeds it up
a little as it now takes less iterations to walk the sparse array.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4761 7894878c-1315-0410-8ee3-d5d059ff63e0
position N in the array. This allows for O(1) look-ups, as opposed
to O(N) before. This makes sensors_lookup_feature_nr() 2.4 times
faster in my real-world tests, resulting in a 6% performance boost
on average in the runtime part of "sensors".
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4759 7894878c-1315-0410-8ee3-d5d059ff63e0
feature number as the logical mapping. This means that the compute
mapping can be turned into a simple boolean flag. Doing so makes
struct sensors_feature_data smaller, which saves some memory (about
17 kB in my tests.)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4758 7894878c-1315-0410-8ee3-d5d059ff63e0
we need to add "_input" to get the correct sysfs file name. This is
much faster. This is still a ugly hack I'd like to get rid of, but at
least now the slowdown is acceptable.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4743 7894878c-1315-0410-8ee3-d5d059ff63e0
sensors_bus_id. This prevents wasting space with padding on 64-bit
systems, saving some memory (128 bytes for sensors_bus_id, nothing
yet for sensors_feature_data but it will come later).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4733 7894878c-1315-0410-8ee3-d5d059ff63e0
MAX_SUB_FEATURES in the process.) This value could change in the
future so it's not safe to make it part of the libsensors API.
And it isn't needed either, applications shouldn't need to use
this value.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4732 7894878c-1315-0410-8ee3-d5d059ff63e0
to print the labels. This is both a fix (beforehand we would leave
enough room to print possibly long subfeature names, even though we
do not actually print subfeature names at all) and a significant
performance boost. This change alone shrinks the CPU cost of a sensors
run by 4.5%.
I am still worried that this feature causes us to allocate each label
string twice, but I guess this overhead is now acceptable.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4715 7894878c-1315-0410-8ee3-d5d059ff63e0
* do_sets, do_raw and hide_adapter are only used in main.c and could
thus be declared static.
* fahrenheit and degstr are used in chips.c as well, so they should be
declared in a header file.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4713 7894878c-1315-0410-8ee3-d5d059ff63e0
longer need to build an array from the chip names passed on the
command line. Instead, we can process them one after the other
directly. This saves some memory and allows for minor code cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4703 7894878c-1315-0410-8ee3-d5d059ff63e0