Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-13224

Expose lctl get/set/list param functionality in lustreapi

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • Lustre 2.14.0, Lustre 2.12.5
    • Lustre 2.10.8
    • RHEL 7.5
    • 9223372036854775807

    Description

      Allow applications that need to access the various lustre parameters in sysfs, profs, etc. to call a function from lustreapi.h that behaves similarly to "lctl get_param <param name>" and has the option to return data to any FILE*, so that it can be further processed by the calling application.

      The goal is to use the same infrastructure that allows lctl to know where the correct files are without having to create an lctl process for each get, set, and list operation.

      The target applications are those that need to continuously monitor lustre, such as LMT.

      Attachments

        Activity

          [LU-13224] Expose lctl get/set/list param functionality in lustreapi

          Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/38299
          Subject: LU-13224 utils: expose llapi_param* functions
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set: 1
          Commit: a3f90f10a23e14b07c9250e07b3aacc21757979d

          gerrit Gerrit Updater added a comment - Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/38299 Subject: LU-13224 utils: expose llapi_param* functions Project: fs/lustre-release Branch: b2_10 Current Patch Set: 1 Commit: a3f90f10a23e14b07c9250e07b3aacc21757979d

          Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/38239
          Subject: LU-13224 utils: expose llapi_param* functions
          Project: fs/lustre-release
          Branch: b2_12
          Current Patch Set: 1
          Commit: bbb9485b7d63c5aea42ad65e664b88d55a40da76

          gerrit Gerrit Updater added a comment - Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/38239 Subject: LU-13224 utils: expose llapi_param* functions Project: fs/lustre-release Branch: b2_12 Current Patch Set: 1 Commit: bbb9485b7d63c5aea42ad65e664b88d55a40da76

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37545/
          Subject: LU-13224 utils: expose llapi_param* functions
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 9b44cf70a95b2ee97a17697dc97fbe462ad1f5b9

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37545/ Subject: LU-13224 utils: expose llapi_param* functions Project: fs/lustre-release Branch: master Current Patch Set: Commit: 9b44cf70a95b2ee97a17697dc97fbe462ad1f5b9

          Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/38011
          Subject: LU-13224 utils: insignificant changes to compare tests.
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: a96243e315bede22a1bfbe934e21badf2e315e6e

          gerrit Gerrit Updater added a comment - Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/38011 Subject: LU-13224 utils: insignificant changes to compare tests. Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: a96243e315bede22a1bfbe934e21badf2e315e6e

          Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/37545
          Subject: LU-13224 utils: expose lctl functionality via lustreapi
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 4641f2b945b7f51fdd8783f0b8238a0f7c99551f

          gerrit Gerrit Updater added a comment - Gian-Carlo DeFazio (defazio1@llnl.gov) uploaded a new patch: https://review.whamcloud.com/37545 Subject: LU-13224 utils: expose lctl functionality via lustreapi Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 4641f2b945b7f51fdd8783f0b8238a0f7c99551f

          I'm OK with changing the get_lustre_param_{path,value}() interface slightly, since those are not officially supported APIs. The new function names should preferably be something like llapi_param_get_{path,value}() so the names are more closely related. Alternately, you could add a third interface like llapi_param_get_values() or llapi_param_get_all() that returns all of the fields. What might be even more helpful would be llapi_param_get_value_matching() that can parse out matching subfields of YAML data and return only the data from one field.

          adilger Andreas Dilger added a comment - I'm OK with changing the get_lustre_param_{path,value}() interface slightly, since those are not officially supported APIs. The new function names should preferably be something like llapi_param_get_{path,value}() so the names are more closely related. Alternately, you could add a third interface like llapi_param_get_values() or llapi_param_get_all() that returns all of the fields. What might be even more helpful would be llapi_param_get_value_matching() that can parse out matching subfields of YAML data and return only the data from one field.
          defazio Gian-Carlo Defazio added a comment - - edited

          get_lustre_param_path() and get_lustre_param_value() do most of what I'm looking for. However, get_lustre_param_value() reads only the first line of the first file that matches some pattern. I'd like a more flexible interface that can do some of what lctl does, such as reading all lines of all files that match. The solution I've come up with moves, and slightly modifies, some functions from lustre_cfg.c to liblustreapi.c and then exposes them using lustreapi.h.}}

          defazio Gian-Carlo Defazio added a comment - - edited get_lustre_param_path() and get_lustre_param_value() do most of what I'm looking for. However, get_lustre_param_value() reads only the first line of the first file that matches some pattern. I'd like a more flexible interface that can do some of what lctl does, such as reading all lines of all files that match. The solution I've come up with moves, and slightly modifies, some functions from lustre_cfg.c to liblustreapi.c and then exposes them using lustreapi.h.}}

          There are already functions in liblustreapi_param.c that do this, they just haven't been exposed publicly yet.

          Please take a look at get_lustre_param_path() and get_lustre_param_value(). If they seem suitable for your use, we can expose them as proper llapi_* functions. Otherwise, feedback is welcome.

          adilger Andreas Dilger added a comment - There are already functions in liblustreapi_param.c that do this, they just haven't been exposed publicly yet. Please take a look at get_lustre_param_path() and get_lustre_param_value() . If they seem suitable for your use, we can expose them as proper llapi_* functions. Otherwise, feedback is welcome.

          People

            defazio Gian-Carlo Defazio
            defazio Gian-Carlo Defazio
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: