Skip to main content

Produce a process tree from an strace log

Project description

https://github.com/mgedmin/strace-process-tree/workflows/build/badge.svg?branch=master

Reads strace -f output and produces a process tree. Example

$ strace -f -e trace=process -s 1024 -o /tmp/trace.out make binary-package
...

$ strace-process-tree /tmp/trace.out
25510 make binary-package
  ├─25511 /bin/sh -c 'dpkg-parsechangelog | awk '\''$1 == "Source:" { print $2 }'\'''
  │   ├─25512 dpkg-parsechangelog
  │   │   └─25514 tail -n 40 debian/changelog
  │   └─25513 awk '$1 == "Source:" { print $2 }'
  ├─25515 /bin/sh -c 'dpkg-parsechangelog | awk '\''$1 == "Version:" { print $2 }'\'''
  │   ├─25516 dpkg-parsechangelog
  │   │   └─25518 tail -n 40 debian/changelog
  │   └─25517 awk '$1 == "Version:" { print $2 }'
  ├─25519 /bin/sh -c 'dpkg-parsechangelog | grep ^Date: | cut -d: -f 2- | date --date="$(cat)" +%Y-%m-%d'
  │   ├─25520 dpkg-parsechangelog
  │   │   └─25525 tail -n 40 debian/changelog
  │   ├─25521 grep ^Date:
  │   ├─25522 cut -d: -f 2-
  │   └─25523 date --date=" Thu, 18 Jan 2018 23:39:51 +0200" +%Y-%m-%d
  │       └─25524 cat
  └─25526 /bin/sh -c 'dpkg-parsechangelog | awk '\''$1 == "Distribution:" { print $2 }'\'''
      ├─25527 dpkg-parsechangelog
      │   └─25529 tail -n 40 debian/changelog
      └─25528 awk '$1 == "Distribution:" { print $2 }'

Installation

Use your favourite pip wrapper to install strace-process-tree, e.g.

pipx install strace-process-tree

Synopsis

Usage: strace-process-tree [-h] [–version] [-c] [-C] [-U] [-A] [-v] filename

Read strace -f output and produce a process tree. Recommended strace options for best results:

strace -f -ttt -e trace=process -s 1024 -o FILENAME COMMAND

positional arguments:

filename strace log to parse (use - to read stdin)

optional arguments:
-h, --help

show this help message and exit

--version

show program’s version number and exit

-c, --color

force color output

-C, --no-color

disable color output

-U, --unicode

force Unicode output

-A, --ascii

force ASCII output

-v, --verbose

more verbose output

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

strace_process_tree-1.5.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

strace_process_tree-1.5.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file strace_process_tree-1.5.1.tar.gz.

File metadata

  • Download URL: strace_process_tree-1.5.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for strace_process_tree-1.5.1.tar.gz
Algorithm Hash digest
SHA256 efc7d6ac8992c68633d71ec4fd7b51653a16cd693bef80f7160239059dad805a
MD5 26360700ef1674fc3707eed32a05acc0
BLAKE2b-256 69f79698d9442827eed068d8cd0b4470632bb340389fdc47ba3265fb77013946

See more details on using hashes here.

File details

Details for the file strace_process_tree-1.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for strace_process_tree-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ccc8139d28d29f159ac99779007b847bf7ba1697b915d76da5cbc3d9448ca3ec
MD5 9722d8cbd6a3cdb70d2e2423d229b9cb
BLAKE2b-256 77220d3820ab0584db9a72dc3982c08e0aa9dbdb35ab8fbd56ac1fb839a94e7f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page