{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "ptracer -- a library for ptrace-based tracing of Python programs\n================================================================\n\n.. image:: https://travis-ci.org/pinterest/ptracer.svg?branch=master\n :target: https://travis-ci.org/pinterest/ptracer\n\nPtracer is a library providing on-demand system call tracing in Python\nprograms.\n\n\nBasic Usage\n-----------\n\n.. code-block:: python\n\n import traceback\n import ptracer\n\n def callback(syscall):\n print('{}({}) -> {}'.format(\n syscall.name,\n ', '.join(repr(arg.value) for arg in syscall.args),\n syscall.result.text))\n print('Traceback: ')\n print(''.join(traceback.format_list(syscall.traceback)))\n\n with ptracer.context(callback):\n open('/dev/null', 'wb')\n\n\nFiltering\n---------\n\nPtracer allows elaborate syscall filtering via the *filter* argument:\n\n.. code-block:: python\n\n flt = [\n ptracer.SysCallPattern(\n name='open',\n args=[\n re.compile(b'/tmp/.*'),\n lambda arg: arg.value & os.O_WRONLY\n ],\n result=lambda res: res.value > 0\n )\n ]\n\n with ptracer.context(callback, filter=flt):\n # traced code\n ...\n\n\nIn the above example, ptracer will invoke the callback only for successful\nattempts to open files in the \"/tmp\" directory for writing.\n\n\nDocumentation\n-------------\n\nThe documentation is available on\n`ptracer.readthedocs.io `_.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "ptracer", "package_url": "https://pypi.org/project/ptracer/", "platform": "POSIX", "project_url": "https://pypi.org/project/ptracer/", "project_urls": null, "release_url": "https://pypi.org/project/ptracer/0.5/", "requires_dist": null, "requires_python": "", "summary": "On-demand system call tracing for Python programs.", "version": "0.5" }, "last_serial": 3342601, "releases": { "0.5": [ { "comment_text": "", "digests": { "md5": "db92e7790b2177492d9feed16a1ee2b4", "sha256": "002524cfb34043c6d6c89ca563cfdeb8ab6db3ebd300b509f6e46dc52d657334" }, "downloads": -1, "filename": "ptracer-0.5.tar.gz", "has_sig": false, "md5_digest": "db92e7790b2177492d9feed16a1ee2b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28578, "upload_time": "2017-11-17T21:20:05", "url": "https://files.pythonhosted.org/packages/d8/85/193489f6d10aeb240f3ce656a85c9d9b8645ab6b602d68a190cb1f282598/ptracer-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db92e7790b2177492d9feed16a1ee2b4", "sha256": "002524cfb34043c6d6c89ca563cfdeb8ab6db3ebd300b509f6e46dc52d657334" }, "downloads": -1, "filename": "ptracer-0.5.tar.gz", "has_sig": false, "md5_digest": "db92e7790b2177492d9feed16a1ee2b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28578, "upload_time": "2017-11-17T21:20:05", "url": "https://files.pythonhosted.org/packages/d8/85/193489f6d10aeb240f3ce656a85c9d9b8645ab6b602d68a190cb1f282598/ptracer-0.5.tar.gz" } ] }