diff options
author | yonghong-song <ys114321@gmail.com> | 2018-10-29 12:41:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-29 12:41:36 -0700 |
commit | 895aefda8417f2b8bce4d9e637d83c3d6a368153 (patch) | |
tree | e5fd48dc7f2255b34099a5f85f91fe2110acde4e | |
parent | f3fc87aab83ce3e4f1ca227e33853df21147255a (diff) | |
parent | 1589a4f055710e5ef9e1adf24df18e6d0ece05f0 (diff) | |
download | bcc-895aefda8417f2b8bce4d9e637d83c3d6a368153.zip bcc-895aefda8417f2b8bce4d9e637d83c3d6a368153.tar.gz bcc-895aefda8417f2b8bce4d9e637d83c3d6a368153.tar.bz2 |
Merge pull request #2019 from iovisor/yhs_dev
correct certain tracepoint types in tp frontend action
-rwxr-xr-x | src/cc/export/helpers.h | 8 | ||||
-rw-r--r-- | src/cc/frontends/clang/tp_frontend_action.cc | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/cc/export/helpers.h b/src/cc/export/helpers.h index d7065c8..882a79d 100755 --- a/src/cc/export/helpers.h +++ b/src/cc/export/helpers.h @@ -427,13 +427,13 @@ static struct bpf_sock *(*bpf_sk_lookup_udp)(void *ctx, (void *) BPF_FUNC_sk_lookup_udp; static int (*bpf_sk_release)(struct bpf_sock *sk) = (void *) BPF_FUNC_sk_release; -static int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) = +static int (*bpf_map_push_elem)(void *map, const void *value, u64 flags) = (void *) BPF_FUNC_map_push_elem; -static int bpf_map_pop_elem(struct bpf_map *map, void *value) = +static int (*bpf_map_pop_elem)(void *map, void *value) = (void *) BPF_FUNC_map_pop_elem; -static int bpf_map_peek_elem(struct bpf_map *map, void *value) = +static int (*bpf_map_peek_elem)(void *map, void *value) = (void *) BPF_FUNC_map_peek_elem; -static int bpf_msg_push_data(struct sk_buff *skb, u32 start, u32 len, u64 flags) = +static int (*bpf_msg_push_data)(void *skb, u32 start, u32 len, u64 flags) = (void *) BPF_FUNC_msg_push_data; /* llvm builtin functions that eBPF C program may use to diff --git a/src/cc/frontends/clang/tp_frontend_action.cc b/src/cc/frontends/clang/tp_frontend_action.cc index 9047400..d6faf01 100644 --- a/src/cc/frontends/clang/tp_frontend_action.cc +++ b/src/cc/frontends/clang/tp_frontend_action.cc @@ -121,11 +121,13 @@ static inline field_kind_t _get_field_kind(string const& line, } else if (size == 8) { if (field_type == "char" || field_type == "short" || field_type == "int" || field_type == "int8_t" || field_type == "int16_t" || - field_type == "int32_t") + field_type == "int32_t" || field_type == "pid_t") field_type = "s64"; if (field_type == "unsigned char" || field_type == "unsigned short" || field_type == "unsigned int" || field_type == "uint8_t" || - field_type == "uint16_t" || field_type == "uint32_t") + field_type == "uint16_t" || field_type == "uint32_t" || + field_type == "unsigned" || field_type == "u32" || + field_type == "uid_t" || field_type == "gid_t") field_type = "u64"; } |