diff options
| author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2020-08-05 20:14:39 +0300 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-08-06 10:21:32 -0700 |
| commit | 0cce4d348dcdd3408e18885a6c32e6f3ac84f7a9 (patch) | |
| tree | dd67ea186c64b3013056258a26162b408f1cf7ca /dynamic-layers/openembedded-layer/recipes-devtools | |
| parent | dc3d1ec4503c08aea0279a11304c39796ece51ae (diff) | |
| download | meta-clang-0cce4d348dcdd3408e18885a6c32e6f3ac84f7a9.tar.gz | |
bcc: upgrade 0.13.0 -> 0.15.0
Uprev bcc to v0.15.0:
* drop backports:
https://github.com/iovisor/bcc/commit/68abb51ed067c4317b991cec0bbc2ea4e7f6ddab
https://github.com/iovisor/bcc/commit/1c843e2c0f7570844a2c955436455132936eae47
* refresh patches
Fixes: #348
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Diffstat (limited to 'dynamic-layers/openembedded-layer/recipes-devtools')
| -rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Add-KBUILD_MODNAME-flag-to-default-cflags.patch | 27 | ||||
| -rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Delete-existing-kbuild_modname-definitions.patch | 176 | ||||
| -rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch | 35 | ||||
| -rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb (renamed from dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.13.0.bb) | 4 |
4 files changed, 18 insertions, 224 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Add-KBUILD_MODNAME-flag-to-default-cflags.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Add-KBUILD_MODNAME-flag-to-default-cflags.patch deleted file mode 100644 index 1ca73ba..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Add-KBUILD_MODNAME-flag-to-default-cflags.patch +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | From 9e2415679e41adacc59dd7a426d505232f0b7129 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: William Findlay <william@williamfindlay.com> | ||
| 3 | Date: Wed, 17 Jun 2020 12:07:48 -0400 | ||
| 4 | Subject: [PATCH 1/2] Add KBUILD_MODNAME flag to default cflags | ||
| 5 | |||
| 6 | Upstream-Status: Backported [https://github.com/iovisor/bcc/pull/2974/commits/badd85c58549d0e7f0d536490c41213141e180c5] | ||
| 7 | |||
| 8 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 9 | --- | ||
| 10 | src/cc/frontends/clang/kbuild_helper.cc | 1 + | ||
| 11 | 1 file changed, 1 insertion(+) | ||
| 12 | |||
| 13 | diff --git a/src/cc/frontends/clang/kbuild_helper.cc b/src/cc/frontends/clang/kbuild_helper.cc | ||
| 14 | index db5ca7f6..e3aade89 100644 | ||
| 15 | --- a/src/cc/frontends/clang/kbuild_helper.cc | ||
| 16 | +++ b/src/cc/frontends/clang/kbuild_helper.cc | ||
| 17 | @@ -101,6 +101,7 @@ int KBuildHelper::get_flags(const char *uname_machine, vector<string> *cflags) { | ||
| 18 | cflags->push_back("-D__HAVE_BUILTIN_BSWAP16__"); | ||
| 19 | cflags->push_back("-D__HAVE_BUILTIN_BSWAP32__"); | ||
| 20 | cflags->push_back("-D__HAVE_BUILTIN_BSWAP64__"); | ||
| 21 | + cflags->push_back("-DKBUILD_MODNAME=\"bcc\""); | ||
| 22 | |||
| 23 | // If ARCH env variable is set, pass this along. | ||
| 24 | if (archenv) | ||
| 25 | -- | ||
| 26 | 2.26.2 | ||
| 27 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Delete-existing-kbuild_modname-definitions.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Delete-existing-kbuild_modname-definitions.patch deleted file mode 100644 index dd87997..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Delete-existing-kbuild_modname-definitions.patch +++ /dev/null | |||
| @@ -1,176 +0,0 @@ | |||
| 1 | From eb8b0487a05d650499b20fdd5edeb6e47c2c17a5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: William Findlay <william@williamfindlay.com> | ||
| 3 | Date: Wed, 17 Jun 2020 18:59:43 -0400 | ||
| 4 | Subject: [PATCH 2/2] Delete existing kbuild_modname definitions | ||
| 5 | |||
| 6 | Upstream-Status: Backported [https://github.com/iovisor/bcc/pull/2974/commits/a5bdc9c65746389d7072e1e8e583025dde78e91b] | ||
| 7 | |||
| 8 | Adjust context | ||
| 9 | |||
| 10 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
| 11 | --- | ||
| 12 | examples/networking/xdp/xdp_drop_count.py | 1 - | ||
| 13 | examples/networking/xdp/xdp_macswap_count.py | 1 - | ||
| 14 | examples/networking/xdp/xdp_redirect_cpu.py | 1 - | ||
| 15 | examples/networking/xdp/xdp_redirect_map.py | 1 - | ||
| 16 | tests/python/test_clang.py | 8 -------- | ||
| 17 | tools/tcplife.lua | 1 - | ||
| 18 | tools/tcplife.py | 1 - | ||
| 19 | tools/tcpstates.py | 1 - | ||
| 20 | 8 files changed, 15 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/examples/networking/xdp/xdp_drop_count.py b/examples/networking/xdp/xdp_drop_count.py | ||
| 23 | index f03273e9..512e0a20 100755 | ||
| 24 | --- a/examples/networking/xdp/xdp_drop_count.py | ||
| 25 | +++ b/examples/networking/xdp/xdp_drop_count.py | ||
| 26 | @@ -52,7 +52,6 @@ else: | ||
| 27 | |||
| 28 | # load BPF program | ||
| 29 | b = BPF(text = """ | ||
| 30 | -#define KBUILD_MODNAME "foo" | ||
| 31 | #include <uapi/linux/bpf.h> | ||
| 32 | #include <linux/in.h> | ||
| 33 | #include <linux/if_ether.h> | ||
| 34 | diff --git a/examples/networking/xdp/xdp_macswap_count.py b/examples/networking/xdp/xdp_macswap_count.py | ||
| 35 | index 0e2b21ca..770ce8ca 100755 | ||
| 36 | --- a/examples/networking/xdp/xdp_macswap_count.py | ||
| 37 | +++ b/examples/networking/xdp/xdp_macswap_count.py | ||
| 38 | @@ -50,7 +50,6 @@ else: | ||
| 39 | |||
| 40 | # load BPF program | ||
| 41 | b = BPF(text = """ | ||
| 42 | -#define KBUILD_MODNAME "foo" | ||
| 43 | #include <uapi/linux/bpf.h> | ||
| 44 | #include <linux/in.h> | ||
| 45 | #include <linux/if_ether.h> | ||
| 46 | diff --git a/examples/networking/xdp/xdp_redirect_cpu.py b/examples/networking/xdp/xdp_redirect_cpu.py | ||
| 47 | index 15b0d09b..470079f4 100755 | ||
| 48 | --- a/examples/networking/xdp/xdp_redirect_cpu.py | ||
| 49 | +++ b/examples/networking/xdp/xdp_redirect_cpu.py | ||
| 50 | @@ -30,7 +30,6 @@ if (cpu_id > max_cpu): | ||
| 51 | |||
| 52 | # load BPF program | ||
| 53 | b = BPF(text = """ | ||
| 54 | -#define KBUILD_MODNAME "foo" | ||
| 55 | #include <uapi/linux/bpf.h> | ||
| 56 | #include <linux/in.h> | ||
| 57 | #include <linux/if_ether.h> | ||
| 58 | diff --git a/examples/networking/xdp/xdp_redirect_map.py b/examples/networking/xdp/xdp_redirect_map.py | ||
| 59 | index 4a622723..4936ac1e 100755 | ||
| 60 | --- a/examples/networking/xdp/xdp_redirect_map.py | ||
| 61 | +++ b/examples/networking/xdp/xdp_redirect_map.py | ||
| 62 | @@ -29,7 +29,6 @@ out_idx = ip.link_lookup(ifname=out_if)[0] | ||
| 63 | |||
| 64 | # load BPF program | ||
| 65 | b = BPF(text = """ | ||
| 66 | -#define KBUILD_MODNAME "foo" | ||
| 67 | #include <uapi/linux/bpf.h> | ||
| 68 | #include <linux/in.h> | ||
| 69 | #include <linux/if_ether.h> | ||
| 70 | diff --git a/tests/python/test_clang.py b/tests/python/test_clang.py | ||
| 71 | index 886eebed..648494cf 100755 | ||
| 72 | --- a/tests/python/test_clang.py | ||
| 73 | +++ b/tests/python/test_clang.py | ||
| 74 | @@ -78,7 +78,6 @@ int count_foo(struct pt_regs *ctx, unsigned long a, unsigned long b) { | ||
| 75 | |||
| 76 | def test_probe_read3(self): | ||
| 77 | text = """ | ||
| 78 | -#define KBUILD_MODNAME "foo" | ||
| 79 | #include <net/tcp.h> | ||
| 80 | #define _(P) ({typeof(P) val = 0; bpf_probe_read(&val, sizeof(val), &P); val;}) | ||
| 81 | int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { | ||
| 82 | @@ -90,7 +89,6 @@ int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { | ||
| 83 | |||
| 84 | def test_probe_read4(self): | ||
| 85 | text = """ | ||
| 86 | -#define KBUILD_MODNAME "foo" | ||
| 87 | #include <net/tcp.h> | ||
| 88 | #define _(P) ({typeof(P) val = 0; bpf_probe_read(&val, sizeof(val), &P); val;}) | ||
| 89 | int test(struct pt_regs *ctx, struct sk_buff *skb) { | ||
| 90 | @@ -102,7 +100,6 @@ int test(struct pt_regs *ctx, struct sk_buff *skb) { | ||
| 91 | |||
| 92 | def test_probe_read_whitelist1(self): | ||
| 93 | text = """ | ||
| 94 | -#define KBUILD_MODNAME "foo" | ||
| 95 | #include <net/tcp.h> | ||
| 96 | int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { | ||
| 97 | // The below define is in net/tcp.h: | ||
| 98 | @@ -120,7 +117,6 @@ int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { | ||
| 99 | |||
| 100 | def test_probe_read_whitelist2(self): | ||
| 101 | text = """ | ||
| 102 | -#define KBUILD_MODNAME "foo" | ||
| 103 | #include <net/tcp.h> | ||
| 104 | int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { | ||
| 105 | // The below define is in net/tcp.h: | ||
| 106 | @@ -1072,7 +1068,6 @@ int test(struct __sk_buff *ctx) { | ||
| 107 | |||
| 108 | def test_probe_read_return(self): | ||
| 109 | text = """ | ||
| 110 | -#define KBUILD_MODNAME "foo" | ||
| 111 | #include <uapi/linux/ptrace.h> | ||
| 112 | #include <linux/tcp.h> | ||
| 113 | static inline unsigned char *my_skb_transport_header(struct sk_buff *skb) { | ||
| 114 | @@ -1088,7 +1083,6 @@ int test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) { | ||
| 115 | |||
| 116 | def test_probe_read_multiple_return(self): | ||
| 117 | text = """ | ||
| 118 | -#define KBUILD_MODNAME "foo" | ||
| 119 | #include <uapi/linux/ptrace.h> | ||
| 120 | #include <linux/tcp.h> | ||
| 121 | static inline u64 error_function() { | ||
| 122 | @@ -1109,7 +1103,6 @@ int test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) { | ||
| 123 | |||
| 124 | def test_probe_read_return_expr(self): | ||
| 125 | text = """ | ||
| 126 | -#define KBUILD_MODNAME "foo" | ||
| 127 | #include <uapi/linux/ptrace.h> | ||
| 128 | #include <linux/tcp.h> | ||
| 129 | static inline unsigned char *my_skb_transport_header(struct sk_buff *skb) { | ||
| 130 | @@ -1125,7 +1118,6 @@ int test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) { | ||
| 131 | |||
| 132 | def test_probe_read_return_call(self): | ||
| 133 | text = """ | ||
| 134 | -#define KBUILD_MODNAME "foo" | ||
| 135 | #include <uapi/linux/ptrace.h> | ||
| 136 | #include <linux/tcp.h> | ||
| 137 | static inline struct tcphdr *my_skb_transport_header(struct sk_buff *skb) { | ||
| 138 | diff --git a/tools/tcplife.lua b/tools/tcplife.lua | ||
| 139 | index 3f4f6afd..5e311631 100755 | ||
| 140 | --- a/tools/tcplife.lua | ||
| 141 | +++ b/tools/tcplife.lua | ||
| 142 | @@ -25,7 +25,6 @@ uint16_t ntohs(uint16_t netshort); | ||
| 143 | |||
| 144 | local program = [[ | ||
| 145 | #include <uapi/linux/ptrace.h> | ||
| 146 | -#define KBUILD_MODNAME "foo" | ||
| 147 | #include <linux/tcp.h> | ||
| 148 | #include <net/sock.h> | ||
| 149 | #include <bcc/proto.h> | ||
| 150 | diff --git a/tools/tcplife.py b/tools/tcplife.py | ||
| 151 | index d4e679dd..c2bd8236 100755 | ||
| 152 | --- a/tools/tcplife.py | ||
| 153 | +++ b/tools/tcplife.py | ||
| 154 | @@ -66,7 +66,6 @@ debug = 0 | ||
| 155 | # define BPF program | ||
| 156 | bpf_text = """ | ||
| 157 | #include <uapi/linux/ptrace.h> | ||
| 158 | -#define KBUILD_MODNAME "foo" | ||
| 159 | #include <linux/tcp.h> | ||
| 160 | #include <net/sock.h> | ||
| 161 | #include <bcc/proto.h> | ||
| 162 | diff --git a/tools/tcpstates.py b/tools/tcpstates.py | ||
| 163 | index b9a64387..09bbe0ce 100755 | ||
| 164 | --- a/tools/tcpstates.py | ||
| 165 | +++ b/tools/tcpstates.py | ||
| 166 | @@ -61,7 +61,6 @@ debug = 0 | ||
| 167 | # define BPF program | ||
| 168 | bpf_text = """ | ||
| 169 | #include <uapi/linux/ptrace.h> | ||
| 170 | -#define KBUILD_MODNAME "foo" | ||
| 171 | #include <linux/tcp.h> | ||
| 172 | #include <net/sock.h> | ||
| 173 | #include <bcc/proto.h> | ||
| 174 | -- | ||
| 175 | 2.26.2 | ||
| 176 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch index f2b1495..fb659cc 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 935f7e47f54df1af30f4a1cdfd2f385863ab9dec Mon Sep 17 00:00:00 2001 | 1 | From 8e12b10e7576a6d47e0dc2cdc36caeb9ba26fa12 Mon Sep 17 00:00:00 2001 |
| 2 | From: He Zhe <zhe.he@windriver.com> | 2 | From: He Zhe <zhe.he@windriver.com> |
| 3 | Date: Mon, 15 Jun 2020 07:05:24 +0000 | 3 | Date: Mon, 15 Jun 2020 07:05:24 +0000 |
| 4 | Subject: [PATCH] tools: opensnoop: snoop do_sys_openat2 for kernel v5.6 and | 4 | Subject: [PATCH] tools: opensnoop: snoop do_sys_openat2 for kernel v5.6 and |
| @@ -12,14 +12,14 @@ Upstream-Status: Inappropriate, upstream context has changed and needs more | |||
| 12 | 12 | ||
| 13 | Signed-off-by: He Zhe <zhe.he@windriver.com> | 13 | Signed-off-by: He Zhe <zhe.he@windriver.com> |
| 14 | --- | 14 | --- |
| 15 | tools/opensnoop.py | 13 +++++++++++-- | 15 | tools/opensnoop.py | 12 ++++++++++-- |
| 16 | 1 file changed, 11 insertions(+), 2 deletions(-) | 16 | 1 file changed, 10 insertions(+), 2 deletions(-) |
| 17 | 17 | ||
| 18 | diff --git a/tools/opensnoop.py b/tools/opensnoop.py | 18 | diff --git a/tools/opensnoop.py b/tools/opensnoop.py |
| 19 | index 6d1388b3..3f7e48a3 100755 | 19 | index 51d3dc05..522812d4 100755 |
| 20 | --- a/tools/opensnoop.py | 20 | --- a/tools/opensnoop.py |
| 21 | +++ b/tools/opensnoop.py | 21 | +++ b/tools/opensnoop.py |
| 22 | @@ -21,6 +21,8 @@ from bcc.utils import printb | 22 | @@ -22,6 +22,8 @@ from bcc.utils import printb |
| 23 | import argparse | 23 | import argparse |
| 24 | from datetime import datetime, timedelta | 24 | from datetime import datetime, timedelta |
| 25 | import os | 25 | import os |
| @@ -28,24 +28,23 @@ index 6d1388b3..3f7e48a3 100755 | |||
| 28 | 28 | ||
| 29 | # arguments | 29 | # arguments |
| 30 | examples = """examples: | 30 | examples = """examples: |
| 31 | @@ -195,8 +197,15 @@ if debug or args.ebpf: | 31 | @@ -235,8 +237,14 @@ if debug or args.ebpf: |
| 32 | |||
| 33 | # initialize BPF | 32 | # initialize BPF |
| 34 | b = BPF(text=bpf_text) | 33 | b = BPF(text=bpf_text) |
| 35 | -b.attach_kprobe(event="do_sys_open", fn_name="trace_entry") | 34 | if not is_support_kfunc: |
| 36 | -b.attach_kretprobe(event="do_sys_open", fn_name="trace_return") | 35 | - b.attach_kprobe(event="do_sys_open", fn_name="trace_entry") |
| 37 | + | 36 | - b.attach_kretprobe(event="do_sys_open", fn_name="trace_return") |
| 38 | +# Since kernel v5.6, do_sys_openat2 instead of do_sys_open has been used as entry function for open | 37 | + # Since kernel v5.6, do_sys_openat2 instead of do_sys_open has been used as entry function for open |
| 39 | +if parse_version(platform.uname().release.split('-')[0]) > parse_version('5.6.0'): | 38 | + if parse_version(platform.uname().release.split('-')[0]) > parse_version('5.6.0'): |
| 40 | + entry = "do_sys_openat2" | 39 | + entry = "do_sys_openat2" |
| 41 | +else: | 40 | + else: |
| 42 | + entry = "do_sys_open" | 41 | + entry = "do_sys_open" |
| 43 | + | 42 | + |
| 44 | +b.attach_kprobe(event=entry, fn_name="trace_entry") | 43 | + b.attach_kprobe(event=entry, fn_name="trace_entry") |
| 45 | +b.attach_kretprobe(event=entry, fn_name="trace_return") | 44 | + b.attach_kretprobe(event=entry, fn_name="trace_return") |
| 46 | 45 | ||
| 47 | initial_ts = 0 | 46 | initial_ts = 0 |
| 48 | 47 | ||
| 49 | -- | 48 | -- |
| 50 | 2.24.1 | 49 | 2.17.1 |
| 51 | 50 | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.13.0.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb index 5a628db..2df77ed 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.13.0.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb | |||
| @@ -17,11 +17,9 @@ RDEPENDS_${PN} += "bash python3 python3-core python3-setuptools xz" | |||
| 17 | SRC_URI = "gitsm://github.com/iovisor/bcc \ | 17 | SRC_URI = "gitsm://github.com/iovisor/bcc \ |
| 18 | file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ | 18 | file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ |
| 19 | file://0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch \ | 19 | file://0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch \ |
| 20 | file://0001-Add-KBUILD_MODNAME-flag-to-default-cflags.patch \ | ||
| 21 | file://0001-Delete-existing-kbuild_modname-definitions.patch \ | ||
| 22 | " | 20 | " |
| 23 | 21 | ||
| 24 | SRCREV = "942227484d3207f6a42103674001ef01fb5335a0" | 22 | SRCREV = "e41f7a3be5c8114ef6a0990e50c2fbabea0e928e" |
| 25 | 23 | ||
| 26 | S = "${WORKDIR}/git" | 24 | S = "${WORKDIR}/git" |
| 27 | 25 | ||
