Commit Graph

  • 5c121e2b74 Another minor optimization to sensors_read_dynamic_chip(): * We don't need a temporary structure for the feature being currently processed. Instead we can work on the large sparse array directly. Jean Delvare 2007-09-05 08:29:36 +00:00
  • 75bd19ec34 Minor optimizations in sensors_read_dynamic_chip(): * 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. Jean Delvare 2007-09-05 08:26:26 +00:00
  • b836fc0b53 Now that we can deduce the scaling factor required for each feature 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. Jean Delvare 2007-09-05 08:21:19 +00:00
  • ed480f2edd Optimize the memory consumption in sensors_read_dynamic_chip(). The 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. Jean Delvare 2007-09-05 08:20:35 +00:00
  • 23f4274010 Store the feature list length separately instead of null-terminating the list. This make it possible to check for out-of-bound indexes without walking the entire list, so that direct look-ups are safer. Jean Delvare 2007-09-05 08:19:42 +00:00
  • 7975800ac1 Renumber the features linearly, so that feature number N is at 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". Jean Delvare 2007-09-05 08:19:09 +00:00
  • 20c98f41b7 The compute mapping value is either SENSORS_NO_MAPPING or the same 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.) Jean Delvare 2007-09-05 08:17:22 +00:00
  • 87efbc06c5 Rename sensors_feature_data.mode to flags, as we plan to use it to store non-mode flags soon. Jean Delvare 2007-09-05 08:13:15 +00:00
  • 079ba26574 Drop sensors_strip_of_spaces. There's no rationale for stripping trailing spaces of bus names and nothing else. Jean Delvare 2007-09-05 08:07:14 +00:00
  • 3d15175ecd Add max6680-* entry. Jean Delvare 2007-09-05 08:06:03 +00:00
  • 0e357dfea6 Fix a broken comment. Jean Delvare 2007-09-04 21:25:34 +00:00
  • af454994ea Fix the smsc47m192 temperature faults. The standard name for these files changed recently. Fallback to the old name for compatibility. Jean Delvare 2007-09-04 16:51:54 +00:00
  • 11bf5ced65 Fix adm1026 critical temperature limits for Linux 2.6. Jean Delvare 2007-09-04 16:04:19 +00:00
  • a7a75c729d Fix the magnitude of temperature offsets in Linux 2.6. Jean Delvare 2007-09-04 15:59:33 +00:00
  • 196cf59489 Minor fixes to the feature name conversion list. Jean Delvare 2007-09-04 15:48:44 +00:00
  • 5c58595785 libsensors: Fix maxilife support for Linux 2.6. The driver doesn't exist yet, but at least now the library is ready. Jean Delvare 2007-09-04 15:15:16 +00:00
  • 44517574f9 Stop abusing the lm78 sysctl symbols in sis5595_features. Jean Delvare 2007-09-04 15:01:26 +00:00
  • 72559e55f1 libsensors: Fix adm1024 support for Linux 2.6. The driver doesn't exist yet, but at least now the library is ready. Jean Delvare 2007-09-04 14:38:30 +00:00
  • 729c95b27d The adm9240 temperature features need no specific translation rules, the generic rules will work just fine. Jean Delvare 2007-09-04 14:04:52 +00:00
  • eb62f8fa7b Fix lm93 VID support for Linux 2.6. Jean Delvare 2007-09-04 13:57:33 +00:00
  • 2a822a2d96 Start numbering the features at 0, not 1. There's nothing wrong with having a feature number 0, and this makes the code slightly simpler. Jean Delvare 2007-09-02 11:15:27 +00:00
  • 75859ca9dc Use the feature type rather than the feature name to figure out whether 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. Jean Delvare 2007-09-02 11:09:16 +00:00
  • 4b012c9f63 Drop useless return. Jean Delvare 2007-09-02 10:55:03 +00:00
  • c519ede6f8 Fix bmcsensors support for Linux 2.6. Jean Delvare 2007-09-01 08:26:13 +00:00
  • 3c602aa03a Remove broken ATI SB700 SMBus PCI ID. The SB700 SMBus actually uses the same PCI device ID as the SB600 SMBus. Jean Delvare 2007-09-01 08:23:21 +00:00
  • 82197ef51e Fix ATI SB700 SMBus support, add SB800 support (backport from Linux 2.6, original patch by Shane Huang). Jean Delvare 2007-09-01 08:19:13 +00:00
  • f96dc0266f Fix kernel version detection (#2187). Jean Delvare 2007-09-01 08:09:49 +00:00
  • 27200afa1d Reorder functions so that forward declarations are no longer needed. Jean Delvare 2007-08-31 15:09:26 +00:00
  • a82c6b0476 Mass reindent, coding style and whitespace cleanups. Jean Delvare 2007-08-31 14:42:20 +00:00
  • 02dc2e6679 Add support for the Intel Tolapai SMBus controller. Patch from Jason Gaston. Jean Delvare 2007-08-31 14:09:32 +00:00
  • e4ecbc9a90 Add support for the Intel Tolapai SMBus controller. Patch from Jason Gaston. Jean Delvare 2007-08-31 14:07:15 +00:00
  • c00e21cf38 Reorder the members of the structures sensors_feature_data and 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). Jean Delvare 2007-08-30 21:23:22 +00:00
  • b491ba49d4 Make SENSORS_FEATURE_MAX_SUB_FEATURES private (and rename it to 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. Jean Delvare 2007-08-30 21:21:15 +00:00
  • ed2b9171ec Allocate the large sparse feature table in sensors_read_dynamic_chip() dynamically. Having large amounts of data on the stack is generally not recommended. Jean Delvare 2007-08-30 21:10:41 +00:00
  • 5b1068a007 Rename SENSORS_FEATURE_TEMP_SENS to SENSORS_FEATURE_TEMP_TYPE. This better reflects what this feature is, in line with the sysfs file name. Jean Delvare 2007-08-29 14:08:47 +00:00
  • 38d1d82cec Looking up a mapping can't fail if looking up the feature itself succeeded (or that would be a bug in the library code.) Jean Delvare 2007-08-29 14:00:47 +00:00
  • 2ee12591df Remove "generic" from all printing function names. This is the default mode now so no need to mention it explicitly. Rename print_vid_info to print_chip_vid and move it around for consistency. Jean Delvare 2007-08-26 21:26:20 +00:00
  • 984ebb419f Fix a memory leak on error when printing an unknown chip. Jean Delvare 2007-08-26 21:20:55 +00:00
  • eaeaffb89b Fix a memory leak on error in raw print mode. Jean Delvare 2007-08-26 21:14:37 +00:00
  • 4e5d695411 Don't print the feature name for subfeatures in raw mode. Subfeatures typically don't have a label so printing their label is equivalent to printing their name, so printing it again is redundant. Jean Delvare 2007-08-26 21:10:42 +00:00
  • deb41a945d Move print_chip_raw() at the top of the file, as it is indepdendent from all the other functions. Jean Delvare 2007-08-26 20:55:36 +00:00
  • 9fe77731a9 Fix error message in print_chip_raw(). Jean Delvare 2007-08-26 20:52:24 +00:00
  • c575eb9f90 Fix error message in unknown chip printing routine. Jean Delvare 2007-08-26 20:48:36 +00:00
  • 2c04e9e370 Avoid the conversions from double to float. Jean Delvare 2007-08-26 20:45:29 +00:00
  • 60b2bafabd Drop function get_feature_value, it wasn't adding much value. Jean Delvare 2007-08-26 20:41:53 +00:00
  • 868fd8d093 Avoid the conversions from double to float. Jean Delvare 2007-08-26 20:41:03 +00:00
  • 4716a8c8f1 Change print_temp_limits() to expose a sane interface. This lets us get rid of arbitrary constants. Now we can reuse the same code to display the extra temperature limits. Jean Delvare 2007-08-26 20:37:15 +00:00
  • 9da5883c98 Move the printing of the current temperature out of print_temp_info(). That way we don't need to use an arbitrary value to carry the fault information. Jean Delvare 2007-08-26 20:36:46 +00:00
  • 02e4d6fe83 print_temp_info is only ever called with precision values of 1, so we can hard-code this precision for improved performance. Jean Delvare 2007-08-26 20:35:26 +00:00
  • 2cc20c4487 Only consider the main features when computing how much room we need 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%. Jean Delvare 2007-08-26 20:34:55 +00:00
  • f0f3df8a48 Labels do fit in the imparted space by construction now, so no need to check. Jean Delvare 2007-08-26 20:33:21 +00:00
  • 7ba794d9ba Clean up the global variables: * 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. Jean Delvare 2007-08-26 13:24:46 +00:00
  • 55291db894 Reorder the functions so as to get rid of unneeded forward declarations. Jean Delvare 2007-08-26 13:22:28 +00:00
  • 364bd24c44 config_file doesn't need to be a global. Also move the handling of the configuration file in a single separate function for clarity. Jean Delvare 2007-08-26 13:21:05 +00:00
  • c649ae5ac3 Merge chips_generic.c into chips.c. The boundary between both files was only historical, and prevents us from doing a number of cleanups. Jean Delvare 2007-08-26 12:19:07 +00:00
  • 7268001a5d libsensors no longer returns ignored features so no need to check for this in applications anymore. Jean Delvare 2007-08-26 11:45:46 +00:00
  • 252c5faf86 Mass reindent and coding style cleanups. Jean Delvare 2007-08-26 10:57:16 +00:00
  • 41a6e5b598 Executing the set statements is an exclusive action. Jean Delvare 2007-08-26 08:59:26 +00:00
  • c91457b7de Executing the set statements is an exclusive action. Jean Delvare 2007-08-26 08:57:48 +00:00
  • 5ba408a37f Merge most of the usage help text into a single string. This is way more efficient. Jean Delvare 2007-08-26 08:43:30 +00:00
  • ec8ba95b53 Refactor the configuration file path. Jean Delvare 2007-08-26 08:42:20 +00:00
  • b8b417c51e Thanks to the new prototype of sensors_get_detected_chips, we no 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. Jean Delvare 2007-08-26 08:28:10 +00:00
  • a9a48ea2a9 Make sensors_match_chip internal to libsensors. It is no longer used by applications in practice. Jean Delvare 2007-08-26 08:26:51 +00:00
  • 4d6bec8bb2 Add a parameter to sensors_get_detected_chips(), to optionally let the caller select which subset of chips it wants. This is slightly better size-wise than letting all applications do the filtering by themselves. Jean Delvare 2007-08-26 08:26:20 +00:00
  • ff4cfd53d5 Delete file BUGS. All documented bugs are in kernel drivers so the information no longer belongs to this package. Most of it seems to be outdated anyway. Jean Delvare 2007-08-25 11:49:07 +00:00
  • 0c24a60643 Drop the CONFORMING TO sections from the man pages. lm-sensors is in no way an official standard so it doesn't make much sense. Instead, use the 4th field of .TH to mention that these tools are part of lm-sensors. Jean Delvare 2007-08-23 08:14:48 +00:00
  • bf1ff10ab4 Relabel "sensors -u" from "unknown chip" to "raw chip". sensors uses generic code to display all the chips now so the notion of "unknown chip" no longer exists, however this raw output format can still be useful for debugging. Jean Delvare 2007-08-23 07:45:58 +00:00
  • 90c2942bef Drop sensors option -U, --hide-unknown. libsensors no longer exposes chips with no features, and it builds the features list dynamically, so applications no longer get to see unknown chips. Jean Delvare 2007-08-22 18:43:48 +00:00
  • a30d37899f Drop SENSORS_MODE_NO_RW and SENSORS_MODE_RW. The mode is a bitfield, we typically set, or test for, a specific bit. Jean Delvare 2007-08-22 17:07:11 +00:00
  • b0fb417996 sensors_get_value() and sensors_set_value(), respectively. The new names better reflect what the functions do. Jean Delvare 2007-08-22 17:06:13 +00:00
  • 8bcdc331a0 Change the prototype of sensors_get_label(). Errors can be reported with a NULL pointer. Jean Delvare 2007-08-22 17:05:01 +00:00
  • 12655c1d85 Drop support for reloading the configuration with sensors_init(). Instead, the application will have to call sensors_exit() explicitly before calling sensors_init() again. Most applications don't offer any way to reload the configuration file, so better optimize for the initial load. Jean Delvare 2007-08-22 17:04:12 +00:00
  • fe165fea49 Fix error message. Jean Delvare 2007-08-21 09:08:52 +00:00
  • e6110c7e18 Fix error message. Jean Delvare 2007-08-21 09:07:32 +00:00
  • 5741c56213 Contrary to what the comment says, sensors_proc_bus_count may be a perfectly valid bus number. We need to use a different value for chip configuration entries we want to ignore. Jean Delvare 2007-08-19 15:27:14 +00:00
  • 5524486161 Add support for hardware monitoring chips on SPI buses. Jean Delvare 2007-08-19 15:07:05 +00:00
  • f1cc941e29 Contrary to what the comment says, sensors_proc_bus_count may be a perfectly valid bus number. We need to use a different value for chip configuration entries we want to ignore. Jean Delvare 2007-08-19 15:05:52 +00:00
  • a74addb5d4 Support more bus types (part 2 of 2). Originally libsensors was very i2c-centric. Make it more neutral so that we can cleanly support additional bus types such as SPI or One-Wire. Jean Delvare 2007-08-19 15:04:29 +00:00
  • 7ee15371df Support more bus types (part 1 of 2). Originally libsensors was very i2c-centric. Make it more neutral so that we can cleanly support additional bus types such as SPI or One-Wire. Jean Delvare 2007-08-19 15:03:50 +00:00
  • af2880326f Drop chip names including dashes, as these are no longer supported. Jean Delvare 2007-08-19 14:18:52 +00:00
  • de4eca1ff7 Fix a broken comment. Jean Delvare 2007-08-18 06:58:33 +00:00
  • a692aed705 Fix a broken comment. Jean Delvare 2007-08-18 06:56:06 +00:00
  • 4695755d89 Drop unneeded frees. Jean Delvare 2007-08-17 21:11:57 +00:00
  • 557feb2696 Fix error message when a chip is specified on the command line with no prefix and that chip isn't found. Jean Delvare 2007-08-17 11:36:01 +00:00
  • e814a5931b Fix error message when a chip is specified on the command line with no prefix and that chip isn't found. Jean Delvare 2007-08-17 11:30:25 +00:00
  • 8901084a95 Typo and white space cleanps. Jean Delvare 2007-08-16 17:49:50 +00:00
  • da7fbf5b70 Reindent and cleanup. Jean Delvare 2007-08-16 16:18:18 +00:00
  • f430b0991a Chip types can no longer contain dashes. This makes it possible to rewrite sensors_parse_chip_name() with a simpler algorithm. The new code is smaller by about one third, and twice as fast on average (5 times as fast in the most frequent case "foo-*".) Jean Delvare 2007-08-16 10:06:35 +00:00
  • edb42b3c16 Add a new function to libsensors doing the opposite of sensors_parse_chip_name(). sensors_snprintf_chip_name() converts a chip name from its internal representation to a human readable string. So far, each user program had to reimplement this function. Jean Delvare 2007-08-16 10:04:57 +00:00
  • 493d9b27f5 Use strtoul() instead of parsing integers on our own. Jean Delvare 2007-08-16 09:58:44 +00:00
  • e9fccf7d01 Don't handle the isa bus in sensors_parse_i2cbus_name(). We really don't need to, as there is a single ISA bus, there's no need for substituting anything. Jean Delvare 2007-08-16 09:57:56 +00:00
  • 8896ba3b1f Rename sensors_chip_name.busname to path, as this is what we are using it for by now. Jean Delvare 2007-08-16 09:56:07 +00:00
  • b52225ffc0 Drop support for "dummy" bus type. The kernel no longer supports such fake i2c buses, so neither should we. Instead, non-i2c buses are handled explicitly. Jean Delvare 2007-08-16 09:54:53 +00:00
  • 6bf63e0f7a License fix. Jean Delvare 2007-08-15 08:23:38 +00:00
  • 62007a3eaf License fix. Jean Delvare 2007-08-15 08:23:15 +00:00
  • 3b25c8dc22 Pass structures by reference in sensors and sensord, again for a small performance gain and better consistency with the new libsensors API. Jean Delvare 2007-08-13 20:19:44 +00:00
  • d9ec11a6c7 Pass the structures by reference inside libsensors. Again a small performance gain, and this makes the internal code consistent with the public functions. Jean Delvare 2007-08-13 20:16:42 +00:00
  • 3bab00fff9 Change the libsensors API so that all structures are passed by reference. This is more efficient that way. Jean Delvare 2007-08-13 20:16:03 +00:00
  • 69757bcc20 Add FSC Heimdall, Poseidon II detection, change Poseidon I label from just plain Poseidon to Poseidon I Hans de Goede 2007-08-13 20:11:02 +00:00
  • 3dd7d2d9a5 Add FSC Heimdall, Poseidon II detection, change Poseidon I label from just plain Poseidon to Poseidon I Hans de Goede 2007-08-13 20:08:14 +00:00