Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Allocate new trace_probe and initialize it (including kprobes).

Proto:static struct trace_kprobe *alloc_trace_kprobe(const char *group, const char *event, void *addr, const char *symbol, unsigned long offs, int maxactive, int nargs, bool is_return)

Type:struct trace_kprobe

Parameter:

TypeParameterName
const char *group
const char *event
void *addr
const char *symbol
unsigned longoffs
intmaxactive
intnargs
boolis_return
265  ret = -ENOMEM
267  tk = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
268  If Not tk Then Return ERR_PTR(ret)
271  nhit = alloc_percpu(unsignedlong)
272  If Not nhit Then Go to error
275  If symbol Then
276  symbol name = kstrdup(symbol, GFP_KERNEL)
277  If Not symbol name Then Go to error
279  Allow user to indicate symbol name of the probe point = symbol name
280  Offset into the symbol = offs
281  Else location of the probe point = addr
284  If is_return Then handler = kretprobe_dispatcher
286  Else Called before addr is executed. = kprobe_dispatcher
289  maxactive = maxactive
290  INIT_HLIST_NODE( & hlist)
291  Initialization list head
293  ret = trace_probe_init( & tp, event, group, false)
294  If ret < 0 Then Go to error
297  dyn_event_init( & devent, & trace_kprobe_ops)
298  Return tk
299  error :
300  free_trace_kprobe(tk)
301  Return ERR_PTR(ret)
Caller
NameDescribe
trace_kprobe_create