From a6780ec05f19efa97962f39990e369877a271320 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 29 2020 18:47:20 +0000 Subject: import bcc-0.14.0-3.el8 --- diff --git a/SOURCES/bcc-0.14.0-Add-KBUILD_MODNAME-flag-to-default-cflags.patch b/SOURCES/bcc-0.14.0-Add-KBUILD_MODNAME-flag-to-default-cflags.patch new file mode 100644 index 0000000..90f4ee4 --- /dev/null +++ b/SOURCES/bcc-0.14.0-Add-KBUILD_MODNAME-flag-to-default-cflags.patch @@ -0,0 +1,24 @@ +From 68abb51ed067c4317b991cec0bbc2ea4e7f6ddab Mon Sep 17 00:00:00 2001 +From: William Findlay +Date: Wed, 17 Jun 2020 12:07:48 -0400 +Subject: [PATCH] Add KBUILD_MODNAME flag to default cflags + +--- + src/cc/frontends/clang/kbuild_helper.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/cc/frontends/clang/kbuild_helper.cc b/src/cc/frontends/clang/kbuild_helper.cc +index db5ca7f6..e3aade89 100644 +--- a/src/cc/frontends/clang/kbuild_helper.cc ++++ b/src/cc/frontends/clang/kbuild_helper.cc +@@ -101,6 +101,7 @@ int KBuildHelper::get_flags(const char *uname_machine, vector *cflags) { + cflags->push_back("-D__HAVE_BUILTIN_BSWAP16__"); + cflags->push_back("-D__HAVE_BUILTIN_BSWAP32__"); + cflags->push_back("-D__HAVE_BUILTIN_BSWAP64__"); ++ cflags->push_back("-DKBUILD_MODNAME=\"bcc\""); + + // If ARCH env variable is set, pass this along. + if (archenv) +-- +2.25.4 + diff --git a/SOURCES/bcc-0.14.0-Delete-existing-kbuild_modname-definitions.patch b/SOURCES/bcc-0.14.0-Delete-existing-kbuild_modname-definitions.patch new file mode 100644 index 0000000..1a851df --- /dev/null +++ b/SOURCES/bcc-0.14.0-Delete-existing-kbuild_modname-definitions.patch @@ -0,0 +1,184 @@ +From 8999b2f610e84a2413dbea1717fe6e2ebcd1eea0 Mon Sep 17 00:00:00 2001 +From: William Findlay +Date: Wed, 17 Jun 2020 18:59:43 -0400 +Subject: [PATCH] Delete existing kbuild_modname definitions + +--- + examples/networking/xdp/xdp_drop_count.py | 1 - + examples/networking/xdp/xdp_macswap_count.py | 1 - + examples/networking/xdp/xdp_redirect_cpu.py | 1 - + examples/networking/xdp/xdp_redirect_map.py | 1 - + examples/tracing/nflatency.py | 1 - + tests/python/test_clang.py | 8 -------- + tools/tcplife.lua | 1 - + tools/tcplife.py | 1 - + tools/tcpstates.py | 1 - + 9 files changed, 16 deletions(-) + +diff --git a/examples/networking/xdp/xdp_drop_count.py b/examples/networking/xdp/xdp_drop_count.py +index f03273e9..512e0a20 100755 +--- a/examples/networking/xdp/xdp_drop_count.py ++++ b/examples/networking/xdp/xdp_drop_count.py +@@ -52,7 +52,6 @@ mode = BPF.XDP + + # load BPF program + b = BPF(text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + #include +diff --git a/examples/networking/xdp/xdp_macswap_count.py b/examples/networking/xdp/xdp_macswap_count.py +index 0e2b21ca..770ce8ca 100755 +--- a/examples/networking/xdp/xdp_macswap_count.py ++++ b/examples/networking/xdp/xdp_macswap_count.py +@@ -50,7 +50,6 @@ mode = BPF.XDP + + # load BPF program + b = BPF(text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + #include +diff --git a/examples/networking/xdp/xdp_redirect_cpu.py b/examples/networking/xdp/xdp_redirect_cpu.py +index 15b0d09b..470079f4 100755 +--- a/examples/networking/xdp/xdp_redirect_cpu.py ++++ b/examples/networking/xdp/xdp_redirect_cpu.py +@@ -30,7 +30,6 @@ max_cpu = cpu_count() + + # load BPF program + b = BPF(text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + #include +diff --git a/examples/networking/xdp/xdp_redirect_map.py b/examples/networking/xdp/xdp_redirect_map.py +index 4a622723..4936ac1e 100755 +--- a/examples/networking/xdp/xdp_redirect_map.py ++++ b/examples/networking/xdp/xdp_redirect_map.py +@@ -29,7 +29,6 @@ out_idx = ip.link_lookup(ifname=out_if)[0] + + # load BPF program + b = BPF(text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + #include +diff --git a/examples/tracing/nflatency.py b/examples/tracing/nflatency.py +index 76716490..c201930a 100755 +--- a/examples/tracing/nflatency.py ++++ b/examples/tracing/nflatency.py +@@ -12,7 +12,6 @@ import time + from bcc import BPF + + BPF_SRC = """ +-#define KBUILD_MODNAME "bpf_hook_nflatency" + #include + #include + #include +diff --git a/tests/python/test_clang.py b/tests/python/test_clang.py +index 886eebed..648494cf 100755 +--- a/tests/python/test_clang.py ++++ b/tests/python/test_clang.py +@@ -78,7 +78,6 @@ int count_foo(struct pt_regs *ctx, unsigned long a, unsigned long b) { + + def test_probe_read3(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + #define _(P) ({typeof(P) val = 0; bpf_probe_read(&val, sizeof(val), &P); val;}) + int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { +@@ -90,7 +89,6 @@ int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { + + def test_probe_read4(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + #define _(P) ({typeof(P) val = 0; bpf_probe_read(&val, sizeof(val), &P); val;}) + int test(struct pt_regs *ctx, struct sk_buff *skb) { +@@ -102,7 +100,6 @@ int test(struct pt_regs *ctx, struct sk_buff *skb) { + + def test_probe_read_whitelist1(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { + // The below define is in net/tcp.h: +@@ -120,7 +117,6 @@ int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { + + def test_probe_read_whitelist2(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { + // The below define is in net/tcp.h: +@@ -1072,7 +1068,6 @@ int test(struct __sk_buff *ctx) { + + def test_probe_read_return(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + static inline unsigned char *my_skb_transport_header(struct sk_buff *skb) { +@@ -1088,7 +1083,6 @@ int test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) { + + def test_probe_read_multiple_return(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + static inline u64 error_function() { +@@ -1109,7 +1103,6 @@ int test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) { + + def test_probe_read_return_expr(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + static inline unsigned char *my_skb_transport_header(struct sk_buff *skb) { +@@ -1125,7 +1118,6 @@ int test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) { + + def test_probe_read_return_call(self): + text = """ +-#define KBUILD_MODNAME "foo" + #include + #include + static inline struct tcphdr *my_skb_transport_header(struct sk_buff *skb) { +diff --git a/tools/tcplife.lua b/tools/tcplife.lua +index 3f4f6afd..5e311631 100755 +--- a/tools/tcplife.lua ++++ b/tools/tcplife.lua +@@ -25,7 +25,6 @@ uint16_t ntohs(uint16_t netshort); + + local program = [[ + #include +-#define KBUILD_MODNAME "foo" + #include + #include + #include +diff --git a/tools/tcplife.py b/tools/tcplife.py +index d4e679dd..c2bd8236 100755 +--- a/tools/tcplife.py ++++ b/tools/tcplife.py +@@ -66,7 +66,6 @@ debug = 0 + # define BPF program + bpf_text = """ + #include +-#define KBUILD_MODNAME "foo" + #include + #include + #include +diff --git a/tools/tcpstates.py b/tools/tcpstates.py +index 48f87884..0fe5d89a 100755 +--- a/tools/tcpstates.py ++++ b/tools/tcpstates.py +@@ -61,7 +61,6 @@ debug = 0 + # define BPF program + bpf_header = """ + #include +-#define KBUILD_MODNAME "foo" + #include + #include + #include +-- +2.25.4 + diff --git a/SPECS/bcc.spec b/SPECS/bcc.spec index 95f2731..743d8c6 100644 --- a/SPECS/bcc.spec +++ b/SPECS/bcc.spec @@ -5,7 +5,7 @@ Name: bcc Version: 0.14.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc @@ -17,6 +17,8 @@ Patch1: %{name}-%{version}-deadlock-print-a-more-explicit-message-when-p Patch2: %{name}-%{version}-man-remove-non-existent-x-argument-from-tcpconnect-m.patch Patch3: %{name}-%{version}-loader-suggest-to-install-the-right-kernel-devel-pac.patch Patch4: %{name}-%{version}-tools-fix-a-python-3-map-issue-in-dbstat-and-dbslowe.patch +Patch5: %{name}-%{version}-Add-KBUILD_MODNAME-flag-to-default-cflags.patch +Patch6: %{name}-%{version}-Delete-existing-kbuild_modname-definitions.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -206,6 +208,9 @@ done %changelog +* Tue Jul 21 2020 Jerome Marchand - 0.14.0-3 +- Add KBUILD_MODNAME flag to default cflags + * Thu Jun 11 2020 Jerome Marchand - 0.14.0-2 - Remove criticalstat manpage - Remove compactsnoop on non x86_64