parse-build.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0+
  3. #
  4. # Check the build output from an rcutorture run for goodness.
  5. # The "file" is a pathname on the local system, and "title" is
  6. # a text string for error-message purposes.
  7. #
  8. # The file must contain kernel build output.
  9. #
  10. # Usage: parse-build.sh file title
  11. #
  12. # Copyright (C) IBM Corporation, 2011
  13. #
  14. # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
  15. F=$1
  16. title=$2
  17. T="`mktemp -d ${TMPDIR-/tmp}/parse-build.sh.XXXXXX`"
  18. trap 'rm -rf $T' 0
  19. . functions.sh
  20. if grep -q CC < $F || test -n "$TORTURE_TRUST_MAKE" || grep -qe --trust-make < `dirname $F`/../log
  21. then
  22. :
  23. else
  24. print_bug $title no build
  25. exit 1
  26. fi
  27. if grep -q "error:" < $F
  28. then
  29. print_bug $title build errors:
  30. grep "error:" < $F
  31. exit 2
  32. fi
  33. grep warning: < $F > $T/warnings
  34. grep "include/linux/*rcu*\.h:" $T/warnings > $T/hwarnings
  35. grep "kernel/rcu/[^/]*:" $T/warnings > $T/cwarnings
  36. grep "^ld: .*undefined reference to" $T/warnings | head -1 > $T/ldwarnings
  37. cat $T/hwarnings $T/cwarnings $T/ldwarnings > $T/rcuwarnings
  38. if test -s $T/rcuwarnings
  39. then
  40. print_warning $title build errors:
  41. cat $T/rcuwarnings
  42. exit 2
  43. fi
  44. exit 0