-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[collectd 6] src/mmc.c port to collectd 6 #4077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* mmc plugin: integrate into configure.ac The mmc plugin is not fully integrated in the configure.ac. Change that. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> * mmc plugin: Skip mmc paths in /sys that start with a '.' (like "." and "..") The plugin tries to (and obiously fails to) use "." and "..", that come out of listdir, as mmc devices. Filter these two out by skipping hidden files/directories. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> * mmc plugin: read standard eMMC 5.0 health metrics Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> * mmc plugin: remove type-name defines These defines can become confusing, especially when combined with the defines for attribute names in the sysfs. This will only get worse when more vendor-specific metrics are supported. Remove the defines and use the type names directly. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> * mmc plugin: remove sysfs-attribute defines These defines are used only once or twice and do not help with readability. Replace them with just the raw strings. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> * mmc plugin: port to libudev While using the sysfs directly works fine for the swissbit and generic eMMC driver it does not scale well to other vendor-specific interfaces where one has to open the block device in /dev to perform ioctls. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> * mmc plugin: add micron eMMC support While this patch was only tested with a single product (MTFC16GAPALBH) I am fairly confident that it will generalize to others as well, as micron themselves ship a single tool[1], which this patch uses as a reference, to read similar info from all of their eMMCs. This patch also increases the maximum value of mmc_bad_blocks to infinity, as it can be any 16 bit integer for micron eMMC but could be even larger for other vendors. [1]: https://github.com/arcus-smart-home/arcushubos/blob/master/meta-iris/recipes-core/iris-utils/files/emmcparm_1.0.c Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> * mmc plugin: add sandisk eMMC support While this patch was only tested with a single product (SDINBDG4-8G), I am fairly confident that it should generalize to other devices as well, as the current product portfolio on their website looks very similar to the one I tested and new devies will likely use a Western Digital manufacturer ID. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Udev rules can contain a "watch" option, which is described in the man page as: Watch the device node with inotify; when the node is closed after being opened for writing, a change uevent is synthesized. This watch option is enabled by default for all block devices[1]. The intention behind this is to be notified about changes to the partition table. The mmc plugin does however also need to open the block device for writing, even though it never modifies its content, in order to be able to issue ioctls with vendor defined MMC-commands. Reduce the amount of generated change events from one per read to one per collectd runtime by caching the open file descriptor. [1]: https://github.com/systemd/systemd/blob/ef2ad30aee9fa99b0fdb8fe7efda397513cec6af/rules.d/60-block.rules Fixes: 2f15c70 (mmc: add more vendor specific and generic data sources (collectd#4006)) Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
@elfiesmelfie Details link does not show what fails with the v6 RH el6_x86_64 build. Could you help? |
There appear to be some errors in building the mmc plugin:
Source: https://api.cirrus-ci.com/v1/task/4589352408317952/logs/build.log |
Thanks! I assume the missing kernel header to be causing also the other problems, as other builds went fine. What kernel is used by the RH EL6 build? |
EL6 is CentOS 6. Active support ended on 2017, and security support ended in 2020. There won't be updates, so perhaps we should remove it from CI. |
@mrunge Yes, definitely. Especially for v6 branch that does not have even a release yet. |
Hi, I was a bit surprised that this PR failed the CI run, as it is just a port of a plugin already in |
Yes, please! |
Alright then. While I was at it I've also picked some other changes and created #4084. Reviews welcome. |
CI failures are for |
ChangeLog: mmc plugin: Port to collectd 6
The
mmc
plugin was added to themain
branch after thecollectd-6
branch was split off.This PR:
mmc
plugin to themain
branch (see mmc: initial checkin #3887)This brings the plugin to feature parity with the
main
branch.