ttrace


Namettrace JSON
Version 0.1.13 PyPI version JSON
download
home_pagehttps://projects.om-office.de/frans/ttrace.git
SummaryMakes use of strace
upload_time2024-01-03 14:14:28
maintainer
docs_urlNone
authorFrans Fürst
requires_python>=3.10,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ttrace - strace as a tree

Uses `strace` to trace a program call and displays what's going on in a human
friendly manner.


![Current screenshot](screenshot.png "Current screenshot")

[Project page](https://projects.om-office.de/frans/ttrace)


## Installation and Usage

Install `ttrace` via pip:
```
[<python executable> -m] pip install [-U] ttrace
```

A new executable is then provided which can be used instead of `strace`:
```
ttrace [<ARGS>] <CMD>
```
Note that you would'nt provide `strace` arguments since `ttrace` provides them
automatically.

Alternatively you can clone and use the current development tree, see below.


## Intended interface

The following commands and outputs reflect the current development plan:

```sh
ttrace <CMD|LOGFILE>
```
Prints annotated, pre-formatted and filtered output next to the process' original
`stdout` and `stderr`.

```sh
ttrace --attach <PID|NAME>
```
Attaches to the given process and displays all but `stdout` and `stderr` of the
process of course.

```sh
<CMD> | ttrace [<OTHER-ARGS>]
```
Same as with `attach` but using pipe semantics (limited due to the mixing of
`stderr` and `strace` output.


```sh
ttrace --grep <PATTERN> <CMD>
```
Applies pattern to the original `strace` output and only outputs the matching
content.

```sh
ttrace --tree <CMD>
```
Populates and displays a tree while the program is running.

```sh
ttrace --hybrid <CMD>
```
Not sure yet - plan is to have `ncurses` based split views for optionally any
of the following elements:

* tree output
* combined `stdout` and `stderr`
* alternatively split `stdout` and `stderr`
* strace console
* console with only warning character (whatever that means)

```sh
ttrace --timing <CMD>
```

### ToDo for v1.0

* trace process termination
* output growing process tree
* report / visualize abnormal process termination
* report / visualize file access
* optionally turn PIDs into PID counters for comparability
* optionally print timestamp, pid, line number
* no color
* logging


### Other ideas

* trace changes environment
* trace docker image usage
* highlight failed processes


## Development & Contribution

```
pip3 install -U poetry pre-commit
git clone --recurse-submodules https://projects.om-office.de/frans/ttrace.git
cd ttrace
pre-commit install
# if you need a specific version of Python inside your dev environment
poetry env use ~/.pyenv/versions/3.10.4/bin/python3
poetry install
```


## License

See `License.md`


## Read

* [The Difference Between fork(), vfork(), exec() and clone()](https://www.baeldung.com/linux/fork-vfork-exec-clone)
* [HN: The Magic of strace](https://news.ycombinator.com/item?id=7155799)
* [The Magic of strace (archive.org)](https://web.archive.org/web/20160116001752/http://chadfowler.com/blog/2014/01/26/the-magic-of-strace/)


            

Raw data

            {
    "_id": null,
    "home_page": "https://projects.om-office.de/frans/ttrace.git",
    "name": "ttrace",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Frans F\u00fcrst",
    "author_email": "frans.fuerst+gitlab@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/e9/79042f3212ba4c40d89c71e0bf39e6c689faf2b896e1229af5536f8a58ec/ttrace-0.1.13.tar.gz",
    "platform": null,
    "description": "# ttrace - strace as a tree\n\nUses `strace` to trace a program call and displays what's going on in a human\nfriendly manner.\n\n\n![Current screenshot](screenshot.png \"Current screenshot\")\n\n[Project page](https://projects.om-office.de/frans/ttrace)\n\n\n## Installation and Usage\n\nInstall `ttrace` via pip:\n```\n[<python executable> -m] pip install [-U] ttrace\n```\n\nA new executable is then provided which can be used instead of `strace`:\n```\nttrace [<ARGS>] <CMD>\n```\nNote that you would'nt provide `strace` arguments since `ttrace` provides them\nautomatically.\n\nAlternatively you can clone and use the current development tree, see below.\n\n\n## Intended interface\n\nThe following commands and outputs reflect the current development plan:\n\n```sh\nttrace <CMD|LOGFILE>\n```\nPrints annotated, pre-formatted and filtered output next to the process' original\n`stdout` and `stderr`.\n\n```sh\nttrace --attach <PID|NAME>\n```\nAttaches to the given process and displays all but `stdout` and `stderr` of the\nprocess of course.\n\n```sh\n<CMD> | ttrace [<OTHER-ARGS>]\n```\nSame as with `attach` but using pipe semantics (limited due to the mixing of\n`stderr` and `strace` output.\n\n\n```sh\nttrace --grep <PATTERN> <CMD>\n```\nApplies pattern to the original `strace` output and only outputs the matching\ncontent.\n\n```sh\nttrace --tree <CMD>\n```\nPopulates and displays a tree while the program is running.\n\n```sh\nttrace --hybrid <CMD>\n```\nNot sure yet - plan is to have `ncurses` based split views for optionally any\nof the following elements:\n\n* tree output\n* combined `stdout` and `stderr`\n* alternatively split `stdout` and `stderr`\n* strace console\n* console with only warning character (whatever that means)\n\n```sh\nttrace --timing <CMD>\n```\n\n### ToDo for v1.0\n\n* trace process termination\n* output growing process tree\n* report / visualize abnormal process termination\n* report / visualize file access\n* optionally turn PIDs into PID counters for comparability\n* optionally print timestamp, pid, line number\n* no color\n* logging\n\n\n### Other ideas\n\n* trace changes environment\n* trace docker image usage\n* highlight failed processes\n\n\n## Development & Contribution\n\n```\npip3 install -U poetry pre-commit\ngit clone --recurse-submodules https://projects.om-office.de/frans/ttrace.git\ncd ttrace\npre-commit install\n# if you need a specific version of Python inside your dev environment\npoetry env use ~/.pyenv/versions/3.10.4/bin/python3\npoetry install\n```\n\n\n## License\n\nSee `License.md`\n\n\n## Read\n\n* [The Difference Between fork(), vfork(), exec() and clone()](https://www.baeldung.com/linux/fork-vfork-exec-clone)\n* [HN: The Magic of strace](https://news.ycombinator.com/item?id=7155799)\n* [The Magic of strace (archive.org)](https://web.archive.org/web/20160116001752/http://chadfowler.com/blog/2014/01/26/the-magic-of-strace/)\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Makes use of strace",
    "version": "0.1.13",
    "project_urls": {
        "Homepage": "https://projects.om-office.de/frans/ttrace.git",
        "Repository": "https://projects.om-office.de/frans/ttrace.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c4504c176bbf95aacf8dd98a24eb22096f6a25dbac792bad85d673b96e44b7a",
                "md5": "1de3f880395ae547fc0c7c33b0b51dd8",
                "sha256": "0eaf5e7824bc4ab1afc2153c1c7f597d0b03274d5a750735247e1f3815f3c7d8"
            },
            "downloads": -1,
            "filename": "ttrace-0.1.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1de3f880395ae547fc0c7c33b0b51dd8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 13228,
            "upload_time": "2024-01-03T14:14:26",
            "upload_time_iso_8601": "2024-01-03T14:14:26.772802Z",
            "url": "https://files.pythonhosted.org/packages/6c/45/04c176bbf95aacf8dd98a24eb22096f6a25dbac792bad85d673b96e44b7a/ttrace-0.1.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bce979042f3212ba4c40d89c71e0bf39e6c689faf2b896e1229af5536f8a58ec",
                "md5": "c674311d9454f0fba7bda57bb30eef47",
                "sha256": "25e3c9a13ffd8a1fb21af16795a4bc39a2fd1dc83b38fc8e2120df5608d0a625"
            },
            "downloads": -1,
            "filename": "ttrace-0.1.13.tar.gz",
            "has_sig": false,
            "md5_digest": "c674311d9454f0fba7bda57bb30eef47",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 13275,
            "upload_time": "2024-01-03T14:14:28",
            "upload_time_iso_8601": "2024-01-03T14:14:28.716606Z",
            "url": "https://files.pythonhosted.org/packages/bc/e9/79042f3212ba4c40d89c71e0bf39e6c689faf2b896e1229af5536f8a58ec/ttrace-0.1.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-03 14:14:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ttrace"
}
        
Elapsed time: 0.52745s