trace2line 678 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
  3. parsed=$(getopt -o "${common_getopt_flags}" -l "$common_getopt_flags_long" -- "$@")
  4. eval set -- "$parsed"
  5. while true; do
  6. case "$1" in
  7. *)
  8. common_getopt_case "$@"
  9. ;;
  10. esac
  11. done
  12. common_setup
  13. kernel_dir="${common_build_dir}/linux-custom"
  14. (
  15. if "$common_gem5"; then
  16. sed -r 's/^.* (0x[^. ]*)[. ].*/\1/' "$common_trace_txt_file"
  17. else
  18. sed -r 's/.*pc=//' "$common_trace_txt_file"
  19. fi
  20. ) | \
  21. xargs "${common_host_dir}/bin/${common_arch}-linux-addr2line" -e "${common_vmlinux}" -fp | \
  22. sed -E "s|at ${kernel_dir}/(\./\|)||" | \
  23. uniq -c \
  24. > "${common_run_dir}/trace-lines.txt"