函数逻辑报告 |
Source Code:kernel\locking\locktorture.c |
Create Date:2022-07-27 10:54:56 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:lock_torture_init
函数原型:static int __init lock_torture_init(void)
返回类型:int
参数:无
842 | firsterr等于0 |
843 | static struct lock_torture_ops * torture_ops[] = { & lock_busted_ops, & spin_lock_ops, & spin_lock_irq_ops, & rw_lock_ops, & rw_lock_irq_ops, & mutex_lock_ops, & ww_mutex_lock_ops, & rwsem_lock_ops, & percpu_rwsem_lock_ops, } |
856 | 如果非Initialize torture module则返回:负EBUSY |
861 | cur_ops等于torture_ops[i] |
866 | 打印警报信息("lock-torture: invalid torture type: \"%s\"\n", torture_type) |
868 | 打印警报信息("lock-torture types:") |
869 | 以i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(torture_ops)循环打印警报信息(" %s", name) |
871 | 打印警报信息("\n") |
873 | 转到:unwind |
876 | 如果nwriters_stress恒等于0且nreaders_stress恒等于0则 |
885 | 如果nwriters_stress大于等于0则nrealwriters_stress等于nwriters_stress |
887 | 否则nrealwriters_stress等于2乘num_online_cpus() |
905 | 如果nwriters_stress则 |
906 | lock_is_write_held等于0 |
907 | writer statistics 等于分配数组内存 |
910 | 如果( writer statistics == NULL)则 |
916 | 以i小于nrealwriters_stress循环 |
917 | n_lock_fail等于0 |
918 | n_lock_acquired等于0 |
922 | 如果readlock则 |
923 | 如果nreaders_stress大于等于0则nrealreaders_stress等于nreaders_stress |
925 | 否则 |
931 | 如果nwriters_stress小于0则nrealwriters_stress等于num_online_cpus() |
936 | 如果nreaders_stress则 |
937 | lock_is_read_held等于0 |
938 | reader statistics 等于分配数组内存 |
941 | 如果( reader statistics == NULL)则 |
942 | VERBOSE_TOROUT_STRING("cxt.lrsa: Out of memory") |
944 | 释放内存 |
945 | writer statistics = NULL |
946 | 转到:unwind |
949 | 以i小于nrealreaders_stress循环 |
950 | n_lock_fail等于0 |
951 | n_lock_acquired等于0 |
956 | lock_torture_print_module_parms(cur_ops, "Start of test") |
959 | 如果onoff_interval大于0则 |
960 | firsterr等于torture_onoff_init(onoff_holdoff * HZ, onoff_interval * HZ, NULL) |
965 | 如果shuffle_interval大于0则 |
970 | 如果shutdown_secs大于0则 |
976 | 如果stutter大于0则 |
982 | 如果nwriters_stress则 |
983 | writer_tasks等于分配数组内存并置零 |
986 | 如果(writer_tasks == NULL)则 |
993 | 如果readlock则 |
994 | reader_tasks等于分配数组内存并置零 |
997 | 如果(reader_tasks == NULL)则 |
998 | VERBOSE_TOROUT_ERRSTRING("reader_tasks: Out of memory") |
999 | 释放内存 |
1000 | writer_tasks = NULL |
1002 | 转到:unwind |
1014 | 以i小于nrealwriters_stress或j小于nrealreaders_stress循环 |
1016 | 如果i大于等于nrealwriters_stress则转到:create_reader |
1020 | firsterr等于torture_create_kthread(Lock torture writer kthread. Repeatedly acquires and releases* the lock, checking for duplicate acquisitions., & writer statistics [i], writer_tasks[i]) |
1025 | create_reader : |
1026 | 如果readlock恒等于NULL或j大于等于nrealreaders_stress则继续下一循环 |
1034 | 如果stat_interval大于0则 |
1041 | 返回:0 |
1043 | unwind : |
1045 | Forward reference. |
1046 | 返回:firsterr |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |