Function report |
Source Code:kernel\rcu\rcutorture.c |
Create Date:2022-07-28 10:22:51 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:rcu_torture_init
Proto:static int __init rcu_torture_init(void)
Type:int
Parameter:Nothing
| 2346 | firsterr = 0 |
| 2347 | static struct rcu_torture_ops * torture_ops[] = { & rcu_ops, & rcu_busted_ops, & srcu_ops, & As above, but dynamically allocated. , & As above, but broken due to inappropriate reader extension. , & tasks_ops, & trivial_ops, } |
| 2352 | If Not Initialize torture module Then Return -EBUSY |
| 2357 | cur_ops = torture_ops[i] |
| 2358 | If strcmp(torture_type, name) == 0 Then Break |
| 2362 | pr_alert("rcu-torture: invalid torture type: \"%s\"\n", torture_type) |
| 2364 | pr_alert("rcu-torture types:") |
| 2368 | WARN_ON(!IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0* otherwise.(CONFIG_RCU_TORTURE_TEST)) |
| 2370 | cur_ops = NULL |
| 2371 | Go to unwind |
| 2373 | If fqs == NULL && fqs_duration != 0 Then |
| 2374 | pr_alert("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n") |
| 2375 | fqs_duration = 0 |
| 2380 | If nreaders >= 0 Then |
| 2381 | nrealreaders = nreaders |
| 2382 | Else |
| 2383 | nrealreaders = num_online_cpus() - 2 - nreaders |
| 2384 | If nrealreaders <= 0 Then nrealreaders = 1 |
| 2387 | rcu_torture_print_module_parms(cur_ops, "Start of test") |
| 2393 | rtort_mbtest = 0 |
| 2400 | rcu_torture_current = NULL |
| 2401 | rcu_torture_current_version = 0 |
| 2402 | atomic_set( & n_rcu_torture_alloc, 0) |
| 2403 | atomic_set( & n_rcu_torture_alloc_fail, 0) |
| 2404 | atomic_set( & n_rcu_torture_free, 0) |
| 2405 | atomic_set( & n_rcu_torture_mberror, 0) |
| 2406 | atomic_set( & n_rcu_torture_error, 0) |
| 2407 | n_rcu_torture_barrier_error = 0 |
| 2408 | n_rcu_torture_boost_ktrerror = 0 |
| 2409 | n_rcu_torture_boost_rterror = 0 |
| 2410 | n_rcu_torture_boost_failure = 0 |
| 2411 | n_rcu_torture_boosts = 0 |
| 2412 | When i < RCU_TORTURE_PIPE_LEN + 1 cycle atomic_set( & rcu_torture_wcount[i], 0) |
| 2414 | for_each_possible_cpu(cpu) |
| 2415 | When i < RCU_TORTURE_PIPE_LEN + 1 cycle |
| 2416 | per_cpu(rcu_torture_count, cpu)[i] = 0 |
| 2417 | per_cpu(rcu_torture_batch, cpu)[i] = 0 |
| 2420 | err_segs_recorded = 0 |
| 2421 | rt_read_nsegs = 0 |
| 2429 | If nfakewriters > 0 Then |
| 2430 | fakewriter_tasks = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
| 2433 | If (fakewriter_tasks == NULL) Then |
| 2439 | When i < nfakewriters cycle |
| 2445 | reader_tasks = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
| 2447 | If (reader_tasks == NULL) Then |
| 2452 | When i < nrealreaders cycle |
| 2458 | If stat_interval > 0 Then |
| 2464 | If test_no_idle_hz && shuffle_interval > 0 Then |
| 2465 | firsterr = torture_shuffle_init(shuffle_interval * HZ) |
| 2471 | If stutter Then |
| 2475 | firsterr = torture_stutter_init(stutter * HZ, t) |
| 2479 | If fqs_duration < 0 Then fqs_duration = 0 |
| 2481 | If fqs_duration Then |
| 2488 | If test_boost_interval < 1 Then test_boost_interval = 1 |
| 2490 | If test_boost_duration < 2 Then test_boost_duration = 2 |
| 2492 | If rcu_torture_can_boost() Then |
| 2503 | shutdown_jiffies = jiffies + shutdown_secs * HZ |
| 2520 | If object_debug Then Verify that double-free causes debug-objects to complain, but only* if CONFIG_DEBUG_OBJECTS_RCU_HEAD=y. Otherwise, say that the test* cannot be carried out. |
| 2523 | Return 0 |
| 2525 | unwind : |
| 2527 | rcu_torture_cleanup() |
| 2528 | Return firsterr |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |