{ "info": { "author": "Tim Savannah", "author_email": "kata198@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Operating System :: POSIX :: Linux", "Topic :: System :: Operating System Kernels :: Linux" ], "description": "printk-timestamp-formatter\n==========================\n\nUtilities to view kmsg/printk/dmesg timestamps in local time and date, UTC, or epoch seconds, which **account for drift.**\n\nThe printk clock drifts, often a lot, from the local clock (the one ntp feeds). This can cause radically different and incorrect values if directly converted (like with dmesg -T available on some dmesg). This application supports noting and marking drift and using that to calculate much more accurate timestamps.\n\n\nWhy not \"dmesg -T\"\n------------------\n\nAs noted, dmesg -T is the same as dmesg\\_format\\_dates --drift=0 and become inaccurate over time, because the tick clock is affected by frequency scaling etc.\n\nThus, it is recommended to have a cron job that runs *printk\\_mark\\_drift* as described below, maybe on half-day intervals to keep things accurate. More or less depending on precision desired and average drift of system.\n\nYou can use the *dmesg\\_get\\_drifts* application to show all current marked drifts to gauge how inaccurate your systems clock is.\n\n\nSample\n------\n\nHere is a sample showing the inaccuracies that can creep in:\n\nFirst, show that dmesg can't handle the printk drift\n\n\t[cmd]$ date; sudo bash \\-c 'echo \"Hello World\" > /dev/kmsg'; dmesg \\-T | grep 'Hello World' | tail \\-n1\n\n\tWed Sep 9 01:13:56 EDT 2015\n\n\t[Wed Sep 9 01:14:31 2015] Hello World\n\nNext, show that dmesg\\_format\\_dates does work with the printk drifts\n\n\t[cmd]$ date; sudo bash \\-c 'echo \"Hello World\" > /dev/kmsg'; ./dmesg\\_format\\_dates | grep 'Hello World' | tail \\-n1\n\n\tWed Sep 9 01:14:11 EDT 2015\n\n\t[Wed Sep 9 01:14:11 2015] Hello World\n\n\nApplications\n------------\n\n\n**dmesg\\_format\\_dates**\n\nThis application runs \"dmesg\" (or you can pipe in a pre-recorded dmesg, e.g. from logs) and uses the calculated drifts to derive accurate timestamps.\n\n\nRun this command to output the kernel log replacing the printk timestamps with calculated timestamps (in one of several formats), taking into account drift.\n\n\n*Output*\n\nSupported output modes are:\n\n\n* **Local Time** (DEFAULT) \\-l or \\-\\-local . Standard \"ctime\" format including local timezone information\n\n* **UTC** \\-u or \\-\\-utc . Standard \"ctime\" format given in UTC (no timezone, also known as GMT or Zulu)\n\n* **Epoch** \\-e or \\-\\-epoch . UNIX Epoch time. Given as number of seconds since Jan 1 1970\n\n\n*Subseconds*\n\nThe output for local time and UTC are given in ctime format, which has a resolution of 1 second.\n\nYou may also pass *\\-s* or *\\-\\-subsec* to add subseconds to the output.\n\nThis will output 2 significant digits of subseconds (accuracy +- 10ms) which is the maximum available from the uptime clock.\n\nEpoch mode always outputs subseconds.\n\n\n**printk\\_mark\\_drift**\n\nAdds a drift marker to the kmsg log. These are used to calculate the drift. The more of these you have, the more accurate your timestamps are within.\n\nYou should consider having a cron job mark the log every couple hours to get up-to-the-second accuracy when using dmesg\\_format\\_dates\n\n\n**dmesg\\_get\\_drifts**\n\nThis application will show the drifts within the dmesg log (the timestamp, how much the clock has drifted at that point).\n\nUse this to analyize how much your machine is drifting to determine how often you should be marking the drifts (for accurate timestamps)\n\n\n**printk\\_time\\_convert**\n\nThis application takes a single timestamp and converts it to either a local ctime, utc ctime, or epoch timestamp. It will add a drift note if a recent one is not available.\n\n\n*Output*\n\nOutput modes for printk\\_time\\_convert are the same as dmesg\\_format\\_dates. See above for usage options, or \\-\\-help.\n\n\n**How can I configure my kmsg to log timestamps?**\n\nSet the value of /sys/module/printk/parameters/time to \"Y\" (e.x. echo \"Y\" > /sys/module/printk/parameters/time)\n\n\n\nModule\n------\n\nThis package provides printk\\_timestamp\\_converter which is a python module you can use directly.\n\nThe pydoc documentation is available here: http://htmlpreview.github.io/?https://github.com/kata198/printk-timestamp-formatter/blob/master/doc/printk_timestamp_converter.html", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kata198/printk-timestamp-converter", "keywords": "printk,timestamp,date,convert,drift,converter,dmesg,kmsg", "license": "LGPLv2", "maintainer": "Tim Savannah", "maintainer_email": "kata198@gmail.com", "name": "printk-timestamp-converter", "package_url": "https://pypi.org/project/printk-timestamp-converter/", "platform": "", "project_url": "https://pypi.org/project/printk-timestamp-converter/", "project_urls": { "Homepage": "https://github.com/kata198/printk-timestamp-converter" }, "release_url": "https://pypi.org/project/printk-timestamp-converter/4.0.0/", "requires_dist": null, "requires_python": "", "summary": "Utility for printing dmesg/kmsg/printk timestamps, taking into account drift.", "version": "4.0.0" }, "last_serial": 4136517, "releases": { "2.1.0": [ { "comment_text": "", "digests": { "md5": "bbeb947911a56d50cb52c88e6a4391c8", "sha256": "f6a7d2f0394e6a40302ee2bbbb6d53cb38e96fbee05cf6687afdc1da4b0bce89" }, "downloads": -1, "filename": "printk-timestamp-converter-2.1.0.tar.gz", "has_sig": false, "md5_digest": "bbeb947911a56d50cb52c88e6a4391c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8681, "upload_time": "2016-01-16T20:44:15", "url": "https://files.pythonhosted.org/packages/9a/ec/a0ec514b058a88373c6e594129c110b626e60756518c7d3eb24b7184e175/printk-timestamp-converter-2.1.0.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "9b578f254f33c95b86d243eec7600e4b", "sha256": "af3564d9f2a79b1c740ae880923a0999586765cca725ab86104f92af571b1398" }, "downloads": -1, "filename": "printk-timestamp-converter-2.1.1.tar.gz", "has_sig": false, "md5_digest": "9b578f254f33c95b86d243eec7600e4b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8669, "upload_time": "2016-01-16T20:45:44", "url": "https://files.pythonhosted.org/packages/81/db/7ec6cd9a03a9d1f5ff1c5ed4c543de3cc6af66a1ae8c4bff9721e89e5e3e/printk-timestamp-converter-2.1.1.tar.gz" } ], "2.2.0": [ { "comment_text": "", "digests": { "md5": "e5ad173ba4215694aa1e7873adf64702", "sha256": "4df63ca31cb64817ed024f312be4516c34e904fca1185405114a330a8385180a" }, "downloads": -1, "filename": "printk-timestamp-converter-2.2.0.tar.gz", "has_sig": false, "md5_digest": "e5ad173ba4215694aa1e7873adf64702", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13144, "upload_time": "2016-01-16T21:35:31", "url": "https://files.pythonhosted.org/packages/73/57/0b9c5b4c5d3172db658e95a0080b9b2beec4a5f6cf242497407c3a4fd4e0/printk-timestamp-converter-2.2.0.tar.gz" } ], "2.2.1": [ { "comment_text": "", "digests": { "md5": "7b37751c77e199dc5339a7d7024688aa", "sha256": "796f13098f69334acf967d7d39bdbd062aba0c52a5ec168119497e93972a5a80" }, "downloads": -1, "filename": "printk-timestamp-converter-2.2.1.tar.gz", "has_sig": false, "md5_digest": "7b37751c77e199dc5339a7d7024688aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13516, "upload_time": "2016-03-03T19:08:03", "url": "https://files.pythonhosted.org/packages/a7/3b/5032980e093b6155f2c4798415b6302355497ebd38ca3c18ca421c695a06/printk-timestamp-converter-2.2.1.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "7f51557e86e87a2e964a3f84c10e8211", "sha256": "ab803b6e83bb54e3dc929d1e12978edeb5305cd7a91433ca9d22f3d616ab83a7" }, "downloads": -1, "filename": "printk-timestamp-converter-3.0.0.tar.gz", "has_sig": false, "md5_digest": "7f51557e86e87a2e964a3f84c10e8211", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17741, "upload_time": "2017-09-01T02:23:23", "url": "https://files.pythonhosted.org/packages/a0/97/e17900949d8717e0468b1ff89b1b64b7f392e402d59d9f5e2de6634f0782/printk-timestamp-converter-3.0.0.tar.gz" } ], "4.0.0": [ { "comment_text": "", "digests": { "md5": "5c60909133964ec7680204c40f0fb331", "sha256": "605a74e70e81eae62ce3783149b371f010f3134eaefc928fd2f919998d3767c0" }, "downloads": -1, "filename": "printk-timestamp-converter-4.0.0.tar.gz", "has_sig": false, "md5_digest": "5c60909133964ec7680204c40f0fb331", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21732, "upload_time": "2018-08-05T02:04:27", "url": "https://files.pythonhosted.org/packages/de/19/b74ead0d7e103a68a2056bdbeb69a1c74d653a4d3edf83cbaf8e0792bd24/printk-timestamp-converter-4.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5c60909133964ec7680204c40f0fb331", "sha256": "605a74e70e81eae62ce3783149b371f010f3134eaefc928fd2f919998d3767c0" }, "downloads": -1, "filename": "printk-timestamp-converter-4.0.0.tar.gz", "has_sig": false, "md5_digest": "5c60909133964ec7680204c40f0fb331", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21732, "upload_time": "2018-08-05T02:04:27", "url": "https://files.pythonhosted.org/packages/de/19/b74ead0d7e103a68a2056bdbeb69a1c74d653a4d3edf83cbaf8e0792bd24/printk-timestamp-converter-4.0.0.tar.gz" } ] }