函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:klp_patch_func

函数原型:static int klp_patch_func(struct klp_func *func)

返回类型:int

参数:

类型参数名称
struct klp_func *func
174  如果WARN_ON(!rnal )则返回:负EINVAL
177  如果WARN_ON(patched)则返回:负EINVAL
180  ops等于klp_find_ops(rnal )
181  如果非ops
184  ftrace_loc等于Convert a function address into the appropriate ftrace location.* Usually this is just the address of the function, but on some architectures* it's more complicated so allow them to provide a custom behaviour.
186  如果非ftrace_loc
187  打印错误信息("failed to find location for function '%s'\n", xternal )
189  返回:负EINVAL
192  ops等于分配内存并置零
193  如果非ops则返回:负ENOMEM
196  func等于klp_ftrace_handler
197  flags等于FTRACE_OPS_FL_SAVE_REGS按位或FTRACE_OPS_FL_DYNAMIC按位或FTRACE_OPS_FL_IPMODIFY按位或FTRACE_OPS_FL_PERMANENT
202  添加链表项
204  初始化链表头
205  添加RCU保护项
207  ret等于ftrace_set_filter_ip( & fops, ftrace_loc, 0, 0)
208  如果ret
209  打印错误信息("failed to set ftrace filter for function '%s' (%d)\n", xternal , ret)
211  转到:err
214  ret等于gister_ftrace_function - register a function for profiling*@ops - ops structure that holds the function for profiling
215  如果ret
216  打印错误信息("failed to register ftrace handler for function '%s' (%d)\n", xternal , ret)
219  转到:err
223  否则
224  添加RCU保护项
227  patched = true
229  返回:0
231  err :
232  删除不需要重新初始化的列表项
233  删除链表项
234  kfree(ops)
235  返回:ret
调用者
名称描述
klp_patch_object