Metadata-Version: 1.1
Name: ptracer
Version: 0.5
Summary: On-demand system call tracing for Python programs.
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache License, Version 2.0
Description-Content-Type: UNKNOWN
Description: ptracer -- a library for ptrace-based tracing of Python programs
        ================================================================
        
        .. image:: https://travis-ci.org/pinterest/ptracer.svg?branch=master
            :target: https://travis-ci.org/pinterest/ptracer
        
        Ptracer is a library providing on-demand system call tracing in Python
        programs.
        
        
        Basic Usage
        -----------
        
        .. code-block:: python
        
            import traceback
            import ptracer
        
            def callback(syscall):
                print('{}({}) -> {}'.format(
                    syscall.name,
                    ', '.join(repr(arg.value) for arg in syscall.args),
                    syscall.result.text))
                print('Traceback: ')
                print(''.join(traceback.format_list(syscall.traceback)))
        
            with ptracer.context(callback):
                open('/dev/null', 'wb')
        
        
        Filtering
        ---------
        
        Ptracer allows elaborate syscall filtering via the *filter* argument:
        
        .. code-block:: python
        
            flt = [
                ptracer.SysCallPattern(
                    name='open',
                    args=[
                        re.compile(b'/tmp/.*'),
                        lambda arg: arg.value & os.O_WRONLY
                    ],
                    result=lambda res: res.value > 0
                )
            ]
        
            with ptracer.context(callback, filter=flt):
                # traced code
                ...
        
        
        In the above example, ptracer will invoke the callback only for successful
        attempts to open files in the "/tmp" directory for writing.
        
        
        Documentation
        -------------
        
        The documentation is available on
        `ptracer.readthedocs.io <https://ptracer.readthedocs.io/>`_.
        
Platform: POSIX
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: POSIX :: Linux
Classifier: Development Status :: 4 - Beta
Provides: ptracer
