Path: blob/master/tools/memory-model/scripts/initlitmushist.sh
29266 views
#!/bin/sh1# SPDX-License-Identifier: GPL-2.0+2#3# Runs the C-language litmus tests matching the specified criteria.4# Generates the output for each .litmus file into a corresponding5# .litmus.out file, and does not judge the result.6#7# sh initlitmushist.sh8#9# Run from the Linux kernel tools/memory-model directory.10# See scripts/parseargs.sh for list of arguments.11#12# This script can consume significant wallclock time and CPU, especially as13# the value of --procs rises. On a four-core (eight hardware threads)14# 2.5GHz x86 with a one-minute per-run timeout:15#16# --procs wallclock CPU timeouts tests17# 1 0m11.241s 0m1.086s 0 1918# 2 1m12.598s 2m8.459s 2 39319# 3 1m30.007s 6m2.479s 4 229120# 4 3m26.042s 18m5.139s 9 321721# 5 4m26.661s 23m54.128s 13 378422# 6 4m41.900s 26m4.721s 13 435223# 7 5m51.463s 35m50.868s 13 462624# 8 10m5.235s 68m43.672s 34 511725# 9 15m57.80s 105m58.101s 69 515626# 10 16m14.13s 103m35.009s 69 516527# 20 27m48.55s 198m3.286s 156 526928#29# Increasing the timeout on the 20-process run to five minutes increases30# the runtime to about 90 minutes with the CPU time rising to about31# 10 hours. On the other hand, it decreases the number of timeouts to 101.32#33# Note that there are historical tests for which herd7 will fail34# completely, for example, litmus/manual/atomic/C-unlock-wait-00.litmus35# contains a call to spin_unlock_wait(), which no longer exists in either36# the kernel or LKMM.3738. scripts/parseargs.sh3940T=/tmp/initlitmushist.sh.$$41trap 'rm -rf $T' 042mkdir $T4344if test -d litmus45then46:47else48git clone https://github.com/paulmckrcu/litmus49( cd litmus; git checkout origin/master )50fi5152# Create any new directories that have appeared in the github litmus53# repo since the last run.54if test "$LKMM_DESTDIR" != "."55then56find litmus -type d -print |57( cd "$LKMM_DESTDIR"; sed -e 's/^/mkdir -p /' | sh )58fi5960# Create a list of the C-language litmus tests with no more than the61# specified number of processes (per the --procs argument).62find litmus -name '*.litmus' -print | mselect7 -arch C > $T/list-C63xargs < $T/list-C -r grep -L "^P${LKMM_PROCS}" > $T/list-C-short6465scripts/runlitmushist.sh < $T/list-C-short6667exit 0686970