https://github.com/luser/tracetree
A tool for capturing the execution of an entire process tree
https://github.com/luser/tracetree
process profiler rust
Last synced: over 1 year ago
JSON representation
A tool for capturing the execution of an entire process tree
- Host: GitHub
- URL: https://github.com/luser/tracetree
- Owner: luser
- License: mit
- Created: 2016-11-04T17:49:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-06-30T17:28:12.000Z (about 5 years ago)
- Last Synced: 2025-03-14T04:19:10.365Z (over 1 year ago)
- Topics: process, profiler, rust
- Language: Rust
- Homepage:
- Size: 104 KB
- Stars: 49
- Watchers: 6
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/luser/tracetree) [](https://crates.io/crates/tracetree) [](https://docs.rs/tracetree)
tracetree
=========
Run a process, ptrace'ing it and all of its children, and print the entire process tree at the end.
Currently only Linux support is implemented.
Examples
========
Print a process tree in text format to stdout:
$ tracetree /bin/bash -c '/bin/sleep 1; /bin/sleep 1'
16665 bash -c /bin/sleep 1; /bin/sleep 1 [2.004s]
16666 sleep 1 [1.001s]
16667 sleep 1 [1.000s]
Print a process tree in JSON format to `output.json`:
$ tracetree -f json -o output.json /bin/bash -c '/bin/sleep 1; /bin/sleep 1'
$ python -mjson.tool output.json
{
"children": [
{
"children": [],
"cmdline": [
"/bin/sleep",
"1"
],
"ended": "2017-06-22T06:28:58.960384212-04:00",
"pid": 16727,
"started": "2017-06-22T06:28:57.959636824-04:00"
},
{
"children": [],
"cmdline": [
"/bin/sleep",
"1"
],
"ended": "2017-06-22T06:28:59.961990469-04:00",
"pid": 16728,
"started": "2017-06-22T06:28:58.960849779-04:00"
}
],
"cmdline": [
"/bin/bash",
"-c",
"/bin/sleep 1; /bin/sleep 1"
],
"ended": "2017-06-22T06:28:59.962407641-04:00",
"pid": 16726,
"started": "2017-06-22T06:28:57.958836370-04:00"
}
JSON output can be viewed with this [web visualizer](https://luser.github.io/tracetree/):
