162306a36Sopenharmony_ci ============ 262306a36Sopenharmony_ci LKMM SCRIPTS 362306a36Sopenharmony_ci ============ 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciThese scripts are run from the tools/memory-model directory. 762306a36Sopenharmony_ci 862306a36Sopenharmony_cicheckalllitmus.sh 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci Run all litmus tests in the litmus-tests directory, checking 1162306a36Sopenharmony_ci the results against the expected results recorded in the 1262306a36Sopenharmony_ci "Result:" comment lines. 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_cicheckghlitmus.sh 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci Run all litmus tests in the https://github.com/paulmckrcu/litmus 1762306a36Sopenharmony_ci archive that are C-language and that have "Result:" comment lines 1862306a36Sopenharmony_ci documenting expected results, comparing the actual results to 1962306a36Sopenharmony_ci those expected. 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_cichecklitmushist.sh 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci Run all litmus tests having .litmus.out files from previous 2462306a36Sopenharmony_ci initlitmushist.sh or newlitmushist.sh runs, comparing the 2562306a36Sopenharmony_ci herd7 output to that of the original runs. 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_cichecklitmus.sh 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci Check a single litmus test against its "Result:" expected result. 3062306a36Sopenharmony_ci Not intended to for manual use. 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_cichecktheselitmus.sh 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci Check the specified list of litmus tests against their "Result:" 3562306a36Sopenharmony_ci expected results. This takes optional parseargs.sh arguments, 3662306a36Sopenharmony_ci followed by "--" followed by pathnames starting from the current 3762306a36Sopenharmony_ci directory. 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_cicmplitmushist.sh 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci Compare output from two different runs of the same litmus tests, 4262306a36Sopenharmony_ci with the absolute pathnames of the tests to run provided one 4362306a36Sopenharmony_ci name per line on standard input. Not normally run manually, 4462306a36Sopenharmony_ci provided instead for use by other scripts. 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ciinitlitmushist.sh 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci Run all litmus tests having no more than the specified number 4962306a36Sopenharmony_ci of processes given a specified timeout, recording the results 5062306a36Sopenharmony_ci in .litmus.out files. 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_cijudgelitmus.sh 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci Given a .litmus file and its herd7 output, check the output file 5562306a36Sopenharmony_ci against the .litmus file's "Result:" comment to judge whether 5662306a36Sopenharmony_ci the test ran correctly. Not normally run manually, provided 5762306a36Sopenharmony_ci instead for use by other scripts. 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_cinewlitmushist.sh 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci For all new or updated litmus tests having no more than the 6262306a36Sopenharmony_ci specified number of processes given a specified timeout, run 6362306a36Sopenharmony_ci and record the results in .litmus.out files. 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ciparseargs.sh 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci Parse command-line arguments. Not normally run manually, 6862306a36Sopenharmony_ci provided instead for use by other scripts. 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_cirunlitmushist.sh 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci Run the litmus tests whose absolute pathnames are provided one 7362306a36Sopenharmony_ci name per line on standard input. Not normally run manually, 7462306a36Sopenharmony_ci provided instead for use by other scripts. 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ciREADME 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci This file 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ciTesting a change to LKMM might go as follows: 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci # Populate expected results without that change, and 8362306a36Sopenharmony_ci # runs for about an hour on an 8-CPU x86 system: 8462306a36Sopenharmony_ci scripts/initlitmushist.sh --timeout 10m --procs 10 8562306a36Sopenharmony_ci # Incorporate the change: 8662306a36Sopenharmony_ci git am -s -3 /path/to/patch # Or whatever it takes. 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci # Test the new version of LKMM as follows... 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci # Runs in seconds, good smoke test: 9162306a36Sopenharmony_ci scripts/checkalllitmus.sh 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_ci # Compares results to those produced by initlitmushist.sh, 9462306a36Sopenharmony_ci # and runs for about an hour on an 8-CPU x86 system: 9562306a36Sopenharmony_ci scripts/checklitmushist.sh --timeout 10m --procs 10 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci # Checks results against Result tags, runs in minutes: 9862306a36Sopenharmony_ci scripts/checkghlitmus.sh --timeout 10m --procs 10 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ciThe checkghlitmus.sh should not report errors in cases where the 10162306a36Sopenharmony_cichecklitmushist.sh script did not also report a change. However, 10262306a36Sopenharmony_cithis check is nevertheless valuable because it can find errors in the 10362306a36Sopenharmony_cioriginal version of LKMM. Note however, that given the above procedure, 10462306a36Sopenharmony_cian error in the original LKMM version that is fixed by the patch will 10562306a36Sopenharmony_cibe reported both as a mismatch by checklitmushist.sh and as an error 10662306a36Sopenharmony_ciby checkghlitmus.sh. One exception to this rule of thumb is when the 10762306a36Sopenharmony_citest fails completely on the original version of LKMM and passes on the 10862306a36Sopenharmony_cinew version. In this case, checklitmushist.sh will report a mismatch 10962306a36Sopenharmony_ciand checkghlitmus.sh will report success. This happens when the change 11062306a36Sopenharmony_cito LKMM introduces a new primitive for which litmus tests already existed. 111