pstree_prof

command module
v0.0.0-...-e57afc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 14 Imported by: 0

README

pstree_prof

Start a process & sample the tree of child processes it spawns

installation

$ go get github.com/christianscott/pstree_prof

example

$ cat eg/test.sh
#! /usr/bin/env bash

node -e 'setTimeout(() => {}, 1000)'
python3 -c 'import time; time.sleep(2)'
sleep 3                                                                                                                                                                                                                                                                                                                                                         
$ ./pstree_prof -cmd 'bash eg/test.sh' -freq 100 -fmt count
pstree_prof: 2022/04/08 11:48:00 sampling every 10ms
pstree_prof: 2022/04/08 11:48:00 start of output from command:
pstree_prof: 2022/04/08 11:48:07 end of output from command
count   command
42      bash eg/test.sh
19      sleep 3
13      /usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python -c import time; time.sleep(2)
8       node -e setTimeout(() => {}, 1000)
1       (Python)

todo

  • add -command flag
  • export traces using otel
  • export traces to a flamegraph-compatible format (stack samples?)
  • use libproc.h instead of ps

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL