Commit aedbf1e0 authored by Paul E. McKenney's avatar Paul E. McKenney

tools/memory-model: Add simpletest.sh to check locking, RCU, and SRCU

This commit abstracts out common function to check a given litmus test
for locking, RCU, and SRCU in order to avoid duplicating code.
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 2024436d
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0+
#
# Give zero status if this is a simple test and non-zero otherwise.
# Simple tests do not contain locking, RCU, or SRCU.
#
# Usage:
# simpletest.sh file.litmus
#
# Copyright IBM Corporation, 2019
#
# Author: Paul E. McKenney <paulmck@linux.ibm.com>
litmus=$1
if test -f "$litmus" -a -r "$litmus"
then
:
else
echo ' --- ' error: \"$litmus\" is not a readable file
exit 255
fi
exclude="^[[:space:]]*\("
exclude="${exclude}spin_lock(\|spin_unlock(\|spin_trylock(\|spin_is_locked("
exclude="${exclude}\|rcu_read_lock(\|rcu_read_unlock("
exclude="${exclude}\|synchronize_rcu(\|synchronize_rcu_expedited("
exclude="${exclude}\|srcu_read_lock(\|srcu_read_unlock("
exclude="${exclude}\|synchronize_srcu(\|synchronize_srcu_expedited("
exclude="${exclude}\)"
if grep -q $exclude $litmus
then
exit 255
fi
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment