Skip to content

Instantly share code, notes, and snippets.

@joshimoo
Created June 16, 2021 14:05
Show Gist options
  • Save joshimoo/afcfa1ebec8a1c0d59f0419d33a1dd38 to your computer and use it in GitHub Desktop.
Save joshimoo/afcfa1ebec8a1c0d59f0419d33a1dd38 to your computer and use it in GitHub Desktop.
longhorn strace instructions for perf investigation
# TODO: someone should write this a batch script
# <PID> = 24999
# create a directory for the log files
# and execute all commands inside of that directory
mkdir lh-trace
cd lh-trace
# pstree to determine the processes
# will create single file of the form pstree.log
pstree -a -g -p 24999 > pstree.log
# top for the current cpu utilization of the parent process
# will create single file of the form top.log
top -d 1.0 -b -n 120 -p 24999 > top.log
# run strace(2m) summary for process and all current children
# will create single file of the form thread-summary
timeout 120s strace -c -o thread-summary -p $(pgrep -g 24999 -w -d,)
# run strace(2m) summary for process and follow child creation
# will create single file of the form process-summary
timeout 120s strace -c -o process-summary -pf 24999
# run strace(2m) full output combined for all current existing threads
# will create single file of the form thread-trace
timeout 120s strace -t -T -o thread-trace -p $(pgrep -g 24999 -w -d,)
# run strace(2m) full for all process and follow child creation
# will create files of the form process-trace.pid
timeout 120s strace -t -T -o process-trace -ff -p 24999
# once all data has been collected zip up the directory then submit to support
# execute the below inside of the lh-trace directory created above
tar -czvf lh-trace.tar.gz *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment