Function report |
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 activity | Download SCCT | Chinese |
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:
| Type | Parameter | Name |
|---|---|---|
| const char * | group | |
| const char * | event | |
| void * | addr | |
| const char * | symbol | |
| unsigned long | offs | |
| int | maxactive | |
| int | nargs | |
| bool | is_return |
| 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). |
| 271 | nhit = alloc_percpu(unsignedlong) |
| 275 | If symbol Then |
| 276 | symbol name = kstrdup(symbol, GFP_KERNEL) |
| 277 | If Not symbol name Then Go to error |
| 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 |
| 290 | INIT_HLIST_NODE( & hlist) |
| 293 | ret = trace_probe_init( & tp, event, group, false) |
| 297 | dyn_event_init( & devent, & trace_kprobe_ops) |
| 298 | Return tk |
| 299 | error : |
| 300 | free_trace_kprobe(tk) |
| Name | Describe |
|---|---|
| trace_kprobe_create |
| 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 |