Closed ofaaland closed 5 years ago
Hi Ned, Chris, and Brian, Would one of you mind reviewing this PR? One review is fine, so whoever goes first loses :).
This passes make check and hand-testing. It also works correctly on slag, which has both lustre 2.10 and lustre 2.12 file systems running. Thanks!
fixes: #35
Refreshed the patch to update the commit message. The patch checks /sys first and /proc second. Also added my assertion that the added I/O is relatively inexpensive.
cherry-picked to master as
Rather than always looking under /proc for a given subdirectory, look under /sys and then if that is not found, look under /proc. Use whichever path is found first.
This was done to allow lmt to find Lustre 2.12 metrics, some of which were moved to /sys, but with the path under /sys the same as the old path under /proc.
With this patch there are some additional stat() calls, so the metric does slightly more I/O than was required previously. However since these are stats of /proc or /sys files, they should be cheap. In return we have much less lustre-version specific code to handle this transition in the lustre codebase.