Guest User

Untitled

a guest
Jul 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. EKG_BIN=""
  4.  
  5. # First try to find ekg2 in current directory
  6. [ -x 'ekg2' ] && EKG_BIN="./ekg2"
  7. [ -z "${EKG_BIN}" -a -x 'ekg/ekg2' ] && EKG_BIN="ekg/ekg2"
  8. [ -z "${EKG_BIN}" -a -x '../ekg/ekg2' ] && EKG_BIN="../ekg/ekg2"
  9.  
  10. # Then try script directory
  11. SCDIR="$(dirname "$0")"
  12. if [ -z "${EKG_BIN}" -a -n "${SCDIR}" -a "${SCDIR}" != '.' ]; then
  13. cd "$(dirname $0)"
  14. [ -z "${EKG_BIN}" -a -x 'ekg2' ] && EKG_BIN="ekg2"
  15. [ -z "${EKG_BIN}" -a -x 'ekg/ekg2' ] && EKG_BIN="ekg/ekg2"
  16. [ -z "${EKG_BIN}" -a -x '../ekg/ekg2' ] && EKG_BIN="../ekg/ekg2"
  17. fi
  18.  
  19. # Finally, try ${PATH}
  20. [ -z "${EKG_BIN}" ] && EKG_BIN="$(which ekg2 2>/dev/null)"
  21.  
  22. if [ -z "${EKG_BIN}" ]; then
  23. echo 'Unable to find any usable ekg2 binary.'
  24. exit 127
  25. fi
  26.  
  27. # --trace-malloc=yes \
  28.  
  29. valgrind \
  30. -v \
  31. --tool=memcheck \
  32. --log-file="$HOME"/.ekg2/valgrind."$(date +%Y%m%d-%H%M)" \
  33. --leak-check=yes \
  34. --leak-resolution=high \
  35. --error-limit=no \
  36. --demangle=yes \
  37. --num-callers=20 \
  38. --track-fds=yes \
  39. --trace-children=yes \
  40. --show-reachable=yes \
  41. "${EKG_BIN}" "$@"
  42.  
  43. exit $?
Add Comment
Please, Sign In to add comment