Function report |
Source Code:kernel\bpf\syscall.c |
Create Date:2022-07-28 12:53:48 |
| Last Modify:2022-05-19 18:06:12 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:bpf_raw_tracepoint_open
Proto:static int bpf_raw_tracepoint_open(const union bpf_attr *attr)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| const union bpf_attr * | attr |
| 1953 | If helper macro to check that unused fields 'union bpf_attr' are zero (BPF_RAW_TRACEPOINT_OPEN) Then Return -EINVAL |
| 1956 | prog = bpf_prog_get(prog_fd) |
| 1964 | Go to out_put_prog |
| 1967 | If Type of BPF program == BPF_PROG_TYPE_TRACING Then |
| 1968 | If name Then |
| 1973 | Go to out_put_prog |
| 1975 | If For some prog types == BPF_TRACE_RAW_TP Then tp_name = function name for valid attach_btf_id |
| 1977 | Else Return bpf_tracing_prog_attach(prog) |
| 1979 | Else |
| 1980 | If Copy a NUL terminated string from userspace < 0 Then |
| 1984 | Go to out_put_prog |
| 1990 | btp = bpf_get_raw_tracepoint(tp_name) |
| 1991 | If Not btp Then |
| 1993 | Go to out_put_prog |
| 1996 | raw_tp = 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). |
| 1997 | If Not raw_tp Then |
| 1999 | Go to out_put_btp |
| 2004 | err = bpf_probe_register(btp, prog) |
| 2005 | If err Then Go to out_free_tp |
| 2008 | tp_fd = anon_inode_getfd("bpf-raw-tracepoint", & bpf_raw_tp_fops, raw_tp, O_CLOEXEC) |
| 2010 | If tp_fd < 0 Then |
| 2015 | Return tp_fd |
| 2017 | out_free_tp : |
| 2019 | out_put_btp : |
| 2020 | bpf_put_raw_tracepoint(btp) |
| 2021 | out_put_prog : |
| 2022 | bpf_prog_put(prog) |
| 2023 | Return err |
| 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 |