Skip to main content

Produce a process tree from an strace log

Project description

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.2.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strace_process_tree-1.2.0-py2.py3-none-any.whl (14.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file strace-process-tree-1.2.0.tar.gz.

File metadata

  • Download URL: strace-process-tree-1.2.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for strace-process-tree-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3b848c911bb949f515784d337a274fb5009b710a15a7a33da33d5f9609cbc6dc
MD5 17bbd38bfd6e98d5d749941ba553f716
BLAKE2b-256 eba93ee53dde75fa32950eb39b521f7a0839a2cbad5a469acd1333fce6235834

See more details on using hashes here.

File details

Details for the file strace_process_tree-1.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: strace_process_tree-1.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for strace_process_tree-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4b95ddf7d1590ddf72440a647dc4a524240898fb12299357a9762f416862699a
MD5 766748c31bf9e7654f51920f15bedc67
BLAKE2b-256 3dadfd919cf72398a7a5dad2b328c5c3c4b0262a6f3d90e4e9b608e4e7412bd3

See more details on using hashes here.

Supported by

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