Report files opened while executing a command
Project description
pystrace
Python library and command line tool for collecting strace events
Purpose
This library works as wrapper for strace generating syscall events, this events can be used by applications for system calls activity analisys.
In order to handle long executions without generating massive aummounts of logs, the library creates a named FIFO and an extra process where the strace is executed outputing to the FIFO. The main process consumes all the data and generates the corresponding events.
Install
pip3 install --user pystrace
How to use (Lib)
from pystrace import Tracer
def on_event(event):
print(event)
my_tracer = Tracer(["id"], on_event, filter_syscalls="file", filter_return="successful")
my_tracer.run()
How to use (command ine tool)
pystrace -- command
Example:
# Trace only file related syscalls with successful result
pystrace -s file -r successful -- who
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pystrace-0.0.4.tar.gz
(11.4 kB
view details)
Built Distribution
File details
Details for the file pystrace-0.0.4.tar.gz
.
File metadata
- Download URL: pystrace-0.0.4.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45843c8c54f65c9fbeb6bb7f083d86d04fc86367a82e73d42ee41656e441f5fe |
|
MD5 | f7e1b2171ba3460b8f145e250037e98d |
|
BLAKE2b-256 | 85aa8b77809f367eec9b2124f717eab77c5665e2bb6d1cdfb054a692ca1f02a9 |
File details
Details for the file pystrace-0.0.4-py2.py3-none-any.whl
.
File metadata
- Download URL: pystrace-0.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | deab7ad3732e906e372032ba5a072997b72479c864a0a88621235e60e6d36f29 |
|
MD5 | 364702bac85bb6ceb98d89b9c91f468a |
|
BLAKE2b-256 | 92c51d53df20d3f9f12e177e270d565f96047e9026c0652f8f0ddf7cca915507 |