Skip to content

Instantly share code, notes, and snippets.

@dominiksalvet
Created April 1, 2020 19:08
Show Gist options
  • Select an option

  • Save dominiksalvet/1b50bbfcb98804567645e0145c3975bc to your computer and use it in GitHub Desktop.

Select an option

Save dominiksalvet/1b50bbfcb98804567645e0145c3975bc to your computer and use it in GitHub Desktop.
Count system calls of a process on Linux
#!/bin/sh
# for each system call line, print its line number instead
strace -f -p "$1" 2>&1 | awk '{ print NR }' # PID should be in $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment