函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\locking-selftest.c Create Date:2022-07-27 07:50:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:测试锁的API是否正常使用

函数原型:void locking_selftest(void)

返回类型:void

参数:

1974  如果非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
1975  printk("----------------------------------\n")
1976  printk("| Locking API testsuite disabled |\n")
1977  printk("----------------------------------\n")
1978  返回
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.等于非Change this to 1 if you want to see the failure printouts:
1992  lockdep_set_selftest_task(当前进程)
2004  printk(" --------------------------------------------------------------------------\n")
2005  print_testname("recursive read-lock")
2006  打印标准信息(" |")
2007  dotest(Special-case for read-locking, they are* allowed to recurse on the same lock class:, SUCCESS, LOCKTYPE_RWLOCK)
2008  打印标准信息(" |")
2009  dotest(rsem_AA1, FAILURE, LOCKTYPE_RWSEM)
2010  打印标准信息("\n")
2012  print_testname("recursive read-lock #2")
2013  打印标准信息(" |")
2014  dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK)
2015  打印标准信息(" |")
2016  dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM)
2017  打印标准信息("\n")
2019  print_testname("mixed read-write-lock")
2020  打印标准信息(" |")
2021  dotest(The mixing of read and write locks is not allowed:, FAILURE, LOCKTYPE_RWLOCK)
2022  打印标准信息(" |")
2023  dotest(rsem_AA2, FAILURE, LOCKTYPE_RWSEM)
2024  打印标准信息("\n")
2026  print_testname("mixed write-read-lock")
2027  打印标准信息(" |")
2028  dotest(rlock_AA3, FAILURE, LOCKTYPE_RWLOCK)
2029  打印标准信息(" |")
2030  dotest(rsem_AA3, FAILURE, LOCKTYPE_RWSEM)
2031  打印标准信息("\n")
2033  print_testname("mixed read-lock/lock-write ABBA")
2034  打印标准信息(" |")
2035  dotest(ad_lock(A)* spin_lock(B)* spin_lock(B)* write_lock(A), FAILURE, LOCKTYPE_RWLOCK)
2044  打印标准信息(" |")
2045  dotest(rwsem_ABBA1, FAILURE, LOCKTYPE_RWSEM)
2047  print_testname("mixed read-lock/lock-read ABBA")
2048  打印标准信息(" |")
2049  dotest(ad_lock(A)* spin_lock(B)* spin_lock(B)* read_lock(A), SUCCESS, LOCKTYPE_RWLOCK)
2050  打印标准信息(" |")
2051  dotest(rwsem_ABBA2, FAILURE, LOCKTYPE_RWSEM)
2053  print_testname("mixed write-lock/lock-write ABBA")
2054  打印标准信息(" |")
2055  dotest(write_lock(A)* spin_lock(B)* spin_lock(B)* write_lock(A), FAILURE, LOCKTYPE_RWLOCK)
2056  打印标准信息(" |")
2057  dotest(rwsem_ABBA3, FAILURE, LOCKTYPE_RWSEM)
2059  printk(" --------------------------------------------------------------------------\n")
2074  ww_tests()
2076  如果unexpected_testcase_failures
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  否则如果expected_testcase_failurestestcase_successes
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  否则如果expected_testcase_failures且非testcase_successes
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  否则
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
调用者
名称描述
start_kernel启动内核