Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:find_bit_test

Proto:static int __init find_bit_test(void)

Type:int

Parameter:Nothing

116  nbits = BITMAP_LEN / SPARSE
118  pr_err("\nStart testing find_bit() with random-filled bitmap\n")
120  get_random_bytes(bitmap, size of bitmap )
121  get_random_bytes(bitmap2, size of bitmap2 )
123  test_find_next_bit(bitmap, BITMAP_LEN)
124  test_find_next_zero_bit(bitmap, BITMAP_LEN)
125  test_find_last_bit(bitmap, BITMAP_LEN)
131  This is Schlemiel the Painter's algorithm. It should be called after* all other tests for the same bitmap because it sets all bits of bitmap to 1.
132  test_find_next_and_bit(bitmap, bitmap2, BITMAP_LEN)
134  pr_err("\nStart testing find_bit() with sparse bitmap\n")
136  bitmap_zero(bitmap, BITMAP_LEN)
137  bitmap_zero(bitmap2, BITMAP_LEN)
139  When nbits-- cycle
140  __set_bit - Set a bit in memory*@nr: the bit to set*@addr: the address to start counting from* Unlike set_bit(), this function is non-atomic. If it is called on the same* region of memory concurrently, the effect may be that only one operation* succeeds.
141  __set_bit - Set a bit in memory*@nr: the bit to set*@addr: the address to start counting from* Unlike set_bit(), this function is non-atomic. If it is called on the same* region of memory concurrently, the effect may be that only one operation* succeeds.
144  test_find_next_bit(bitmap, BITMAP_LEN)
145  test_find_next_zero_bit(bitmap, BITMAP_LEN)
146  test_find_last_bit(bitmap, BITMAP_LEN)
147  This is Schlemiel the Painter's algorithm. It should be called after* all other tests for the same bitmap because it sets all bits of bitmap to 1.
148  test_find_next_and_bit(bitmap, bitmap2, BITMAP_LEN)
154  Return -EINVAL