# 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
```bash
pip3 install --user pystrace
```
## How to use (Lib)
```python
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)
```bash
pystrace -- command
```
## Example:
```bash
# Trace only file related syscalls with successful result
pystrace -s file -r successful -- who
```
Raw data
{
"_id": null,
"home_page": "https://github.com/joaompinto/pystrace",
"name": "pystrace",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Jo\u00e3o Pinto",
"author_email": "joao.pinto@vshn.ch",
"download_url": "https://files.pythonhosted.org/packages/85/aa/8b77809f367eec9b2124f717eab77c5665e2bb6d1cdfb054a692ca1f02a9/pystrace-0.0.4.tar.gz",
"platform": null,
"description": "# pystrace\n\nPython library and command line tool for collecting strace events\n\n## Purpose\n\nThis library works as wrapper for strace generating syscall events, this events can be used by applications for system calls activity analisys.\n\nIn 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.\n\n## Install\n\n```bash\npip3 install --user pystrace\n```\n\n## How to use (Lib)\n```python\nfrom pystrace import Tracer\n\ndef on_event(event):\n print(event)\n\nmy_tracer = Tracer([\"id\"], on_event, filter_syscalls=\"file\", filter_return=\"successful\")\nmy_tracer.run()\n```\n\n## How to use (command ine tool)\n```bash\npystrace -- command\n```\n\n## Example:\n```bash\n# Trace only file related syscalls with successful result\npystrace -s file -r successful -- who\n```\n",
"bugtrack_url": null,
"license": "BSD-3",
"summary": "Report files opened while executing a command",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/joaompinto/pystrace"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "92c51d53df20d3f9f12e177e270d565f96047e9026c0652f8f0ddf7cca915507",
"md5": "364702bac85bb6ceb98d89b9c91f468a",
"sha256": "deab7ad3732e906e372032ba5a072997b72479c864a0a88621235e60e6d36f29"
},
"downloads": -1,
"filename": "pystrace-0.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "364702bac85bb6ceb98d89b9c91f468a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 11899,
"upload_time": "2023-06-03T13:01:17",
"upload_time_iso_8601": "2023-06-03T13:01:17.015400Z",
"url": "https://files.pythonhosted.org/packages/92/c5/1d53df20d3f9f12e177e270d565f96047e9026c0652f8f0ddf7cca915507/pystrace-0.0.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "85aa8b77809f367eec9b2124f717eab77c5665e2bb6d1cdfb054a692ca1f02a9",
"md5": "f7e1b2171ba3460b8f145e250037e98d",
"sha256": "45843c8c54f65c9fbeb6bb7f083d86d04fc86367a82e73d42ee41656e441f5fe"
},
"downloads": -1,
"filename": "pystrace-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "f7e1b2171ba3460b8f145e250037e98d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11404,
"upload_time": "2023-06-03T13:01:18",
"upload_time_iso_8601": "2023-06-03T13:01:18.568454Z",
"url": "https://files.pythonhosted.org/packages/85/aa/8b77809f367eec9b2124f717eab77c5665e2bb6d1cdfb054a692ca1f02a9/pystrace-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-03 13:01:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "joaompinto",
"github_project": "pystrace",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "pystrace"
}