From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64F8FC4360C for ; Thu, 3 Oct 2019 00:28:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29ED5222C0 for ; Thu, 3 Oct 2019 00:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570062516; bh=5OX4D2gLCfj8fqjrqhjQRPx25Dvy5hLcLsa7j93PPu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PzBJ352H7xT7EWLlXnH3tW69VjfPBQmgU6KBmVlkUymcwP+SIPIj74Si7BQVhRONk Xrqz6PecdvQwBs8FnMF4L8JCAcfJ5QMtE2hziIQocZxdsGL+98p2BMTFiQMbAY/k+C pEs+WzkqOvK87V8QdVLlwkQUxfrTKZmE07+6Q4nU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730033AbfJCA2f (ORCPT ); Wed, 2 Oct 2019 20:28:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:56100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729623AbfJCA04 (ORCPT ); Wed, 2 Oct 2019 20:26:56 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A26E0222D0; Thu, 3 Oct 2019 00:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570062415; bh=5OX4D2gLCfj8fqjrqhjQRPx25Dvy5hLcLsa7j93PPu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qr4SqZlFtm6cXJcGmJMUcmQMhvN9LSOJuPwWM5m1FuuD1PQpbTnsD8ealREPzIxII Z/iCJqxyjT+Yt+A9cDgQSrK/H9BRAYitcB5r5aXX8VYUEr/k0ZJDeOzcoBS24ZBHba +x32IuclU3mb4aGQDFpqXQDl2d4Wa91YkUa8cVx8= From: paulmck@kernel.org To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mingo@kernel.org Cc: stern@rowland.harvard.edu, parri.andrea@gmail.com, will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 12/32] tools/memory-model: Add simpletest.sh to check locking, RCU, and SRCU Date: Wed, 2 Oct 2019 17:26:30 -0700 Message-Id: <20191003002650.11249-12-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191003001039.GA8027@paulmck-ThinkPad-P72> References: <20191003001039.GA8027@paulmck-ThinkPad-P72> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" 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: Paul E. McKenney --- tools/memory-model/scripts/simpletest.sh | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 tools/memory-model/scripts/simpletest.sh diff --git a/tools/memory-model/scripts/simpletest.sh b/tools/memory-model/scripts/simpletest.sh new file mode 100755 index 0000000..7edc5d3 --- /dev/null +++ b/tools/memory-model/scripts/simpletest.sh @@ -0,0 +1,35 @@ +#!/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 + + +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 -- 2.9.5