函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rbtree_test_init

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

返回类型:int

参数:

248  nodes等于分配数组内存
249  如果非nodes则返回:负ENOMEM
252  printk(action must be taken immediately "rbtree testing")
254  prandom_seed_state - set seed for prandom_u32_state().*@state: pointer to state structure to receive the seed.*@seed: arbitrary 64-bit value to use as a seed.
255  init()
257  time1等于get_cycles()
259 i小于perf_loops循环
260 j小于nnodes循环insert(nodes + j, & root)
262 j小于nnodes循环erase(nodes + j, & root)
266  time2等于get_cycles()
267  time等于time2time1
269  time等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
270  printk(" -> test 1 (latency of nnodes insert+delete): %llu cycles\n", (unsignedlonglong)time)
273  time1等于get_cycles()
275 i小于perf_loops循环
276 j小于nnodes循环insert_cached(nodes + j, & root)
278 j小于nnodes循环erase_cached(nodes + j, & root)
282  time2等于get_cycles()
283  time等于time2time1
285  time等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
286  printk(" -> test 2 (latency of nnodes cached insert+delete): %llu cycles\n", (unsignedlonglong)time)
289 i小于nnodes循环insert(nodes + i, & root)
292  time1等于get_cycles()
294 i小于perf_loops循环
295 node循环
299  time2等于get_cycles()
300  time等于time2time1
302  time等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
303  printk(" -> test 3 (latency of inorder traversal): %llu cycles\n", (unsignedlonglong)time)
306  time1等于get_cycles()
308 i小于perf_loops循环node等于This function returns the first node (in sort order) of the tree.
311  time2等于get_cycles()
312  time等于time2time1
314  time等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
315  printk(" -> test 4 (latency to fetch first node)\n")
316  printk(" non-cached: %llu cycles\n", (unsignedlonglong)time)
318  time1等于get_cycles()
320 i小于perf_loops循环node等于Same as rb_first(), but O(1) ( & root)
323  time2等于get_cycles()
324  time等于time2time1
326  time等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
327  printk(" cached: %llu cycles\n", (unsignedlonglong)time)
329 i小于nnodes循环erase(nodes + i, & root)
333 i小于check_loops循环
334  init()
335 j小于nnodes循环
336  check(j)
337  insert(nodes + j, & root)
339 j小于nnodes循环
340  check(nnodes - j)
341  erase(nodes + j, & root)
343  check(0)
346  printk(action must be taken immediately "augmented rbtree testing")
348  init()
350  time1等于get_cycles()
352 i小于perf_loops循环
353 j小于nnodes循环insert_augmented(nodes + j, & root)
355 j小于nnodes循环erase_augmented(nodes + j, & root)
359  time2等于get_cycles()
360  time等于time2time1
362  time等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
363  printk(" -> test 1 (latency of nnodes insert+delete): %llu cycles\n", (unsignedlonglong)time)
365  time1等于get_cycles()
367 i小于perf_loops循环
368 j小于nnodes循环insert_augmented_cached(nodes + j, & root)
370 j小于nnodes循环erase_augmented_cached(nodes + j, & root)
374  time2等于get_cycles()
375  time等于time2time1
377  time等于div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
378  printk(" -> test 2 (latency of nnodes cached insert+delete): %llu cycles\n", (unsignedlonglong)time)
380 i小于check_loops循环
381  init()
382 j小于nnodes循环
386 j小于nnodes循环
388  erase_augmented(nodes + j, & root)
390  check_augmented(0)
393  kfree(nodes)
395  返回:负EAGAIN