Function report |
Source Code:lib\livepatch\test_klp_shadow_vars.c |
Create Date:2022-07-28 06:38:18 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:test_klp_shadow_vars_init
Proto:static int test_klp_shadow_vars_init(void)
Type:int
Parameter:Nothing
129 | obj = THIS_MODULE |
130 | id = 0x1234 |
131 | size = size of * |
132 | gfp_flags = GFP_KERNEL |
139 | ptr_id(NULL) |
149 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
156 | sv1 = shadow_alloc(obj, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var1) |
160 | sv2 = shadow_alloc(obj + 1, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var2) |
164 | sv3 = shadow_alloc(obj, id + 1, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var3) |
172 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
175 | If ret == sv1 && sv1 == var1 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv1), ptr_id( * sv1)) |
179 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
182 | If ret == sv2 && sv2 == var2 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv2), ptr_id( * sv2)) |
185 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
188 | If ret == sv3 && sv3 == var3 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv3), ptr_id( * sv3)) |
196 | sv4 = shadow_get_or_alloc(obj + 2, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var4) |
200 | ret = shadow_get_or_alloc(obj + 2, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var4) |
203 | If ret == sv4 && sv4 == var4 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv4), ptr_id( * sv4)) |
211 | shadow_free(obj, id, shadow_dtor) |
212 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
216 | shadow_free(obj + 1, id, shadow_dtor) |
217 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
221 | shadow_free(obj + 2, id, shadow_dtor) |
222 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
229 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
232 | If ret == sv3 && sv3 == var3 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv3), ptr_id( * sv3)) |
239 | shadow_free_all(id + 1, shadow_dtor) |
240 | ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead. |
245 | free_ptr_list() |
247 | Return 0 |
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 |