函数逻辑报告 |
Source Code:kernel\bpf\syscall.c |
Create Date:2022-07-27 14:07:34 |
Last Modify:2022-05-19 18:06:12 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:bpf_prog_get_info_by_fd
函数原型:static int bpf_prog_get_info_by_fd(struct bpf_prog *prog, const union bpf_attr *attr, union bpf_attr __user *uattr)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_prog * | prog | |
const union bpf_attr * | attr | |
union bpf_attr __user * | uattr |
2479 | __user乘uinfo等于u64_to_user_ptr(info) |
2480 | struct bpf_prog_info info = {} |
2490 | info_len等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, info的长度, info_len) |
2492 | 如果copy_from_user( & info, uinfo, info_len)则返回:负EFAULT |
2495 | type等于 Type of BPF program |
2497 | ns since boottime 等于 ns since boottime |
2505 | ulen等于nr_map_ids |
2506 | nr_map_ids等于used_map_cnt |
2507 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, nr_map_ids, ulen) |
2508 | 如果ulen则 |
2509 | __user乘user_map_ids等于u64_to_user_ptr(map_ids) |
2512 | 以i小于ulen循环如果put_user - Write a simple value into user space(id, & user_map_ids[i])则 |
2515 | 返回:负EFAULT |
2518 | err等于set_info_rec_size( & info) |
2522 | bpf_prog_get_stats(prog, & stats) |
2523 | run_time_ns等于nsecs |
2526 | 如果非操作权限检查则 |
2527 | jited_prog_len等于0 |
2528 | xlated_prog_len等于0 |
2529 | nr_jited_ksyms等于0 |
2530 | nr_jited_func_lens等于0 |
2531 | nr_func_info等于0 |
2532 | nr_line_info等于0 |
2533 | nr_jited_line_info等于0 |
2534 | 转到:done |
2537 | ulen等于xlated_prog_len |
2539 | 如果xlated_prog_len且ulen则 |
2543 | 如果 Was blinded 且非bpf_dump_raw_ok()则 |
2544 | xlated_prog_insns等于0 |
2545 | 转到:done |
2548 | 如果非insns_sanitized则返回:负ENOMEM |
2551 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, xlated_prog_len, ulen) |
2552 | fault等于copy_to_user(uinsns, insns_sanitized, ulen) |
2553 | kfree(insns_sanitized) |
2558 | 如果bpf_prog_is_dev_bound( Auxiliary fields )则 |
2569 | ulen等于jited_prog_len |
2573 | jited_prog_len等于0 |
2576 | 否则 |
2580 | 如果jited_prog_len且ulen则 |
2581 | 如果bpf_dump_raw_ok()则 |
2583 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, jited_prog_len, ulen) |
2604 | 否则 |
2605 | 如果copy_to_user(uinsns, bpf_func, ulen)则返回:负EFAULT |
2608 | 否则 |
2609 | jited_prog_insns等于0 |
2613 | ulen等于nr_jited_ksyms |
2615 | 如果ulen则 |
2616 | 如果bpf_dump_raw_ok()则 |
2618 | __user乘user_ksyms |
2624 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, nr_jited_ksyms, ulen) |
2625 | user_ksyms等于u64_to_user_ptr(jited_ksyms) |
2630 | 如果put_user - Write a simple value into user space((u64)ksym_addr, & user_ksyms[i])则返回:负EFAULT |
2634 | 否则 |
2636 | 如果put_user - Write a simple value into user space((u64)ksym_addr, & user_ksyms[0])则返回:负EFAULT |
2639 | 否则 |
2640 | jited_ksyms等于0 |
2644 | ulen等于nr_jited_func_lens |
2646 | 如果ulen则 |
2647 | 如果bpf_dump_raw_ok()则 |
2652 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, nr_jited_func_lens, ulen) |
2658 | 如果put_user - Write a simple value into user space(func_len, & user_lens[i])则返回:负EFAULT |
2661 | 否则 |
2663 | 如果put_user - Write a simple value into user space(func_len, & user_lens[0])则返回:负EFAULT |
2666 | 否则 |
2667 | jited_func_lens等于0 |
2674 | ulen等于nr_func_info |
2675 | nr_func_info等于func_info_cnt |
2676 | 如果nr_func_info且ulen则 |
2677 | __user乘user_finfo |
2679 | user_finfo等于u64_to_user_ptr(func_info) |
2680 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, nr_func_info, ulen) |
2681 | 如果copy_to_user(user_finfo, func_info, func_info_rec_size * ulen)则返回:负EFAULT |
2686 | ulen等于nr_line_info |
2687 | nr_line_info等于nr_linfo |
2688 | 如果nr_line_info且ulen则 |
2689 | __user乘user_linfo |
2691 | user_linfo等于u64_to_user_ptr(line_info) |
2698 | ulen等于nr_jited_line_info |
2701 | 否则nr_jited_line_info等于0 |
2703 | 如果nr_jited_line_info且ulen则 |
2704 | 如果bpf_dump_raw_ok()则 |
2705 | __user乘user_linfo |
2709 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, nr_jited_line_info, ulen) |
2715 | 否则 |
2716 | jited_line_info等于0 |
2720 | ulen等于nr_prog_tags |
2722 | 如果ulen则 |
2723 | __u8 __user( * user_prog_tags)[8] |
2727 | ulen等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, nr_prog_tags, ulen) |
2730 | 如果copy_to_user(user_prog_tags[i], tag, BPF_TAG_SIZE)则返回:负EFAULT |
2735 | 否则 |
2736 | 如果copy_to_user(user_prog_tags[0], tag, BPF_TAG_SIZE)则返回:负EFAULT |
2742 | done : |
2743 | 如果copy_to_user(uinfo, & info, info_len)或put_user - Write a simple value into user space(info_len, & info_len)则返回:负EFAULT |
2747 | 返回:0 |
名称 | 描述 |
---|---|
bpf_obj_get_info_by_fd |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |