{"id":15007464,"url":"https://github.com/aishpant/attribute-documentation","last_synced_at":"2025-10-05T16:33:57.554Z","repository":{"id":57407795,"uuid":"123024620","full_name":"aishpant/attribute-documentation","owner":"aishpant","description":"Helper tool for generating Linux Kernel sysfs attribute documentation.","archived":false,"fork":false,"pushed_at":"2018-04-09T14:37:10.000Z","size":62,"stargazers_count":5,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T01:22:45.391Z","etag":null,"topics":["coccinelle","documentation","linux","linux-kernel","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aishpant.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-26T20:12:37.000Z","updated_at":"2020-06-29T13:48:02.000Z","dependencies_parsed_at":"2022-09-26T17:10:20.747Z","dependency_job_id":null,"html_url":"https://github.com/aishpant/attribute-documentation","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/aishpant/attribute-documentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishpant%2Fattribute-documentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishpant%2Fattribute-documentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishpant%2Fattribute-documentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishpant%2Fattribute-documentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aishpant","download_url":"https://codeload.github.com/aishpant/attribute-documentation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishpant%2Fattribute-documentation/sbom","scorecard":{"id":173827,"data":{"date":"2025-08-11","repo":{"name":"github.com/aishpant/attribute-documentation","commit":"03689111c41e3aaaf52a9a62d09c002e352f9610"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T17:13:14.211Z","repository_id":57407795,"created_at":"2025-08-16T17:13:14.211Z","updated_at":"2025-08-16T17:13:14.211Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278484879,"owners_count":25994934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coccinelle","documentation","linux","linux-kernel","python"],"created_at":"2024-09-24T19:10:09.141Z","updated_at":"2025-10-05T16:33:57.523Z","avatar_url":"https://github.com/aishpant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"attribute documentation\n-----------------------\n\n`abi2doc` is a helper tool for generating and formatting sysfs attribute\ndocumentation which is location under ``Documentation/ABI``\\  in the kernel\nsource code.\n\nFrom a `rough estimate`_, there are around 2000 attributes that are undocumented\nin the kernel.\n\n.. image:: https://plot.ly/~aishpant/1.png?share_key=8mG4JmyySLLYjbjTg7Uy62\n   :target: https://plot.ly/~aishpant/1/?share_key=8mG4JmyySLLYjbjTg7Uy62\n   :align: center\n   :alt: sysfs line plot\n   :width: 600px\n\nThe ABI documentation format looks like the following:\n\n| What: (the full sysfs path of the attribute)\n| Date: (date of creation)\n| KernelVersion: (kernel version it first showed up in)\n| Contact: (primary contact)\n| Description: (long description on usage)\n\n`abi2doc` can fill in the '`Date`' and the '`KernelVersion`' fields with high\naccuracy. The '`Contact`' details is prompted for once, and the others '`What`'\nand '`Description`' are prompted on every attribute.\n\nIt also tries to collect description from various sources-\n\n-  From the commit message that introduced the attribute\n\n-  From comments around the attribute show/store functions or the attribute\n  declaring macro.\n\n-  From the structure fields that map to the attribute.\n   \n   For eg. consider the attribute declaring macro `PORT_RO(dest_id)` and its\n   show function `port_destid_show(...)`.\n\n  .. code:: c\n\n            static ssize_t\n            port_destid_show(struct device *dev, struct device_attribute *attr,\n                             char *buf)\n            {\n                    struct rio_mport *mport = to_rio_mport(dev);\n\n                    if (mport)\n                            return sprintf(buf, \"0x%04x\\n\", mport-\u003ehost_deviceid);\n                    else\n                            return -ENODEV;\n            }\n\n\n\n  The show functions typically contain a conversion to a driver private struct\n  and then one or many fields from it are put in the buffer. \n\n  In the example above, the driver private structure is a struct of type\n  `rio_mport` and the attribute `port_id` maps to the field `host_deviceid` in\n  the structure.\n\n  .. code:: c\n\n      struct rio_mport {\n            ...\n            int host_deviceid;      /* Host device ID */\n            struct rio_ops *ops;    /* low-level architecture-dependent routines */\n            unsigned char id;       /* port ID, unique among all ports */\n            ...\n            };\n\n  There's a comment against `host_deviceid` here and this can be extracted.\n\nAll sysfs attribute declaring macros are located in ``abi2doc/macros.txt``. Each\nrow of `macros.txt` contains an attribute declaring macro space separated by the\nlocation of the attribute name in the macro - `DEVICE_ATTR 0`. This list is not\ncomplete. Please send a pull request if you find any that are not in the list.\n\nUsage\n-----\n\nPrerequisites:\n\n-  Coccinelle - `install instructions`_\n  spatch will need to be compiled with option `./configure --with-python=python3`\n-  Python 3\n-  Linux Kernel source code\n\n`abi2doc` is available on `PYPI`_. Install with ``pip3``:\n\n  ``pip3 install abi2doc``\n\nThe library is currently tested against Python versions `3.4+`.\n\n.. code:: bash\n\n    usage: abi2doc [-h] -f SOURCE_FILE -o OUTPUT_FILE\n\n    Helper for documenting Linux Kernel sysfs attributes\n\n    required arguments:\n      -f SOURCE_FILE  linux source file to document\n      -o OUTPUT_FILE  location of the generated sysfs ABI documentation\n\n    optional arguments:\n      -h, --help      show this help message and exit\n\nExample usage:\n\n.. code:: bash\n\n    abi2doc -f drivers/video/backlight/lp855x_bl.c -o sysfs_doc.txt\n\nThe script will fill in the '`Date`' and the '`KernelVersion`' fields for found\nattributes. The '`Contact`' details is prompted for once, and the others 'What'\nand '`Description`' are prompted on every attribute. The entered description\nwill be followed by hints, as shown in a generated file below.\n\n::\n\n    What:       /sys/class/backlight/\u003cbacklight\u003e/bled_mode\n    Date:       Oct, 2012\n    KernelVersion:  3.7\n    Contact:    dri-devel@lists.freedesktop.org\n    Description:\n            (WO) Write to the backlight mapping mode. The backlight current\n            can be mapped for either exponential (value \"0\") or linear\n            mapping modes (default).\n            --------------------------------\n            %%%%% Hints below %%%%%\n            bled_mode DEVICE_ATTR drivers/video/backlight/lm3639_bl.c 220\n            --------------------------------\n            %%%%% store fn comments %%%%%\n            /* backlight mapping mode */\n            --------------------------------\n            %%%%% commit message %%%%%\n            commit 0f59858d511960caefb42c4535dc73c2c5f3136c\n            Author: G.Shark Jeong \u003cgshark.jeong@gmail.com\u003e\n            Date:   Thu Oct 4 17:12:55 2012 -0700\n\n                backlight: add new lm3639 backlight driver\n\n                This driver is a general version for LM3639 backlgiht + flash driver chip\n                of TI.\n\n                LM3639:\n                The LM3639 is a single chip LCD Display Backlight driver + white LED\n                Camera driver.  Programming is done over an I2C compatible interface.\n                www.ti.com\n\n                [akpm@linux-foundation.org: code layout tweaks]\n                Signed-off-by: G.Shark Jeong \u003cgshark.jeong@gmail.com\u003e\n                Cc: Richard Purdie \u003crpurdie@rpsys.net\u003e\n                Cc: Daniel Jeong \u003cdaniel.jeong@ti.com\u003e\n                Cc: Randy Dunlap \u003crdunlap@xenotime.net\u003e\n                Signed-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\n                Signed-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n\nExpected time for the scripts to run =\n\n  `(num of attrs x avg 4 min per attr)/num of cores`.\n\nContributions\n-------------\n\nContributions are welcome, whether it is in the form of code or documentation.\nPlease refer to the `issues`_ tab for places that need help.\n\n.. _install instructions: https://github.com/coccinelle/coccinelle/\n.. _PYPI: https://pypi.org/project/abi2doc/\n.. _Coccinelle: http://coccinelle.lip6.fr/\n.. _rough estimate: https://github.com/aishpant/documentation-scripts/blob/master/result/output.csv\n.. _issues: https://github.com/aishpant/attribute-documentation/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faishpant%2Fattribute-documentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faishpant%2Fattribute-documentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faishpant%2Fattribute-documentation/lists"}