<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:34:40 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-17343] mechanism to resolve &apos;lctl get_param&apos; parameters to pathnames</title>
                <link>https://jira.whamcloud.com/browse/LU-17343</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;The &quot;&lt;tt&gt;lctl get_param&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;lctl list_param&lt;/tt&gt;&quot; commands allow resolving and dumping Lustre parameters and statistics in a simple manner, as it handles the internal details of where the parameters are stored.  &lt;/p&gt;

&lt;p&gt;Due to ongoing changes in the kernel policies on where parameters are located, the actual pathname of a parameter/stats file may change by kernel and Lustre release.  Originally, parameters were all under &quot;&lt;tt&gt;/proc/fs/lustre&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;/proc/net/lnet&lt;/tt&gt;&quot;, but then &quot;&lt;tt&gt;/proc&lt;/tt&gt;&quot; usage was deprecated so many parameters moved to &quot;&lt;tt&gt;/sys/fs/lustre&lt;/tt&gt;&quot;, but this is constrained to being simple &quot;&lt;tt&gt;name=value&lt;/tt&gt;&quot; pairs, and &quot;complex&quot; (multi-value, multi-line) parameters were moved to &quot;&lt;tt&gt;/sys/kernel/debug/lustre&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;/sys/kernel/debug/lnet&lt;/tt&gt;&quot;.  Unfortunately, the kernel changed the access policy for &quot;&lt;tt&gt;/sys/kernel/debug&lt;/tt&gt;&quot; to be accessible only to the &lt;tt&gt;root&lt;/tt&gt; user, and as such any data collection tools must also run as root in order to access these statistics, until such a time we create our own &quot;&lt;tt&gt;lprocfs&lt;/tt&gt;&quot; to hold statistics and allow them to be accessed by non-root users.&lt;/p&gt;


&lt;p&gt;In the meantime, for tools that monitor Lustre statistics, it is desirable to avoid the overhead of &quot;&lt;tt&gt;lctl get_param&lt;/tt&gt;&quot; trying to do multiple pathname resolutions each time a parameter is accessed, which might be once per second or more.  This drives the tools to hard-code the direct parameter pathnames into the tool instead of using &quot;&lt;tt&gt;lctl get_param&lt;/tt&gt;&quot; to access the parameters, which is fragile and may break between releases.&lt;/p&gt;

&lt;p&gt;It is desirable to have a mechanism to &quot;resolve&quot; parameter/stats pathnames for the currently-running Lustre version so that they can be used directly, without hard coding them.  To do this, it would be useful to have an option &quot;&lt;tt&gt;lctl get_param &lt;span class=&quot;error&quot;&gt;&amp;#91;-p|--path&amp;#93;&lt;/span&gt; PARAM&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;lctl list_param &lt;span class=&quot;error&quot;&gt;&amp;#91;-p|--path&amp;#93;&lt;/span&gt; PARAM&lt;/tt&gt;&quot; that prints the actual pathname(s) for &lt;tt&gt;PARAM&lt;/tt&gt; instead of the value.&lt;/p&gt;

&lt;p&gt;There is already a function &quot;&lt;tt&gt;llapi_param_get_paths()&lt;/tt&gt;&quot; that is available to resolve the parameter name to one or more pathnames, but it needs the &quot;&lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;-p|--path&amp;#93;&lt;/span&gt;&lt;/tt&gt;&quot; option implemented to allow printing these pathnames to stdout for use by the monitoring tools.&lt;/p&gt;</description>
                <environment></environment>
        <key id="79398">LU-17343</key>
            <summary>mechanism to resolve &apos;lctl get_param&apos; parameters to pathnames</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>easy</label>
                    </labels>
                <created>Thu, 7 Dec 2023 18:22:23 +0000</created>
                <updated>Mon, 29 Jan 2024 19:04:09 +0000</updated>
                                            <version>Lustre 2.16.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="395914" author="adilger" created="Thu, 7 Dec 2023 20:18:15 +0000"  >&lt;p&gt;I think it would be a relatively simple change to the &lt;tt&gt;lctl&lt;/tt&gt; tool - basically just adding the parsing of the &quot;&lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;-p|--path&amp;#93;&lt;/span&gt;&lt;/tt&gt;&quot; option that works mostly like &quot;&lt;tt&gt;lctl get_param &amp;#45;N&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;lctl list_param&lt;/tt&gt;&quot;, but having it print the &lt;b&gt;pathname&lt;/b&gt; &lt;tt&gt;paths.gl_pathv&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt;&lt;/tt&gt; of the parameters directly instead of calling &lt;tt&gt;display_name()&lt;/tt&gt; to convert the parameters to the dot-separated format.&lt;/p&gt;

&lt;p&gt;There are some cleanups in the code that should be done, like rename &quot;&lt;tt&gt;po_only_path&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;po_show_path&lt;/tt&gt;&quot; to be &quot;&lt;tt&gt;po_only_name&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;po_show_name&lt;/tt&gt;&quot; and add a new &quot;&lt;tt&gt;po_only_pathname&lt;/tt&gt;&quot; (so it doesn&apos;t get confused with the old &quot;&lt;tt&gt;po_only/show_path&lt;/tt&gt;&quot;).  Similarly, a new &lt;tt&gt;LIST_PATHNAME&lt;/tt&gt; should be added to &lt;tt&gt;enum parameter_operation&lt;/tt&gt; to differentiate this from &lt;tt&gt;LIST_PARAM&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="395924" author="simmonsja" created="Thu, 7 Dec 2023 21:47:00 +0000"  >&lt;p&gt;Our tools never get love &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.whamcloud.com/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; The plan for stats is to implement an Netlink / libyaml approach to allow non-root to get stats. That doesn&apos;t have a path in the classic sense. I have something kind of working that I can push.&lt;/p&gt;</comment>
                            <comment id="396189" author="JIRAUSER16704" created="Mon, 11 Dec 2023 05:30:31 +0000"  >&lt;p&gt;This would be very useful for us.&lt;/p&gt;

&lt;p&gt;A long time ago when we wrote our tools, we looked at strace and the code and saw lctl was just doing it&apos;s own path resolution to open these files anyway, so we now just skip all of that and try to dynamically find the &quot;proc&quot; files directly outside of lctl.&#160;&lt;/p&gt;

&lt;p&gt;Being able to do &quot;lctl list_param -p -R ...&quot; and some caching + simple path heuristics would mean a lot less evil /proc and /sys path like calls would certainly save some CPU time and be a lot less messy.&lt;/p&gt;</comment>
                            <comment id="401703" author="adilger" created="Mon, 29 Jan 2024 19:04:09 +0000"  >&lt;blockquote&gt;
&lt;p&gt;The plan for stats is to implement an Netlink / libyaml approach to allow non-root to get stats. That doesn&apos;t have a path in the classic sense. I have something kind of working that I can push.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I think that is a much bigger pill than most developers are willing to swallow.  That requires adding a huge amount of complexity to the tools to manage Netlink and YAML, instead of &quot;open/read&quot;.  I think this change to dynamically discover the pathnames on the currently running system would be fairly easy to implement (either as an installation step to run a script and generate a config file that holds the pathnames for the stats files), or as a few-line change to run &quot;&lt;tt&gt;lctl list_param -p &lt;em&gt;PARAM&lt;/em&gt;&lt;/tt&gt;&quot; to generate the pathname at runtime instead of hard-coding the absolute pathname into the binary.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i04493:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>