Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\interval_tree_test.c Create Date:2022-07-28 07:21:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:interval_tree_test_init

Proto:static int interval_tree_test_init(void)

Type:int

Parameter:Nothing

68  nodes = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
70  If Not nodes Then Return -ENOMEM
73  queries = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
74  If Not queries Then
75  kfree(nodes)
76  Return -ENOMEM
79  printk(action must be taken immediately "interval tree insert/remove")
81  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.
82  init()
84  time1 = get_cycles()
86  When i < perf_loops cycle
87  When j < nnodes cycle interval_tree_insert(nodes + j, & root)
89  When j < nnodes cycle interval_tree_remove(nodes + j, & root)
93  time2 = get_cycles()
94  time = time2 - time1
96  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
97  printk(" -> %llu cycles\n", (unsignedlonglong)time)
99  printk(action must be taken immediately "interval tree search")
101  When j < nnodes cycle interval_tree_insert(nodes + j, & root)
104  time1 = get_cycles()
106  results = 0
107  When i < search_loops cycle When j < nsearches cycle
109  start = If search_all Then 0 Else queries[j]
110  last = If search_all Then max_endpoint Else queries[j]
112  results += search( & root, start, last)
115  time2 = get_cycles()
116  time = time2 - time1
118  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
119  results = 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
120  printk(" -> %llu cycles (%lu results)\n", (unsignedlonglong)time, results)
123  kfree(queries)
124  kfree(nodes)
126  Return -EAGAIN