函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\rcu\rcuperf.c Create Date:2022-07-27 11:24:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:rcu_perf_init

函数原型:static int __init rcu_perf_init(void)

返回类型:int

参数:

591  firsterr等于0
592  static struct rcu_perf_ops * perf_ops[] = { & rcu_ops, & srcu_ops, & srcud_ops, & tasks_ops, }
596  如果非Initialize torture module则返回:负EBUSY
600 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(perf_ops)循环
601  cur_ops等于perf_ops[i]
602  如果字符串比较恒等于0则退出
605  如果i恒等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(perf_ops)则
606  打印警报信息("rcu-perf: invalid perf type: \"%s\"\n", perf_type)
607  打印警报信息("rcu-perf types:")
608 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(perf_ops)循环打印标准信息(" %s", name)
610  打印标准信息("\n")
611  WARN_ON(!IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0* otherwise.(CONFIG_RCU_PERF_TEST))
612  firsterr等于负EINVAL
613  cur_ops = NULL
614  转到:unwind
616  如果initinit()
619  nrealwriters等于Return the number if non-negative. If -1, the number of CPUs.* If less than -1, that much less than the number of CPUs, but* at least one.
620  nrealreaders等于Return the number if non-negative. If -1, the number of CPUs.* If less than -1, that much less than the number of CPUs, but* at least one.
621  atomic_set( & n_rcu_perf_reader_started, 0)
622  atomic_set( & n_rcu_perf_writer_started, 0)
623  atomic_set( & n_rcu_perf_writer_finished, 0)
624  rcu_perf_print_module_parms(cur_ops, "Start of test")
628  如果shutdown
629  init_waitqueue_head( & shutdown_wq)
630  firsterr等于torture_create_kthread(RCU perf shutdown kthread. Just waits to be awakened, then shuts* down system., NULL, shutdown_task)
632  如果firsterr则转到:unwind
634  schedule_timeout_uninterruptible(1)
636  reader_tasks等于分配数组内存并置零
638  如果(reader_tasks == NULL)则
639  VERBOSE_PERFOUT_ERRSTRING("out of memory")
640  firsterr等于负ENOMEM
641  转到:unwind
643 i小于nrealreaders循环
644  firsterr等于torture_create_kthread(RCU perf reader kthread. Repeatedly does empty RCU read-side* critical section, minimizing update-side interference., (void * )i, reader_tasks[i])
646  如果firsterr则转到:unwind
649 atomic_read( & n_rcu_perf_reader_started)小于nrealreaders循环
650  schedule_timeout_uninterruptible(1)
651  writer_tasks等于分配数组内存并置零
653  writer_durations等于分配数组内存并置零
655  writer_n_durations等于分配数组内存并置零
658  如果非writer_tasks或非writer_durations或非writer_n_durations
659  VERBOSE_PERFOUT_ERRSTRING("out of memory")
660  firsterr等于负ENOMEM
661  转到:unwind
663 i小于nrealwriters循环
664  writer_durations[i]等于分配数组内存并置零
667  如果非writer_durations[i]则
668  firsterr等于负ENOMEM
669  转到:unwind
671  firsterr等于torture_create_kthread(RCU perf writer kthread. Repeatedly does a grace period., (void * )i, writer_tasks[i])
673  如果firsterr则转到:unwind
676  Tell the torture module that initialization is complete.
677  返回:0
679  unwind :
680  Tell the torture module that initialization is complete.
681  rcu_perf_cleanup()
682  返回:firsterr