Skip to content
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

Add support for several /sys/class/sas_* classes #453

Merged
merged 8 commits into from Dec 17, 2022

Commits on Jun 5, 2022

  1. Initial addition of several sysfs/class_sas* files, plus fixtures.

    These parse several SAS classes from /sys/class/
      - sas_host
      - sas_device
      - sas_end_device
      - sas_expander
      - sas_port
      - sas_phy
    
    The included fixtures include examples of all of these.
    
    Signed-off-by: Scott Laird <scott@sigkill.org>
    scottlaird committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    be5c03b View commit details
    Browse the repository at this point in the history
  2. Added block device discovery to class_sas_device, so we can go from a…

    … SAS device address to /dev/sd*.
    
    Note that the fixtures for this rev are still *way* too big; fixtures.ttar went from ~300k to 11M.  Cleaning that up is next.
    
    Signed-off-by: Scott Laird <scott@sigkill.org>
    scottlaird committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    b4f08e2 View commit details
    Browse the repository at this point in the history
  3. Shrank fixtures.ttar from 13M to 770k.

    Still about 2x larger than before, but *much* better than the previous commit.  There's a lot of additional SAS data included in /sys/devices, and there's a limit to how much smaller it can get without a lot of work and lost data.
    
    Signed-off-by: Scott Laird <scott@sigkill.org>
    scottlaird committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    01a8485 View commit details
    Browse the repository at this point in the history
  4. Code cleanups and gofmt run.

    I refactored the 3 different /sys/class entries in class_sas_device, because they're almost exactly the same except for the directory name and which devices are included in the directory.
    
    Signed-off-by: Scott Laird <scott@sigkill.org>
    scottlaird committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    494ce42 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2022

  1. Clean up SAS regexps and consts as per PR review.

    Signed-off-by: Scott Laird <scott@sigkill.org>
    scottlaird committed Jun 7, 2022
    Configuration menu
    Copy the full SHA
    6561ab2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4b9f004 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2022

  1. Fix a few bugs discovered while working on node_exporter code.

    We weren't populating a couple fields due to dumb errors.  Also, I'd failed to add end_device to SASPort, which is needed for block device discovery.
    
    Signed-off-by: Scott Laird <scott@sigkill.org>
    scottlaird committed Jun 8, 2022
    Configuration menu
    Copy the full SHA
    413a42d View commit details
    Browse the repository at this point in the history
  2. Add a few GetBy* functions to each SAS class to make lookups easier i…

    …n code that uses this library.
    
    Signed-off-by: Scott Laird <scott@sigkill.org>
    scottlaird committed Jun 8, 2022
    Configuration menu
    Copy the full SHA
    97a6236 View commit details
    Browse the repository at this point in the history