18c2ecf20Sopenharmony_ci#!/bin/bash
28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0+
38c2ecf20Sopenharmony_ci#
48c2ecf20Sopenharmony_ci# Check the build output from an rcutorture run for goodness.
58c2ecf20Sopenharmony_ci# The "file" is a pathname on the local system, and "title" is
68c2ecf20Sopenharmony_ci# a text string for error-message purposes.
78c2ecf20Sopenharmony_ci#
88c2ecf20Sopenharmony_ci# The file must contain kernel build output.
98c2ecf20Sopenharmony_ci#
108c2ecf20Sopenharmony_ci# Usage: parse-build.sh file title
118c2ecf20Sopenharmony_ci#
128c2ecf20Sopenharmony_ci# Copyright (C) IBM Corporation, 2011
138c2ecf20Sopenharmony_ci#
148c2ecf20Sopenharmony_ci# Authors: Paul E. McKenney <paulmck@linux.ibm.com>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciF=$1
178c2ecf20Sopenharmony_cititle=$2
188c2ecf20Sopenharmony_ciT=${TMPDIR-/tmp}/parse-build.sh.$$
198c2ecf20Sopenharmony_citrap 'rm -rf $T' 0
208c2ecf20Sopenharmony_cimkdir $T
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci. functions.sh
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciif grep -q CC < $F || test -n "$TORTURE_TRUST_MAKE"
258c2ecf20Sopenharmony_cithen
268c2ecf20Sopenharmony_ci	:
278c2ecf20Sopenharmony_cielse
288c2ecf20Sopenharmony_ci	print_bug $title no build
298c2ecf20Sopenharmony_ci	exit 1
308c2ecf20Sopenharmony_cifi
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciif grep -q "error:" < $F
338c2ecf20Sopenharmony_cithen
348c2ecf20Sopenharmony_ci	print_bug $title build errors:
358c2ecf20Sopenharmony_ci	grep "error:" < $F
368c2ecf20Sopenharmony_ci	exit 2
378c2ecf20Sopenharmony_cifi
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_cigrep warning: < $F > $T/warnings
408c2ecf20Sopenharmony_cigrep "include/linux/*rcu*\.h:" $T/warnings > $T/hwarnings
418c2ecf20Sopenharmony_cigrep "kernel/rcu/[^/]*:" $T/warnings > $T/cwarnings
428c2ecf20Sopenharmony_cicat $T/hwarnings $T/cwarnings > $T/rcuwarnings
438c2ecf20Sopenharmony_ciif test -s $T/rcuwarnings
448c2ecf20Sopenharmony_cithen
458c2ecf20Sopenharmony_ci	print_warning $title build errors:
468c2ecf20Sopenharmony_ci	cat $T/rcuwarnings
478c2ecf20Sopenharmony_ci	exit 2
488c2ecf20Sopenharmony_cifi
498c2ecf20Sopenharmony_ciexit 0
50