Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\locking-selftest.c Create Date:2022-07-28 06:53:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:locking_selftest

Proto:void locking_selftest(void)

Type:void

Parameter:Nothing

1974  If Not We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one and Then
1975  printk("----------------------------------\n")
1976  printk("| Locking API testsuite disabled |\n")
1977  printk("----------------------------------\n")
1978  Return
1984  printk("------------------------\n")
1985  printk("| Locking API testsuite:\n")
1986  printk("----------------------------------------------------------------------------\n")
1987  printk(" | spin |wlock |rlock |mutex | wsem | rsem |\n")
1988  printk(" --------------------------------------------------------------------------\n")
1990  init_shared_classes()
1991  The locking-testsuite uses to get a 'silent failure': nothing is printed to the console when a locking bug is detected = Not Change this to 1 if you want to see the failure printouts:
1992  lockdep_set_selftest_task(current process)
2004  printk(" --------------------------------------------------------------------------\n")
2005  print_testname("recursive read-lock")
2006  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2007  dotest(Special-case for read-locking, they are* allowed to recurse on the same lock class:, SUCCESS, LOCKTYPE_RWLOCK)
2008  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2009  dotest(rsem_AA1, FAILURE, LOCKTYPE_RWSEM)
2010  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("\n")
2012  print_testname("recursive read-lock #2")
2013  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2014  dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK)
2015  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2016  dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM)
2017  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("\n")
2019  print_testname("mixed read-write-lock")
2020  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2021  dotest(The mixing of read and write locks is not allowed:, FAILURE, LOCKTYPE_RWLOCK)
2022  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2023  dotest(rsem_AA2, FAILURE, LOCKTYPE_RWSEM)
2024  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("\n")
2026  print_testname("mixed write-read-lock")
2027  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2028  dotest(rlock_AA3, FAILURE, LOCKTYPE_RWLOCK)
2029  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2030  dotest(rsem_AA3, FAILURE, LOCKTYPE_RWSEM)
2031  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("\n")
2033  print_testname("mixed read-lock/lock-write ABBA")
2034  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2035  dotest(ad_lock(A)* spin_lock(B)* spin_lock(B)* write_lock(A), FAILURE, LOCKTYPE_RWLOCK)
2044  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2045  dotest(rwsem_ABBA1, FAILURE, LOCKTYPE_RWSEM)
2047  print_testname("mixed read-lock/lock-read ABBA")
2048  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2049  dotest(ad_lock(A)* spin_lock(B)* spin_lock(B)* read_lock(A), SUCCESS, LOCKTYPE_RWLOCK)
2050  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2051  dotest(rwsem_ABBA2, FAILURE, LOCKTYPE_RWSEM)
2053  print_testname("mixed write-lock/lock-write ABBA")
2054  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2055  dotest(write_lock(A)* spin_lock(B)* spin_lock(B)* write_lock(A), FAILURE, LOCKTYPE_RWLOCK)
2056  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.(" |")
2057  dotest(rwsem_ABBA3, FAILURE, LOCKTYPE_RWSEM)
2059  printk(" --------------------------------------------------------------------------\n")
2074  ww_tests()
2076  If unexpected_testcase_failures Then
2077  printk("-----------------------------------------------------------------\n")
2078  We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one and = 0
2079  printk("BUG: %3d unexpected failures (out of %3d) - debugging disabled! |\n", unexpected_testcase_failures, testcase_total)
2081  printk("-----------------------------------------------------------------\n")
2082  Else if expected_testcase_failures && testcase_successes Then
2083  printk("--------------------------------------------------------\n")
2084  printk("%3d out of %3d testcases failed, as expected. |\n", expected_testcase_failures, testcase_total)
2086  printk("----------------------------------------------------\n")
2087  We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one and = 1
2088  Else if expected_testcase_failures && Not testcase_successes Then
2089  printk("--------------------------------------------------------\n")
2090  printk("All %3d testcases failed, as expected. |\n", expected_testcase_failures)
2092  printk("----------------------------------------\n")
2093  We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one and = 1
2094  Else
2095  printk("-------------------------------------------------------\n")
2096  printk("Good, all %3d testcases passed! |\n", testcase_successes)
2098  printk("---------------------------------\n")
2099  We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one and = 1
2101  lockdep_set_selftest_task(NULL)
2102  The locking-testsuite uses to get a 'silent failure': nothing is printed to the console when a locking bug is detected = 0