{ "info": { "author": "Aishwarya Pant", "author_email": "aishpant@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "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->host_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//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 \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 \n Cc: Richard Purdie \n Cc: Daniel Jeong \n Cc: Randy Dunlap \n Signed-off-by: Andrew Morton \n Signed-off-by: Linus Torvalds \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", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/aishpant/attribute-documentation/archive/1.6.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aishpant/attribute-documentation", "keywords": "documentation sysfs linux", "license": "GPLv2", "maintainer": "", "maintainer_email": "", "name": "abi2doc", "package_url": "https://pypi.org/project/abi2doc/", "platform": "", "project_url": "https://pypi.org/project/abi2doc/", "project_urls": { "Download": "https://github.com/aishpant/attribute-documentation/archive/1.6.tar.gz", "Homepage": "https://github.com/aishpant/attribute-documentation" }, "release_url": "https://pypi.org/project/abi2doc/1.6/", "requires_dist": null, "requires_python": ">=3", "summary": "Linux Kernel sysfs attribute documentation generator", "version": "1.6" }, "last_serial": 3748899, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "999ecfbc3c63478e68c0766b91a5e632", "sha256": "02b5c6ee9ce163708364a5972910e3171a144e33639ce529c4fd91ed173b5f9d" }, "downloads": -1, "filename": "abi2doc-0.1-py3.6.egg", "has_sig": false, "md5_digest": "999ecfbc3c63478e68c0766b91a5e632", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 25914, "upload_time": "2018-03-04T13:25:10", "url": "https://files.pythonhosted.org/packages/7e/58/af68175a0ccc8fd867448c3e2eb581220a26c8d5ca795e650e82449468ff/abi2doc-0.1-py3.6.egg" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "da8eece9d82dc8f300e53f8149648674", "sha256": "091bc791d9b6c3551a21240ec06b375f76b1d75e0ed9b1b8cea63f2f6ac60586" }, "downloads": -1, "filename": "abi2doc-0.3-py3.6.egg", "has_sig": false, "md5_digest": "da8eece9d82dc8f300e53f8149648674", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 28584, "upload_time": "2018-03-04T15:43:03", "url": "https://files.pythonhosted.org/packages/8a/4a/ef31da5be14435b4c934dc197824c41f1a4b43f4d7258282414f648aa319/abi2doc-0.3-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "692ba580cee82d359a32493487ea6543", "sha256": "c1b6a8d834152662c6317cf880ca2800078f23ac5349d5e33860e43d5a3a1487" }, "downloads": -1, "filename": "abi2doc-0.3.tar.gz", "has_sig": false, "md5_digest": "692ba580cee82d359a32493487ea6543", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21627, "upload_time": "2018-03-04T15:43:05", "url": "https://files.pythonhosted.org/packages/77/73/eaefc0e500926a9801bf5bdc84815e8324d4be879e33487fcc03e58defe1/abi2doc-0.3.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "51740bf286772cff28eea4b69181257e", "sha256": "fc649fe3f0ce3f6c4b681f5b6d7773137cb856f4ad4ac0514fdd6998e6b16c04" }, "downloads": -1, "filename": "abi2doc-1.0.tar.gz", "has_sig": false, "md5_digest": "51740bf286772cff28eea4b69181257e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21618, "upload_time": "2018-03-04T15:43:07", "url": "https://files.pythonhosted.org/packages/67/78/3079deb1702271e3e4d736521d290b931e5e0fcc5bed50e07cadb710b29f/abi2doc-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "8a529278b7837ffe3d564cd45edc90b0", "sha256": "e260f3013a894f99e1ef27bfe3a8a1ee308f0575c0b4a1cc64c5334d7f5b2eb8" }, "downloads": -1, "filename": "abi2doc-1.1.tar.gz", "has_sig": false, "md5_digest": "8a529278b7837ffe3d564cd45edc90b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21608, "upload_time": "2018-03-04T18:29:36", "url": "https://files.pythonhosted.org/packages/e3/2a/5313c50229f1596f5eb68e739402ecd94f12ff4c18d4cca379d2c1c01ebe/abi2doc-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "7be479c55e51ef2afbfc031e5bf43c0d", "sha256": "b4bd88a584074211aa4e43ab8fe3acdaf051f2badf322a65ab10e5899d28dc61" }, "downloads": -1, "filename": "abi2doc-1.2.tar.gz", "has_sig": false, "md5_digest": "7be479c55e51ef2afbfc031e5bf43c0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21786, "upload_time": "2018-03-05T07:01:45", "url": "https://files.pythonhosted.org/packages/69/82/e75854c41cc1062be30f4f94aa8ed8d50dd721a3999845da22fe4e757cdd/abi2doc-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "1151671607b524e8b0a50ec6c477bfd9", "sha256": "4a3227287a631bd813f72d123d73c43e2ab7ede488c7c2b560d80e0920c51142" }, "downloads": -1, "filename": "abi2doc-1.3.tar.gz", "has_sig": false, "md5_digest": "1151671607b524e8b0a50ec6c477bfd9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 24773, "upload_time": "2018-03-05T07:17:29", "url": "https://files.pythonhosted.org/packages/ea/bf/e9aa34af7e66cc2dac7f967d10386c3883095051a20a176dfc795546f91e/abi2doc-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "253ccc60338dd21f2998d1b4fe7b580a", "sha256": "fa10e316c9347b5588833c7a052d792d3cd959f11d48d54504733b0f1243f92c" }, "downloads": -1, "filename": "abi2doc-1.4.tar.gz", "has_sig": false, "md5_digest": "253ccc60338dd21f2998d1b4fe7b580a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 24517, "upload_time": "2018-03-05T11:01:45", "url": "https://files.pythonhosted.org/packages/a0/a5/8bc29ce6a3ad518eccfd114ac0301de3795b960ecb0e95512ebaf4294afc/abi2doc-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "1cf1653a395058d8a40648c8a7904e49", "sha256": "5b2e986e49fc64b139055fb9520e1c8eb95254857746a176442ccdb6fe9f3879" }, "downloads": -1, "filename": "abi2doc-1.5.tar.gz", "has_sig": false, "md5_digest": "1cf1653a395058d8a40648c8a7904e49", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 24575, "upload_time": "2018-03-07T06:36:48", "url": "https://files.pythonhosted.org/packages/81/77/4e34822c8d069d112946f180f352c20e9fe83f62f8230e711e4b2d07c0d1/abi2doc-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "1c139b357871fd89ffa1f2296dde0b08", "sha256": "125f2be4f921539f233d062b87fe1596d3970c07b29ea1dc61f8db197ecc53ef" }, "downloads": -1, "filename": "abi2doc-1.6.tar.gz", "has_sig": false, "md5_digest": "1c139b357871fd89ffa1f2296dde0b08", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 24091, "upload_time": "2018-04-09T14:38:03", "url": "https://files.pythonhosted.org/packages/2d/a4/135b747dca76740097e86ad18d9c4d3d735734ea7207ba21de855aea8757/abi2doc-1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1c139b357871fd89ffa1f2296dde0b08", "sha256": "125f2be4f921539f233d062b87fe1596d3970c07b29ea1dc61f8db197ecc53ef" }, "downloads": -1, "filename": "abi2doc-1.6.tar.gz", "has_sig": false, "md5_digest": "1c139b357871fd89ffa1f2296dde0b08", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 24091, "upload_time": "2018-04-09T14:38:03", "url": "https://files.pythonhosted.org/packages/2d/a4/135b747dca76740097e86ad18d9c4d3d735734ea7207ba21de855aea8757/abi2doc-1.6.tar.gz" } ] }