aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryonghong-song <ys114321@gmail.com>2018-10-29 12:41:36 -0700
committerGitHub <noreply@github.com>2018-10-29 12:41:36 -0700
commit895aefda8417f2b8bce4d9e637d83c3d6a368153 (patch)
treee5fd48dc7f2255b34099a5f85f91fe2110acde4e
parentf3fc87aab83ce3e4f1ca227e33853df21147255a (diff)
parent1589a4f055710e5ef9e1adf24df18e6d0ece05f0 (diff)
downloadbcc-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-xsrc/cc/export/helpers.h8
-rw-r--r--src/cc/frontends/clang/tp_frontend_action.cc6
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";
}