diff --git a/1000-bcc-anolis-ali-enhanced-tools-for-fs-schedule-sys.patch b/1000-bcc-anolis-enhanced-tools-for-fs-schedule-sys.patch similarity index 100% rename from 1000-bcc-anolis-ali-enhanced-tools-for-fs-schedule-sys.patch rename to 1000-bcc-anolis-enhanced-tools-for-fs-schedule-sys.patch diff --git a/1001-bcc-anolis-tests-test_array.py-add-clock_nanosleep-to-attach-po.patch b/1001-bcc-anolis-tests-test_array.py-add-clock_nanosleep-to-attach-po.patch deleted file mode 100644 index 370b2845a1135b0942fc0082ef795b1db16cd853..0000000000000000000000000000000000000000 --- a/1001-bcc-anolis-tests-test_array.py-add-clock_nanosleep-to-attach-po.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 21ee51c8df8c569f349d9ca22328b19f2b1fd19b Mon Sep 17 00:00:00 2001 -From: Chunmei Xu -Date: Thu, 24 Dec 2020 09:20:08 +0800 -Subject: [PATCH] tests/test_array.py: add clock_nanosleep to attach point - -since glibc-2.31, the syscall of sleep is clock_nanosleep instead of -nanosleep - -Signed-off-by: Chunmei Xu ---- - tests/python/test_array.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tests/python/test_array.py b/tests/python/test_array.py -index d5e1aee0..1461226d 100755 ---- a/tests/python/test_array.py -+++ b/tests/python/test_array.py -@@ -65,6 +65,8 @@ int do_sys_nanosleep(void *ctx) { - b = BPF(text=text) - b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"), - fn_name="do_sys_nanosleep") -+ b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"), -+ fn_name="do_sys_nanosleep") - b["events"].open_perf_buffer(cb, lost_cb=lost_cb) - subprocess.call(['sleep', '0.1']) - b.perf_buffer_poll() -@@ -98,6 +100,8 @@ int do_sys_nanosleep(void *ctx) { - b = BPF(text=text) - b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"), - fn_name="do_sys_nanosleep") -+ b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"), -+ fn_name="do_sys_nanosleep") - b["events"].open_perf_buffer(cb, lost_cb=lost_cb) - online_cpus = get_online_cpus() - for cpu in online_cpus: --- -2.19.1.6.gb485710b - diff --git a/1002-bcc-anolis-fix-some-test-cases-failed-3235.patch b/1002-bcc-anolis-fix-some-test-cases-failed-3235.patch deleted file mode 100644 index 572d0a64d98100909609217b8b40240c47d70081..0000000000000000000000000000000000000000 --- a/1002-bcc-anolis-fix-some-test-cases-failed-3235.patch +++ /dev/null @@ -1,98 +0,0 @@ -From f02c87c92aa3a4938079716b0f011c111446e9ce Mon Sep 17 00:00:00 2001 -From: xuchunmei000 <59222308+xuchunmei000@users.noreply.github.com> -Date: Thu, 21 Jan 2021 23:22:23 +0800 -Subject: [PATCH] fix some test cases failed (#3235) - -* tests/test_uprobes.py: set larger sleep time to pass test on aarch64 -* test/test_clang.py: attach to vfs_read after failed to attach __vfs_read -* tests/test_clang_complex.c: set BPF_TABLE array key type to int - array_map_check_btf in kernel/bpf/arraymap.c check key type must be - BTF_KIND_INT - -Signed-off-by: Chunmei Xu ---- - tests/python/test_clang.py | 6 +++++- - tests/python/test_clang_complex.c | 9 +++------ - tests/python/test_uprobes.py | 4 ++-- - 3 files changed, 10 insertions(+), 9 deletions(-) - -diff --git a/tests/python/test_clang.py b/tests/python/test_clang.py -index 1006bee4..b1fb7e96 100755 ---- a/tests/python/test_clang.py -+++ b/tests/python/test_clang.py -@@ -852,7 +852,11 @@ int trace_read_entry(struct pt_regs *ctx, struct file *file) { - } - """ - b = BPF(text=text) -- b.attach_kprobe(event="__vfs_read", fn_name="trace_read_entry") -+ try: -+ b.attach_kprobe(event="__vfs_read", fn_name="trace_read_entry") -+ except Exception: -+ print('Current kernel does not have __vfs_read, try vfs_read instead') -+ b.attach_kprobe(event="vfs_read", fn_name="trace_read_entry") - - def test_printk_f(self): - text = """ -diff --git a/tests/python/test_clang_complex.c b/tests/python/test_clang_complex.c -index 8cb9d7c9..b0397e8d 100644 ---- a/tests/python/test_clang_complex.c -+++ b/tests/python/test_clang_complex.c -@@ -13,14 +13,11 @@ struct FwdLeaf { - BPF_HASH(fwd_map, struct FwdKey, struct FwdLeaf, 1); - - // array --struct ConfigKey { -- u32 index; --}; - struct ConfigLeaf { - u32 bpfdev_ip; - u32 slave_ip; - }; --BPF_TABLE("array", struct ConfigKey, struct ConfigLeaf, config_map, 1); -+BPF_TABLE("array", u32, struct ConfigLeaf, config_map, 1); - - // hash - struct MacaddrKey { -@@ -49,7 +46,7 @@ int handle_packet(struct __sk_buff *skb) { - // make sure configured - u32 slave_ip; - -- struct ConfigKey cfg_key = {.index = 0}; -+ u32 cfg_key = 0; - struct ConfigLeaf *cfg_leaf = config_map.lookup(&cfg_key); - if (cfg_leaf) { - slave_ip = cfg_leaf->slave_ip; -@@ -132,7 +129,7 @@ int handle_packet(struct __sk_buff *skb) { - u64 src_mac; - u64 dst_mac; - -- struct ConfigKey cfg_key = {.index = 0}; -+ u32 cfg_key = 0; - struct ConfigLeaf *cfg_leaf = config_map.lookup(&cfg_key); - if (cfg_leaf) { - struct MacaddrKey mac_key = {.ip = cfg_leaf->bpfdev_ip}; -diff --git a/tests/python/test_uprobes.py b/tests/python/test_uprobes.py -index 62a370fa..f7c78e75 100755 ---- a/tests/python/test_uprobes.py -+++ b/tests/python/test_uprobes.py -@@ -119,7 +119,7 @@ int count(struct pt_regs *ctx) { - shutil.copy(libz_path, b"/tmp") - - libz = ctypes.CDLL("/tmp/libz.so.1") -- time.sleep(1) -+ time.sleep(3) - libz.zlibVersion() - time.sleep(5) - os._exit(0) -@@ -130,7 +130,7 @@ int count(struct pt_regs *ctx) { - b = bcc.BPF(text=text) - b.attach_uprobe(name=libname, sym=symname, fn_name="count", pid=child_pid) - b.attach_uretprobe(name=libname, sym=symname, fn_name="count", pid=child_pid) -- time.sleep(1) -+ time.sleep(5) - self.assertEqual(b["stats"][ctypes.c_int(0)].value, 2) - b.detach_uretprobe(name=libname, sym=symname, pid=child_pid) - b.detach_uprobe(name=libname, sym=symname, pid=child_pid) --- -2.19.1.6.gb485710b - diff --git a/1003-bcc-anolis-test-test_histogram.py-fix-test-failed-on-kernel-5.1.patch b/1003-bcc-anolis-test-test_histogram.py-fix-test-failed-on-kernel-5.1.patch deleted file mode 100644 index e913d2c5967489e1d90ff2a44e8b6e974d323963..0000000000000000000000000000000000000000 --- a/1003-bcc-anolis-test-test_histogram.py-fix-test-failed-on-kernel-5.1.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 97cded04a9d6370ac722c6ad8e73b72c4794e851 Mon Sep 17 00:00:00 2001 -From: Chunmei Xu -Date: Fri, 15 Jan 2021 09:51:27 +0800 -Subject: [PATCH] test/test_histogram.py: fix test failed on kernel-5.10 - -kernel commit(cf25e24db61cc) rename tsk->real_start_time to -start_boottime, so test_hostogram will get failed on kernel>=5.5 - -Signed-off-by: Chunmei Xu ---- - tests/python/test_histogram.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/tests/python/test_histogram.py b/tests/python/test_histogram.py -index 2fb8c168..ec7950c9 100755 ---- a/tests/python/test_histogram.py -+++ b/tests/python/test_histogram.py -@@ -59,10 +59,15 @@ int kprobe__htab_map_delete_elem(struct pt_regs *ctx, struct bpf_map *map, u64 * - b = BPF(text=""" - #include - #include -+#include - typedef struct { char name[TASK_COMM_LEN]; u64 slot; } Key; - BPF_HISTOGRAM(hist1, Key, 1024); - int kprobe__finish_task_switch(struct pt_regs *ctx, struct task_struct *prev) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0) - Key k = {.slot = bpf_log2l(prev->real_start_time)}; -+#else -+ Key k = {.slot = bpf_log2l(prev->start_boottime)}; -+#endif - if (!bpf_get_current_comm(&k.name, sizeof(k.name))) - hist1.increment(k); - return 0; --- -2.19.1.6.gb485710b - diff --git a/1004-bcc-anolis-aarch64-turn-off-jump-table-optimization-during-jit-.patch b/1004-bcc-anolis-aarch64-turn-off-jump-table-optimization-during-jit-.patch deleted file mode 100644 index 518feba34b643627f65d0ff517b4bae518e422f8..0000000000000000000000000000000000000000 --- a/1004-bcc-anolis-aarch64-turn-off-jump-table-optimization-during-jit-.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3318c261a9e6ef82484fc0f5f5254599b191b289 Mon Sep 17 00:00:00 2001 -From: Chunmei Xu -Date: Tue, 26 Jan 2021 18:04:24 +0800 -Subject: [PATCH] aarch64: turn off jump table optimization during jit - compilation - -test_clang.py: test_jump_table will get failed with error messgae: -bpf: Failed to load program: Invalid argument -unknown opcode a0 -processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 -peak_states 0 mark_read 0 - -HINT: The 'unknown opcode' can happen if you reference a global or -static variable, or data in read-only section. For example, 'char *p = -"hello"' will result in p referencing a read-only section, and 'char p[] -= "hello"' will have "hello" stored on the stack. - -Signed-off-by: Chunmei Xu ---- - src/cc/frontends/clang/loader.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/cc/frontends/clang/loader.cc b/src/cc/frontends/clang/loader.cc -index 1f98cf76..a274f0fe 100644 ---- a/src/cc/frontends/clang/loader.cc -+++ b/src/cc/frontends/clang/loader.cc -@@ -318,7 +318,7 @@ int ClangLoader::do_compile(unique_ptr *mod, TableStorage &ts, - driver::Driver drv("", target_triple, diags); - - #if LLVM_MAJOR_VERSION >= 4 -- if (target_triple == "x86_64-unknown-linux-gnu") -+ if (target_triple == "x86_64-unknown-linux-gnu" || target_triple == "aarch64-unknown-linux-gnu") - flags_cstr.push_back("-fno-jump-tables"); - #endif - --- -2.19.1.6.gb485710b - diff --git a/1005-bcc-anolis-Netqtop-3037-3048.patch b/1005-bcc-anolis-Netqtop-3037-3048.patch deleted file mode 100644 index 2eb8dfea60d561f0a5bf330cf12f34a030e4f0ec..0000000000000000000000000000000000000000 --- a/1005-bcc-anolis-Netqtop-3037-3048.patch +++ /dev/null @@ -1,637 +0,0 @@ -From ba73657cb8c4dab83dfb89eed4a8b3866255569a Mon Sep 17 00:00:00 2001 -From: Hao <1075808668@qq.com> -Date: Sat, 12 Sep 2020 02:05:29 +0800 -Subject: [PATCH] Netqtop 3037 (#3048) - -The tool netqtop uses tracepoints NET_DEV_START_XMIT and NETIF_RECEIVE_SKB to intercept every transmitted and received packet, as a result, considerable performance descent is expected. -Details for some performance evaluation can be found at - https://github.com/iovisor/bcc/pull/3048 ---- - README.md | 1 + - man/man8/netqtop.8 | 56 ++++++++++ - tools/netqtop.c | 113 ++++++++++++++++++++ - tools/netqtop.py | 218 ++++++++++++++++++++++++++++++++++++++ - tools/netqtop_example.txt | 190 +++++++++++++++++++++++++++++++++ - 5 files changed, 578 insertions(+) - create mode 100644 man/man8/netqtop.8 - create mode 100644 tools/netqtop.c - create mode 100755 tools/netqtop.py - create mode 100644 tools/netqtop_example.txt - -diff --git a/README.md b/README.md -index 58340622..d54e3848 100644 ---- a/README.md -+++ b/README.md -@@ -128,6 +128,7 @@ pair of .c and .py files, and some are directories of files. - - tools/[memleak](tools/memleak.py): Display outstanding memory allocations to find memory leaks. [Examples](tools/memleak_example.txt). - - tools/[mountsnoop](tools/mountsnoop.py): Trace mount and umount syscalls system-wide. [Examples](tools/mountsnoop_example.txt). - - tools/[mysqld_qslower](tools/mysqld_qslower.py): Trace MySQL server queries slower than a threshold. [Examples](tools/mysqld_qslower_example.txt). -+- tools/[netqtop](tools/netqtop.py) tools/[netqtop.c](tools/netqtop.c): Trace and display packets distribution on NIC queues. [Examples](tools/netqtop_example.txt). - - tools/[nfsslower](tools/nfsslower.py): Trace slow NFS operations. [Examples](tools/nfsslower_example.txt). - - tools/[nfsdist](tools/nfsdist.py): Summarize NFS operation latency distribution as a histogram. [Examples](tools/nfsdist_example.txt). - - tools/[offcputime](tools/offcputime.py): Summarize off-CPU time by kernel stack trace. [Examples](tools/offcputime_example.txt). -diff --git a/man/man8/netqtop.8 b/man/man8/netqtop.8 -new file mode 100644 -index 00000000..bfa34d11 ---- /dev/null -+++ b/man/man8/netqtop.8 -@@ -0,0 +1,56 @@ -+.TH netqtop 8 "2020-07-30" "USER COMMANDS" -+.SH NAME -+netqtop \- Summarize PPS, BPS, average size of packets and packet counts ordered by packet sizes -+on each queue of a network interface. -+.SH SYNOPSIS -+.B netqtop [\-n nic] [\-i interval] [\-t throughput] -+.SH DESCRIPTION -+netqtop accounts statistics of both transmitted and received packets on each queue of -+a specified network interface to help developers check if its traffic load is balanced. -+The result is displayed as a table with columns of PPS, BPS, average size and -+packet counts in range [0,64), [64, 5120), [512, 2048), [2048, 16K), [16K, 64K). -+This is printed every given interval (default 1) in seconds. -+ -+The tool uses the net:net_dev_start_xmit and net:netif_receive_skb kernel tracepoints. -+Since it uses tracepoint, the tool only works on Linux 4.7+. -+ -+netqtop introduces significant overhead while network traffic is large. See OVERHEAD -+section below. -+ -+.SH REQUIREMENTS -+CONFIG_bpf and bcc -+.SH OPTIONS -+.TP -+\-n NIC -+Specify the network interface card -+.TP -+\-i INTERVAL -+Print results every INTERVAL seconds. -+The default value is 1. -+.TP -+\-t THROUGHPUT -+Print BPS and PPS of each queue. -+.SH EXAMPLES -+.TP -+Account statistics of eth0 and output every 2 seconds: -+# -+.B netqtop -n eth0 -i 1 -+.SH OVERHEAD -+In performance test, netqtop introduces a overhead up to 30% PPS drop -+while printing interval is set to 1 second. So be mindful of potential packet drop -+when using this tool. -+ -+It also increases ping-pong latency by about 1 usec. -+.SH SOURCE -+This is from bcc -+.IP -+https://github.com/iovisor/bcc -+.PP -+Also look in the bcc distribution for a netqtop_example.txt file containing -+example usage, output and commentary for this tool. -+.SH OS -+Linux -+.SH STABILITY -+Unstable - in development -+.SH AUTHOR -+Yolandajn -diff --git a/tools/netqtop.c b/tools/netqtop.c -new file mode 100644 -index 00000000..52605dda ---- /dev/null -+++ b/tools/netqtop.c -@@ -0,0 +1,113 @@ -+ -+#include -+#include -+#if IFNAMSIZ != 16 -+#error "IFNAMSIZ != 16 is not supported" -+#endif -+#define MAX_QUEUE_NUM 1024 -+ -+/** -+* This union is use to store name of the specified interface -+* and read it as two different data types -+*/ -+union name_buf{ -+ char name[IFNAMSIZ]; -+ struct { -+ u64 hi; -+ u64 lo; -+ }name_int; -+}; -+ -+/* data retrieved in tracepoints */ -+struct queue_data{ -+ u64 total_pkt_len; -+ u32 num_pkt; -+ u32 size_64B; -+ u32 size_512B; -+ u32 size_2K; -+ u32 size_16K; -+ u32 size_64K; -+}; -+ -+/* array of length 1 for device name */ -+BPF_ARRAY(name_map, union name_buf, 1); -+/* table for transmit & receive packets */ -+BPF_HASH(tx_q, u16, struct queue_data, MAX_QUEUE_NUM); -+BPF_HASH(rx_q, u16, struct queue_data, MAX_QUEUE_NUM); -+ -+static inline int name_filter(struct sk_buff* skb){ -+ /* get device name from skb */ -+ union name_buf real_devname; -+ struct net_device *dev; -+ bpf_probe_read(&dev, sizeof(skb->dev), ((char *)skb + offsetof(struct sk_buff, dev))); -+ bpf_probe_read(&real_devname, IFNAMSIZ, dev->name); -+ -+ int key=0; -+ union name_buf *leaf = name_map.lookup(&key); -+ if(!leaf){ -+ return 0; -+ } -+ if((leaf->name_int).hi != real_devname.name_int.hi || (leaf->name_int).lo != real_devname.name_int.lo){ -+ return 0; -+ } -+ -+ return 1; -+} -+ -+static void updata_data(struct queue_data *data, u64 len){ -+ data->total_pkt_len += len; -+ data->num_pkt ++; -+ if(len / 64 == 0){ -+ data->size_64B ++; -+ } -+ else if(len / 512 == 0){ -+ data->size_512B ++; -+ } -+ else if(len / 2048 == 0){ -+ data->size_2K ++; -+ } -+ else if(len / 16384 == 0){ -+ data->size_16K ++; -+ } -+ else if(len / 65536 == 0){ -+ data->size_64K ++; -+ } -+} -+ -+TRACEPOINT_PROBE(net, net_dev_start_xmit){ -+ /* read device name */ -+ struct sk_buff* skb = (struct sk_buff*)args->skbaddr; -+ if(!name_filter(skb)){ -+ return 0; -+ } -+ -+ /* update table */ -+ u16 qid = skb->queue_mapping; -+ struct queue_data newdata; -+ __builtin_memset(&newdata, 0, sizeof(newdata)); -+ struct queue_data *data = tx_q.lookup_or_try_init(&qid, &newdata); -+ if(!data){ -+ return 0; -+ } -+ updata_data(data, skb->len); -+ -+ return 0; -+} -+ -+TRACEPOINT_PROBE(net, netif_receive_skb){ -+ struct sk_buff* skb = (struct sk_buff*)args->skbaddr; -+ if(!name_filter(skb)){ -+ return 0; -+ } -+ -+ u16 qid = skb->queue_mapping; -+ struct queue_data newdata; -+ __builtin_memset(&newdata, 0, sizeof(newdata)); -+ struct queue_data *data = rx_q.lookup_or_try_init(&qid, &newdata); -+ if(!data){ -+ return 0; -+ } -+ updata_data(data, skb->len); -+ -+ return 0; -+} -diff --git a/tools/netqtop.py b/tools/netqtop.py -new file mode 100755 -index 00000000..e2823ac6 ---- /dev/null -+++ b/tools/netqtop.py -@@ -0,0 +1,218 @@ -+#!/usr/bin/python -+ -+from bcc import BPF -+from ctypes import * -+import argparse -+import os -+from time import sleep,time,localtime,asctime -+import types -+ -+# pre defines ------------------------------- -+ROOT_PATH = "/sys/class/net" -+IFNAMSIZ = 16 -+COL_WIDTH = 10 -+MAX_QUEUE_NUM = 1024 -+EBPF_FILE = "netqtop.c" -+ -+# structure for network interface name array -+class Devname(Structure): -+ _fields_=[ -+ ('name', c_char*IFNAMSIZ) -+ ] -+ -+################## printer for results ################### -+def to_str(num): -+ s = "" -+ if num > 1000000: -+ return str(round(num/(1024*1024.0), 2)) + 'M' -+ elif num > 1000: -+ return str(round(num/1024.0, 2)) + 'K' -+ else: -+ if type(num) == types.FloatType: -+ return str(round(num, 2)) -+ else: -+ return str(num) -+ -+def print_table(table, qnum): -+ global print_interval -+ -+ # ---- print headers ---------------- -+ headers = [ -+ "QueueID", -+ "avg_size", -+ "[0, 64)", -+ "[64, 512)", -+ "[512, 2K)", -+ "[2K, 16K)", -+ "[16K, 64K)" -+ ] -+ if args.throughput: -+ headers.append("BPS") -+ headers.append("PPS") -+ -+ for hd in headers: -+ print(hd.center(COL_WIDTH)), -+ print -+ -+ # ------- calculates -------------- -+ qids=[] -+ tBPS = 0 -+ tPPS = 0 -+ tAVG = 0 -+ tGroup = [0,0,0,0,0] -+ tpkt = 0 -+ tlen = 0 -+ for k, v in table.items(): -+ qids += [k.value] -+ tlen += v.total_pkt_len -+ tpkt += v.num_pkt -+ tGroup[0] += v.size_64B -+ tGroup[1] += v.size_512B -+ tGroup[2] += v.size_2K -+ tGroup[3] += v.size_16K -+ tGroup[4] += v.size_64K -+ tBPS = tlen / print_interval -+ tPPS = tpkt / print_interval -+ if tpkt != 0: -+ tAVG = tlen / tpkt -+ -+ # -------- print table -------------- -+ for k in range(qnum): -+ if k in qids: -+ item = table[c_ushort(k)] -+ data = [ -+ k, -+ item.total_pkt_len, -+ item.num_pkt, -+ item.size_64B, -+ item.size_512B, -+ item.size_2K, -+ item.size_16K, -+ item.size_64K -+ ] -+ else: -+ data = [k,0,0,0,0,0,0,0] -+ -+ # print a line per queue -+ avg = 0 -+ if data[2] != 0: -+ avg = data[1] / data[2] -+ print("%5d %11s %10s %10s %10s %10s %10s" % ( -+ data[0], -+ to_str(avg), -+ to_str(data[3]), -+ to_str(data[4]), -+ to_str(data[5]), -+ to_str(data[6]), -+ to_str(data[7]) -+ )), -+ if args.throughput: -+ BPS = data[1] / print_interval -+ PPS = data[2] / print_interval -+ print("%10s %10s" % ( -+ to_str(BPS), -+ to_str(PPS) -+ )) -+ else: -+ print -+ -+ # ------- print total -------------- -+ print(" Total %10s %10s %10s %10s %10s %10s" % ( -+ to_str(tAVG), -+ to_str(tGroup[0]), -+ to_str(tGroup[1]), -+ to_str(tGroup[2]), -+ to_str(tGroup[3]), -+ to_str(tGroup[4]) -+ )), -+ -+ if args.throughput: -+ print("%10s %10s" % ( -+ to_str(tBPS), -+ to_str(tPPS) -+ )) -+ else: -+ print -+ -+ -+def print_result(b): -+ # --------- print tx queues --------------- -+ print(asctime(localtime(time()))) -+ print("TX") -+ table = b['tx_q'] -+ print_table(table, tx_num) -+ b['tx_q'].clear() -+ -+ # --------- print rx queues --------------- -+ print("") -+ print("RX") -+ table = b['rx_q'] -+ print_table(table, rx_num) -+ b['rx_q'].clear() -+ if args.throughput: -+ print("-"*95) -+ else: -+ print("-"*76) -+ -+############## specify network interface ################# -+parser = argparse.ArgumentParser(description="") -+parser.add_argument("--name", "-n", type=str, default="") -+parser.add_argument("--interval", "-i", type=float, default=1) -+parser.add_argument("--throughput", "-t", action="store_true") -+parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) -+args = parser.parse_args() -+ -+if args.ebpf: -+ with open(EBPF_FILE) as fileobj: -+ progtxt = fileobj.read() -+ print(progtxt) -+ exit() -+ -+if args.name == "": -+ print ("Please specify a network interface.") -+ exit() -+else: -+ dev_name = args.name -+ -+if len(dev_name) > IFNAMSIZ-1: -+ print ("NIC name too long") -+ exit() -+ -+print_interval = args.interval + 0.0 -+if print_interval == 0: -+ print "print interval must be non-zero" -+ exit() -+ -+################ get number of queues ##################### -+tx_num = 0 -+rx_num = 0 -+path = ROOT_PATH + "/" + dev_name + "/queues" -+if not os.path.exists(path): -+ print "Net interface", dev_name, "does not exits." -+ exit() -+ -+list = os.listdir(path) -+for s in list: -+ if s[0] == 'r': -+ rx_num += 1 -+ if s[0] == 't': -+ tx_num += 1 -+ -+if tx_num > MAX_QUEUE_NUM or rx_num > MAX_QUEUE_NUM: -+ print "number of queues over 1024 is not supported." -+ exit() -+ -+################## start tracing ################## -+b = BPF(src_file = EBPF_FILE) -+# --------- set hash array -------- -+devname_map = b['name_map'] -+_name = Devname() -+_name.name = dev_name -+devname_map[0] = _name -+ -+while 1: -+ try: -+ sleep(print_interval) -+ print_result(b) -+ except KeyboardInterrupt: -+ exit() -diff --git a/tools/netqtop_example.txt b/tools/netqtop_example.txt -new file mode 100644 -index 00000000..443cfb71 ---- /dev/null -+++ b/tools/netqtop_example.txt -@@ -0,0 +1,190 @@ -+Demonstrations of netqtop. -+ -+ -+netqtop traces the kernel functions performing packet transmit (xmit_one) -+and packet receive (__netif_receive_skb_core) on data link layer. The tool -+not only traces every packet via a specified network interface, but also accounts -+the PPS, BPS and average size of packets as well as packet amounts (categorized by -+size range) on sending and receiving direction respectively. Results are printed -+as tables, which can be used to understand traffic load allocation on each queue -+of interested network interface to see if it is balanced. And the overall performance -+is provided in the buttom. -+ -+For example, suppose you want to know current traffic on lo, and print result -+every second: -+# ./netqtop.py -n lo -i 1 -+Thu Sep 10 11:28:39 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 88 0 9 0 0 0 -+ Total 88 0 9 0 0 0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 74 4 5 0 0 0 -+ Total 74 4 5 0 0 0 -+---------------------------------------------------------------------------- -+Thu Sep 10 11:28:40 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 233 0 3 1 0 0 -+ Total 233 0 3 1 0 0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 219 2 1 1 0 0 -+ Total 219 2 1 1 0 0 -+---------------------------------------------------------------------------- -+ -+or you can just use the default mode -+# ./netqtop.py -n lo -+Thu Sep 10 11:27:45 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 92 0 7 0 0 0 -+ Total 92 0 7 0 0 0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 78 3 4 0 0 0 -+ Total 78 3 4 0 0 0 -+---------------------------------------------------------------------------- -+Thu Sep 10 11:27:46 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 179 0 5 1 0 0 -+ Total 179 0 5 1 0 0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 165 3 2 1 0 0 -+ Total 165 3 2 1 0 0 -+---------------------------------------------------------------------------- -+ -+This NIC only has 1 queue. -+If you want the tool to print results after a longer interval, specify seconds with -i: -+# ./netqtop.py -n lo -i 3 -+Thu Sep 10 11:31:26 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 85 0 11 0 0 0 -+ Total 85 0 11 0 0 0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 71 5 6 0 0 0 -+ Total 71 5 6 0 0 0 -+---------------------------------------------------------------------------- -+Thu Sep 10 11:31:29 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 153 0 7 1 0 0 -+ Total 153 0 7 1 0 0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) -+ 0 139 4 3 1 0 0 -+ Total 139 4 3 1 0 0 -+---------------------------------------------------------------------------- -+ -+To see PPS and BPS of each queue, use -t: -+# ./netqtop.py -n lo -i 1 -t -+Thu Sep 10 11:37:02 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS -+ 0 114 0 10 0 0 0 1.11K 10.0 -+ Total 114 0 10 0 0 0 1.11K 10.0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS -+ 0 100 4 6 0 0 0 1000.0 10.0 -+ Total 100 4 6 0 0 0 1000.0 10.0 -+----------------------------------------------------------------------------------------------- -+Thu Sep 10 11:37:03 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS -+ 0 271 0 3 1 0 0 1.06K 4.0 -+ Total 271 0 3 1 0 0 1.06K 4.0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS -+ 0 257 2 1 1 0 0 1.0K 4.0 -+ Total 257 2 1 1 0 0 1.0K 4.0 -+----------------------------------------------------------------------------------------------- -+ -+When filtering multi-queue NICs, you do not need to specify the number of queues, -+the tool calculates it for you: -+# ./netqtop.py -n eth0 -t -+Thu Sep 10 11:39:21 2020 -+TX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS -+ 0 0 0 0 0 0 0 0.0 0.0 -+ 1 0 0 0 0 0 0 0.0 0.0 -+ 2 0 0 0 0 0 0 0.0 0.0 -+ 3 0 0 0 0 0 0 0.0 0.0 -+ 4 0 0 0 0 0 0 0.0 0.0 -+ 5 0 0 0 0 0 0 0.0 0.0 -+ 6 0 0 0 0 0 0 0.0 0.0 -+ 7 0 0 0 0 0 0 0.0 0.0 -+ 8 54 2 0 0 0 0 108.0 2.0 -+ 9 161 0 9 0 0 0 1.42K 9.0 -+ 10 0 0 0 0 0 0 0.0 0.0 -+ 11 0 0 0 0 0 0 0.0 0.0 -+ 12 0 0 0 0 0 0 0.0 0.0 -+ 13 0 0 0 0 0 0 0.0 0.0 -+ 14 0 0 0 0 0 0 0.0 0.0 -+ 15 0 0 0 0 0 0 0.0 0.0 -+ 16 0 0 0 0 0 0 0.0 0.0 -+ 17 0 0 0 0 0 0 0.0 0.0 -+ 18 0 0 0 0 0 0 0.0 0.0 -+ 19 0 0 0 0 0 0 0.0 0.0 -+ 20 0 0 0 0 0 0 0.0 0.0 -+ 21 0 0 0 0 0 0 0.0 0.0 -+ 22 0 0 0 0 0 0 0.0 0.0 -+ 23 0 0 0 0 0 0 0.0 0.0 -+ 24 0 0 0 0 0 0 0.0 0.0 -+ 25 0 0 0 0 0 0 0.0 0.0 -+ 26 0 0 0 0 0 0 0.0 0.0 -+ 27 0 0 0 0 0 0 0.0 0.0 -+ 28 0 0 0 0 0 0 0.0 0.0 -+ 29 0 0 0 0 0 0 0.0 0.0 -+ 30 0 0 0 0 0 0 0.0 0.0 -+ 31 0 0 0 0 0 0 0.0 0.0 -+ Total 141 2 9 0 0 0 1.52K 11.0 -+ -+RX -+ QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS -+ 0 127 3 9 0 0 0 1.5K 12.0 -+ 1 0 0 0 0 0 0 0.0 0.0 -+ 2 0 0 0 0 0 0 0.0 0.0 -+ 3 0 0 0 0 0 0 0.0 0.0 -+ 4 0 0 0 0 0 0 0.0 0.0 -+ 5 0 0 0 0 0 0 0.0 0.0 -+ 6 0 0 0 0 0 0 0.0 0.0 -+ 7 0 0 0 0 0 0 0.0 0.0 -+ 8 0 0 0 0 0 0 0.0 0.0 -+ 9 0 0 0 0 0 0 0.0 0.0 -+ 10 0 0 0 0 0 0 0.0 0.0 -+ 11 0 0 0 0 0 0 0.0 0.0 -+ 12 0 0 0 0 0 0 0.0 0.0 -+ 13 0 0 0 0 0 0 0.0 0.0 -+ 14 0 0 0 0 0 0 0.0 0.0 -+ 15 0 0 0 0 0 0 0.0 0.0 -+ 16 0 0 0 0 0 0 0.0 0.0 -+ 17 0 0 0 0 0 0 0.0 0.0 -+ 18 0 0 0 0 0 0 0.0 0.0 -+ 19 0 0 0 0 0 0 0.0 0.0 -+ 20 0 0 0 0 0 0 0.0 0.0 -+ 21 0 0 0 0 0 0 0.0 0.0 -+ 22 0 0 0 0 0 0 0.0 0.0 -+ 23 0 0 0 0 0 0 0.0 0.0 -+ 24 0 0 0 0 0 0 0.0 0.0 -+ 25 0 0 0 0 0 0 0.0 0.0 -+ 26 0 0 0 0 0 0 0.0 0.0 -+ 27 0 0 0 0 0 0 0.0 0.0 -+ 28 0 0 0 0 0 0 0.0 0.0 -+ 29 0 0 0 0 0 0 0.0 0.0 -+ 30 0 0 0 0 0 0 0.0 0.0 -+ 31 0 0 0 0 0 0 0.0 0.0 -+ Total 127 3 9 0 0 0 1.5K 12.0 -+----------------------------------------------------------------------------------------------- -\ No newline at end of file --- -2.29.2 - diff --git a/1006-bcc-anolis-fix-python3-compatible-issue-for-netqtop.patch b/1006-bcc-anolis-fix-python3-compatible-issue-for-netqtop.patch deleted file mode 100644 index 043b7b4dd43e91ab550953d106c1afa8ef7697b0..0000000000000000000000000000000000000000 --- a/1006-bcc-anolis-fix-python3-compatible-issue-for-netqtop.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 6ba4dc1fb110b1db4a3ba187fa60a152f64c413f Mon Sep 17 00:00:00 2001 -From: Yonghong Song -Date: Fri, 16 Oct 2020 11:12:53 -0700 -Subject: [PATCH] fix python3 compatible issue for netqtop - -Otherwise, we have: - ... - File "bcc/tools/netqtop.py", line 54 - print(hd.center(COL_WIDTH)), - ^ - TabError: inconsistent use of tabs and spaces in indentation - ... - - File "bcc/tools/tcprtt.py", line 117, in - bpf_text = bpf_text.replace(b'LPORTFILTER', b'') - TypeError: replace() argument 1 must be str, not bytes - ... - -Signed-off-by: Yonghong Song ---- - tools/netqtop.py | 10 +++++----- - 2 files changed, 17 insertions(+), 17 deletions(-) - -diff --git a/tools/netqtop.py b/tools/netqtop.py -index e2823ac6..dbe9206a 100755 ---- a/tools/netqtop.py -+++ b/tools/netqtop.py -@@ -51,7 +51,7 @@ def print_table(table, qnum): - headers.append("PPS") - - for hd in headers: -- print(hd.center(COL_WIDTH)), -+ print(hd.center(COL_WIDTH)) - print - - # ------- calculates -------------- -@@ -180,7 +180,7 @@ if len(dev_name) > IFNAMSIZ-1: - - print_interval = args.interval + 0.0 - if print_interval == 0: -- print "print interval must be non-zero" -+ print ("print interval must be non-zero") - exit() - - ################ get number of queues ##################### -@@ -188,7 +188,7 @@ tx_num = 0 - rx_num = 0 - path = ROOT_PATH + "/" + dev_name + "/queues" - if not os.path.exists(path): -- print "Net interface", dev_name, "does not exits." -+ print ("Net interface", dev_name, "does not exits.") - exit() - - list = os.listdir(path) -@@ -199,7 +199,7 @@ for s in list: - tx_num += 1 - - if tx_num > MAX_QUEUE_NUM or rx_num > MAX_QUEUE_NUM: -- print "number of queues over 1024 is not supported." -+ print ("number of queues over 1024 is not supported.") - exit() - - ################## start tracing ################## -@@ -207,7 +207,7 @@ b = BPF(src_file = EBPF_FILE) - # --------- set hash array -------- - devname_map = b['name_map'] - _name = Devname() --_name.name = dev_name -+_name.name = dev_name.encode() - devname_map[0] = _name - - while 1: --- -2.29.2 - diff --git a/1007-bcc-anolis-fix-netqtop-python3-compatible-3140.patch b/1007-bcc-anolis-fix-netqtop-python3-compatible-3140.patch deleted file mode 100644 index 99e783ee32e1989c1d950cd2b8b441a2c5bc92c6..0000000000000000000000000000000000000000 --- a/1007-bcc-anolis-fix-netqtop-python3-compatible-3140.patch +++ /dev/null @@ -1,113 +0,0 @@ -From ec3747ed6b16f9eec36a204dfbe3506d3778dcb4 Mon Sep 17 00:00:00 2001 -From: Hao <1075808668@qq.com> -Date: Mon, 19 Oct 2020 22:21:10 +0800 -Subject: [PATCH] fix netqtop python3 compatible (#3140) - -* fix netqtop python3 compatible -* delete import types ---- - tools/netqtop.py | 27 ++++++++++++++------------- - 1 file changed, 14 insertions(+), 13 deletions(-) - -diff --git a/tools/netqtop.py b/tools/netqtop.py -index dbe9206a..47e9103e 100755 ---- a/tools/netqtop.py -+++ b/tools/netqtop.py -@@ -1,11 +1,11 @@ - #!/usr/bin/python - -+from __future__ import print_function - from bcc import BPF - from ctypes import * - import argparse - import os - from time import sleep,time,localtime,asctime --import types - - # pre defines ------------------------------- - ROOT_PATH = "/sys/class/net" -@@ -28,7 +28,7 @@ def to_str(num): - elif num > 1000: - return str(round(num/1024.0, 2)) + 'K' - else: -- if type(num) == types.FloatType: -+ if isinstance(num, float): - return str(round(num, 2)) - else: - return str(num) -@@ -50,9 +50,10 @@ def print_table(table, qnum): - headers.append("BPS") - headers.append("PPS") - -+ print(" ", end="") - for hd in headers: -- print(hd.center(COL_WIDTH)) -- print -+ print( "%-11s" % hd, end="") -+ print() - - # ------- calculates -------------- - qids=[] -@@ -97,7 +98,7 @@ def print_table(table, qnum): - avg = 0 - if data[2] != 0: - avg = data[1] / data[2] -- print("%5d %11s %10s %10s %10s %10s %10s" % ( -+ print(" %-11d%-11s%-11s%-11s%-11s%-11s%-11s" % ( - data[0], - to_str(avg), - to_str(data[3]), -@@ -105,34 +106,34 @@ def print_table(table, qnum): - to_str(data[5]), - to_str(data[6]), - to_str(data[7]) -- )), -+ ), end="") - if args.throughput: - BPS = data[1] / print_interval - PPS = data[2] / print_interval -- print("%10s %10s" % ( -+ print("%-11s%-11s" % ( - to_str(BPS), - to_str(PPS) - )) - else: -- print -+ print() - - # ------- print total -------------- -- print(" Total %10s %10s %10s %10s %10s %10s" % ( -+ print(" Total %-11s%-11s%-11s%-11s%-11s%-11s" % ( - to_str(tAVG), - to_str(tGroup[0]), - to_str(tGroup[1]), - to_str(tGroup[2]), - to_str(tGroup[3]), - to_str(tGroup[4]) -- )), -+ ), end="") - - if args.throughput: -- print("%10s %10s" % ( -+ print("%-11s%-11s" % ( - to_str(tBPS), - to_str(tPPS) - )) - else: -- print -+ print() - - - def print_result(b): -@@ -152,7 +153,7 @@ def print_result(b): - if args.throughput: - print("-"*95) - else: -- print("-"*76) -+ print("-"*77) - - ############## specify network interface ################# - parser = argparse.ArgumentParser(description="") --- -2.29.2 - diff --git a/1008-bcc-anolis-tools-netqtop-fix-rx-queue-id.patch b/1008-bcc-anolis-tools-netqtop-fix-rx-queue-id.patch deleted file mode 100644 index 5d5f66acb396edc44709a04916bd163a2ed70dc4..0000000000000000000000000000000000000000 --- a/1008-bcc-anolis-tools-netqtop-fix-rx-queue-id.patch +++ /dev/null @@ -1,59 +0,0 @@ -From a55192b26d0a9294ed4e0bcd8170225dad62dd61 Mon Sep 17 00:00:00 2001 -From: zhenwei pi -Date: Mon, 21 Dec 2020 19:49:36 +0800 -Subject: [PATCH] tools/netqtop: fix rx queue id - -Net device driver uses 'skb_record_rx_queue' to mark rx queue -mapping during receiving a packet. Also need to call -'skb_get_rx_queue' to get rx queue id. - -Signed-off-by: zhenwei pi ---- - tools/netqtop.c | 22 ++++++++++++++++++---- - 1 file changed, 18 insertions(+), 4 deletions(-) - -diff --git a/tools/netqtop.c b/tools/netqtop.c -index 52605dda..e64ed7fd 100644 ---- a/tools/netqtop.c -+++ b/tools/netqtop.c -@@ -95,19 +95,33 @@ TRACEPOINT_PROBE(net, net_dev_start_xmit){ - } - - TRACEPOINT_PROBE(net, netif_receive_skb){ -- struct sk_buff* skb = (struct sk_buff*)args->skbaddr; -- if(!name_filter(skb)){ -+ struct sk_buff skb; -+ -+ bpf_probe_read(&skb, sizeof(skb), args->skbaddr); -+ if(!name_filter(&skb)){ - return 0; - } - -- u16 qid = skb->queue_mapping; -+ /* case 1: if the NIC does not support multi-queue feature, there is only -+ * one queue(qid is always 0). -+ * case 2: if the NIC supports multi-queue feature, there are several queues -+ * with different qid(from 0 to n-1). -+ * The net device driver should mark queue id by API 'skb_record_rx_queue' -+ * for a recieved skb, otherwise it should be a BUG(all of the packets are -+ * reported as queue 0). For example, virtio net driver is fixed for linux: -+ * commit: 133bbb18ab1a2("virtio-net: per-queue RPS config") -+ */ -+ u16 qid = 0; -+ if (skb_rx_queue_recorded(&skb)) -+ qid = skb_get_rx_queue(&skb); -+ - struct queue_data newdata; - __builtin_memset(&newdata, 0, sizeof(newdata)); - struct queue_data *data = rx_q.lookup_or_try_init(&qid, &newdata); - if(!data){ - return 0; - } -- updata_data(data, skb->len); -+ updata_data(data, skb.len); - - return 0; - } --- -2.29.2 - diff --git a/1009-bcc-anolis-set-larger-range-to-get-probes-evnet-for-test_usdt2.patch b/1009-bcc-anolis-set-larger-range-to-get-probes-evnet-for-test_usdt2.patch deleted file mode 100644 index 4ce59534ab46fc53852d7cf501c8f0c9188ecddc..0000000000000000000000000000000000000000 --- a/1009-bcc-anolis-set-larger-range-to-get-probes-evnet-for-test_usdt2.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 4354c9ce33496df82c8ffd30497141daae28afaa Mon Sep 17 00:00:00 2001 -From: Chunmei Xu -Date: Tue, 13 Oct 2020 17:45:48 +0800 -Subject: [PATCH] set larger range to get probes evnet for test_usdt2.py - -I test test_usdt2.py on aarch64 with kernel-5.9-rc5, -gcc-9.2.1 and glibc2.32. -with the current range of 3, always get failure: -====================================================================== -FAIL: test_attach1 (__main__.TestUDST) ----------------------------------------------------------------------- -Traceback (most recent call last): - File "test_usdt2.py", line 170, in test_attach1 - self.assertTrue(self.evt_st_6 == 1) -AssertionError: False is not true - ----------------------------------------------------------------------- -Ran 1 test in 1.068s - -FAILED (failures=1) - -Signed-off-by: Chunmei Xu ---- - tests/python/test_usdt2.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/python/test_usdt2.py b/tests/python/test_usdt2.py -index a2f46110..c8c47fe6 100755 ---- a/tests/python/test_usdt2.py -+++ b/tests/python/test_usdt2.py -@@ -149,7 +149,7 @@ int do_trace3(struct pt_regs *ctx) { - b["event6"].open_perf_buffer(print_event6) - - # three iterations to make sure we get some probes and have time to process them -- for i in range(3): -+ for i in range(5): - b.perf_buffer_poll() - - # note that event1 and event4 do not really fire, so their state should be 0 --- -2.19.1.6.gb485710b - diff --git a/bcc-0.16.0-slabratetop-Add-memcg_cache_params-struct-def.patch b/bcc-0.16.0-slabratetop-Add-memcg_cache_params-struct-def.patch deleted file mode 100644 index 590df467173f31fc646d96b9f2e243b523f9d5d9..0000000000000000000000000000000000000000 --- a/bcc-0.16.0-slabratetop-Add-memcg_cache_params-struct-def.patch +++ /dev/null @@ -1,39 +0,0 @@ -From fe1f2189326a54e3496b2fcfdc1b08839f3165b4 Mon Sep 17 00:00:00 2001 -From: Daniel Rank -Date: Sun, 27 Sep 2020 16:55:22 -0700 -Subject: [PATCH] slabratetop: Add memcg_cache_params struct def - -struct memcg_cache_params moved from include/linux/slab.h to -mm/slab.h in kernel v5.4, causing a compiler error when including -slub_def.h or slab_def.h in slabratetop's bpf program. - -It has been removed completely from kernel version 5.9. - -Add an empty memcg_cache_params struct in slabratetop's bpf -program so it will compile with kernel versions 5.4 to 5.8. ---- - tools/slabratetop.py | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/tools/slabratetop.py b/tools/slabratetop.py -index 066f79d6..182dbd1d 100755 ---- a/tools/slabratetop.py -+++ b/tools/slabratetop.py -@@ -62,7 +62,13 @@ loadavg = "/proc/loadavg" - bpf_text = """ - #include - #include --#include -+ -+// memcg_cache_params is a part of kmem_cache, but is not publicly exposed in -+// kernel versions 5.4 to 5.8. Define an empty struct for it here to allow the -+// bpf program to compile. It has been completely removed in kernel version -+// 5.9, but it does not hurt to have it here for versions 5.4 to 5.8. -+struct memcg_cache_params {}; -+ - #ifdef CONFIG_SLUB - #include - #else --- -2.29.2 - diff --git a/bcc-0.16.0-sync-with-libbpf-repo.patch b/bcc-0.16.0-sync-with-libbpf-repo.patch deleted file mode 100644 index d1f2323dd42d450eb55d5c2201d97ae4bb46e371..0000000000000000000000000000000000000000 --- a/bcc-0.16.0-sync-with-libbpf-repo.patch +++ /dev/null @@ -1,121 +0,0 @@ -From da9ec2b1673ddf6b956304dca6ed6918d89d4631 Mon Sep 17 00:00:00 2001 -From: Yonghong Song -Date: Sat, 22 Aug 2020 15:19:46 -0700 -Subject: [PATCH] sync with libbpf repo - -sync with latest libbpf repo. - -Strut definition for btf_ext_header is defined in libbpf/src/btf.h -previously and used by bcc. Now, the struct is moved to -libbpf/src/libbpf_internal.h and not available to bcc. -We do not want to include libbpf/src/libbpf_internal.h as -it is really libbpf internal. Let us define bcc version -of btf_ext_header with struct name bcc_btf_ext_header. -The new name is to avoid conflict when compiling with -old libbpf package. - -Signed-off-by: Yonghong Song ---- - src/cc/bcc_btf.cc | 2 +- - src/cc/bcc_btf.h | 17 +++++++++++++++++ - src/cc/compat/linux/virtual_bpf.h | 17 ++++++++++++----- - 4 files changed, 31 insertions(+), 7 deletions(-) - -diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc -index e220f117..1056950c 100644 ---- a/src/cc/bcc_btf.cc -+++ b/src/cc/bcc_btf.cc -@@ -185,7 +185,7 @@ void BTF::adjust(uint8_t *btf_sec, uintptr_t btf_sec_size, - } - - struct btf_header *hdr = (struct btf_header *)btf_sec; -- struct btf_ext_header *ehdr = (struct btf_ext_header *)btf_ext_sec; -+ struct bcc_btf_ext_header *ehdr = (struct bcc_btf_ext_header *)btf_ext_sec; - - // Fixup btf for old kernels or kernel requirements. - fixup_btf(btf_sec + hdr->hdr_len + hdr->type_off, hdr->type_len, -diff --git a/src/cc/bcc_btf.h b/src/cc/bcc_btf.h -index 438c1f73..75b47cc3 100644 ---- a/src/cc/bcc_btf.h -+++ b/src/cc/bcc_btf.h -@@ -45,6 +45,23 @@ class BTFStringTable { - }; - - class BTF { -+ struct bcc_btf_ext_header { -+ uint16_t magic; -+ uint8_t version; -+ uint8_t flags; -+ uint32_t hdr_len; -+ -+ /* All offsets are in bytes relative to the end of this header */ -+ uint32_t func_info_off; -+ uint32_t func_info_len; -+ uint32_t line_info_off; -+ uint32_t line_info_len; -+ -+ /* optional part of .BTF.ext header */ -+ uint32_t core_relo_off; -+ uint32_t core_relo_len; -+}; -+ - public: - BTF(bool debug, sec_map_def §ions); - ~BTF(); -diff --git a/src/cc/compat/linux/virtual_bpf.h b/src/cc/compat/linux/virtual_bpf.h -index 38262630..0387b970 100644 ---- a/src/cc/compat/linux/virtual_bpf.h -+++ b/src/cc/compat/linux/virtual_bpf.h -@@ -768,7 +768,7 @@ union bpf_attr { - * - * Also, note that **bpf_trace_printk**\ () is slow, and should - * only be used for debugging purposes. For this reason, a notice -- * bloc (spanning several lines) is printed to kernel logs and -+ * block (spanning several lines) is printed to kernel logs and - * states that the helper should not be used "for production use" - * the first time this helper is used (or more precisely, when - * **trace_printk**\ () buffers are allocated). For passing values -@@ -1034,14 +1034,14 @@ union bpf_attr { - * - * int ret; - * struct bpf_tunnel_key key = {}; -- * -+ * - * ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); - * if (ret < 0) - * return TC_ACT_SHOT; // drop packet -- * -+ * - * if (key.remote_ipv4 != 0x0a000001) - * return TC_ACT_SHOT; // drop packet -- * -+ * - * return TC_ACT_OK; // accept packet - * - * This interface can also be used with all encapsulation devices -@@ -1148,7 +1148,7 @@ union bpf_attr { - * Description - * Retrieve the realm or the route, that is to say the - * **tclassid** field of the destination for the *skb*. The -- * indentifier retrieved is a user-provided tag, similar to the -+ * identifier retrieved is a user-provided tag, similar to the - * one used with the net_cls cgroup (see description for - * **bpf_get_cgroup_classid**\ () helper), but here this tag is - * held by a route (a destination entry), not by a task. -@@ -4072,6 +4072,13 @@ struct bpf_link_info { - __u64 cgroup_id; - __u32 attach_type; - } cgroup; -+ struct { -+ __aligned_u64 target_name; /* in/out: target_name buffer ptr */ -+ __u32 target_name_len; /* in/out: target_name buffer len */ -+ union { -+ __u32 map_id; -+ } map; -+ } iter; - struct { - __u32 netns_ino; - __u32 attach_type; --- -2.29.2 - diff --git a/bcc-0.16.0-tools-include-kasan-header-in-slabtoprate.patch b/bcc-0.16.0-tools-include-kasan-header-in-slabtoprate.patch deleted file mode 100644 index 8576ebb7242f7a7f3319cce969f1bfe4a9d39c66..0000000000000000000000000000000000000000 --- a/bcc-0.16.0-tools-include-kasan-header-in-slabtoprate.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 33393d3008969e43d26f0e4b3e71198130f9f44d Mon Sep 17 00:00:00 2001 -From: Jerome Marchand -Date: Thu, 18 Feb 2021 11:33:20 +0100 -Subject: [PATCH] tools: include kasan header in slabtoprate - -slabtoprate fails on 5.10 kernels because of a missing kasan_reset_tag -declaration. We need to include the kasan header file. - -Fixes the following error: -In file included from /virtual/main.c:12: -include/linux/slub_def.h:181:27: warning: implicit declaration of function 'kasan_reset_tag' is invalid in C99 [-Wimplicit-function-declaration] - return reciprocal_divide(kasan_reset_tag(obj) - addr, - ^ -include/linux/slub_def.h:181:48: error: invalid operands to binary expression ('int' and 'void *') - return reciprocal_divide(kasan_reset_tag(obj) - addr, - ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~ -1 warning and 1 error generated. -Traceback (most recent call last): - File "/usr/share/bcc/tools/slabratetop", line 115, in - b = BPF(text=bpf_text) - File "/usr/lib/python3.9/site-packages/bcc/__init__.py", line 364, in __init__ - raise Exception("Failed to compile BPF module %s" % (src_file or "")) -Exception: Failed to compile BPF module ---- - tools/slabratetop.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/slabratetop.py b/tools/slabratetop.py -index 182dbd1d..75280c6d 100755 ---- a/tools/slabratetop.py -+++ b/tools/slabratetop.py -@@ -62,6 +62,7 @@ loadavg = "/proc/loadavg" - bpf_text = """ - #include - #include -+#include - - // memcg_cache_params is a part of kmem_cache, but is not publicly exposed in - // kernel versions 5.4 to 5.8. Define an empty struct for it here to allow the --- -2.29.2 - diff --git a/bcc-0.16.0-tools-tcptracer-fix-alignement-in-tcp_ipv6_event_t.patch b/bcc-0.16.0-tools-tcptracer-fix-alignement-in-tcp_ipv6_event_t.patch deleted file mode 100644 index ff7675e42b7e6bb94bc26009ce77a2049e156c8b..0000000000000000000000000000000000000000 --- a/bcc-0.16.0-tools-tcptracer-fix-alignement-in-tcp_ipv6_event_t.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 52c4e8cec4dd560503ff011f8fe7eec5f67b33c9 Mon Sep 17 00:00:00 2001 -From: Jerome Marchand -Date: Thu, 17 Sep 2020 10:37:02 +0200 -Subject: [PATCH 2/2] tools: tcptracer: fix alignement in tcp_ipv6_event_t - -On IPv6, tcptracer ports always appears as zeros: - -Tracing TCP established connections. Ctrl-C to end. -T PID COMM IP SADDR DADDR SPORT DPORT -X 7055 nc 4 127.0.0.1 127.0.0.1 49476 9999 -C 7074 nc 4 127.0.0.1 127.0.0.1 49478 9999 -X 7074 nc 4 127.0.0.1 127.0.0.1 49478 9999 -C 7085 nc 6 [::] [0:0:0:1::] 0 0 -X 7085 nc 6 [::] [0:0:0:1::] 0 0 -C 7086 nc 6 [::] [0:0:0:1::] 0 0 - -This seems related to alignment issue wrt to the __int128 type in -tcp_ipv6_event_t structure. Moving the u8 field ip to the end of the -structure fixes the issue. - -Fixes #2781 ---- - tools/tcptracer.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/tcptracer.py b/tools/tcptracer.py -index 2e486b15..3220105e 100755 ---- a/tools/tcptracer.py -+++ b/tools/tcptracer.py -@@ -73,12 +73,12 @@ struct tcp_ipv6_event_t { - u32 type; - u32 pid; - char comm[TASK_COMM_LEN]; -- u8 ip; - unsigned __int128 saddr; - unsigned __int128 daddr; - u16 sport; - u16 dport; - u32 netns; -+ u8 ip; - }; - BPF_PERF_OUTPUT(tcp_ipv6_event); - --- -2.25.4 - diff --git a/bcc-0.19.0-Define-missing-BPF_-macros.patch b/bcc-0.19.0-Define-missing-BPF_-macros.patch new file mode 100644 index 0000000000000000000000000000000000000000..01d524dfcdc0f3561ba264f7ef3e1554f1991f85 --- /dev/null +++ b/bcc-0.19.0-Define-missing-BPF_-macros.patch @@ -0,0 +1,27 @@ +From d25f87677b554d9cbdc609c020a2baa59e442443 Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Wed, 2 Jun 2021 10:57:43 +0200 +Subject: [PATCH] Define missing BPF_* macros + +We're currently missing BPF_MAP_TYPE_TASK_STORAGE. This could be +fixed by a future rebase. In the mean time, let's have a temporary +fix. + +diff --git a/introspection/bps.c b/introspection/bps.c +index 0eae675e..1108e417 100644 +--- a/introspection/bps.c ++++ b/introspection/bps.c +@@ -49,6 +49,10 @@ static const char * const prog_type_strings[] = { + [BPF_PROG_TYPE_SK_LOOKUP] = "sk_lookup", + }; + ++#ifndef BPF_MAP_TYPE_TASK_STORAGE ++#define BPF_MAP_TYPE_TASK_STORAGE (BPF_MAP_TYPE_INODE_STORAGE + 1) ++#endif ++ + static const char * const map_type_strings[] = { + [BPF_MAP_TYPE_UNSPEC] = "unspec", + [BPF_MAP_TYPE_HASH] = "hash", +-- +2.31.1 + diff --git a/bcc-0.19.0-Fix-BPF-src_file-foo.patch b/bcc-0.19.0-Fix-BPF-src_file-foo.patch new file mode 100644 index 0000000000000000000000000000000000000000..4154b4bee18daabb6623e8fe6a0e9ccc0ac23d04 --- /dev/null +++ b/bcc-0.19.0-Fix-BPF-src_file-foo.patch @@ -0,0 +1,39 @@ +From 9051043a126a838902b88d144eea1b631d2c3eef Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Tue, 27 Apr 2021 15:13:12 +0200 +Subject: [PATCH] Fix BPF(src_file="foo") + +Since commit 75f20a15 ("Use string type for comparison to PATH +elements"), src_file isn't working anymore. Somehow, two wrongs +(ArgString __str__() returning a bytes object and joining a bytes and +what was supposed to be a string) did make a right. + +It fixes the following error in netqtop and deadlock: +Traceback (most recent call last): + File "/usr/share/bcc/tools/netqtop", line 207, in + b = BPF(src_file = EBPF_FILE) + File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 335, in __init__ + src_file = BPF._find_file(src_file) + File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 255, in _find_file + t = b"/".join([os.path.abspath(os.path.dirname(argv0.__str__())), filename]) +TypeError: sequence item 0: expected a bytes-like object, str found +--- + src/python/bcc/__init__.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py +index 90562cd7..eabe0a55 100644 +--- a/src/python/bcc/__init__.py ++++ b/src/python/bcc/__init__.py +@@ -252,7 +252,7 @@ DEBUG_BTF = 0x20 + if filename: + if not os.path.isfile(filename): + argv0 = ArgString(sys.argv[0]) +- t = b"/".join([os.path.abspath(os.path.dirname(argv0.__str__())), filename]) ++ t = b"/".join([os.path.abspath(os.path.dirname(argv0.__bytes__())), filename]) + if os.path.isfile(t): + filename = t + else: +-- +2.30.2 + diff --git a/bcc-0.16.0-Manpages-remove-unstable-statement.patch b/bcc-0.19.0-Manpages-remove-unstable-statement.patch similarity index 92% rename from bcc-0.16.0-Manpages-remove-unstable-statement.patch rename to bcc-0.19.0-Manpages-remove-unstable-statement.patch index 7832153dd98e466145fb4762acfc3f2d394b79ae..dc84ec907ae00e8f7c3066fdea61d2b86c7eca45 100644 --- a/bcc-0.16.0-Manpages-remove-unstable-statement.patch +++ b/bcc-0.19.0-Manpages-remove-unstable-statement.patch @@ -1,4 +1,4 @@ -From c42e75d3a80e9fcee66a27edf256452451a3a9b1 Mon Sep 17 00:00:00 2001 +From f4e66f50d1af5b5dd0dc1dbb261f911514c465ed Mon Sep 17 00:00:00 2001 From: Jerome Marchand Date: Tue, 6 Aug 2019 14:44:33 +0200 Subject: [PATCH] Manpages: remove unstable statement @@ -53,6 +53,7 @@ enough. man/man8/memleak.8 | 2 -- man/man8/mountsnoop.8 | 2 -- man/man8/mysqld_qslower.8 | 2 -- + man/man8/netqtop.8 | 2 -- man/man8/nfsdist.8 | 2 -- man/man8/nfsslower.8 | 2 -- man/man8/offcputime.8 | 2 -- @@ -61,6 +62,7 @@ enough. man/man8/opensnoop.8 | 2 -- man/man8/pidpersec.8 | 2 -- man/man8/profile.8 | 2 -- + man/man8/readahead.8 | 2 -- man/man8/reset-trace.8 | 2 -- man/man8/runqlat.8 | 2 -- man/man8/runqlen.8 | 2 -- @@ -74,6 +76,7 @@ enough. man/man8/sslsniff.8 | 2 -- man/man8/stackcount.8 | 2 -- man/man8/statsnoop.8 | 2 -- + man/man8/swapin.8 | 2 -- man/man8/syncsnoop.8 | 2 -- man/man8/syscount.8 | 2 -- man/man8/tcpaccept.8 | 2 -- @@ -82,10 +85,13 @@ enough. man/man8/tcpdrop.8 | 2 -- man/man8/tcplife.8 | 2 -- man/man8/tcpretrans.8 | 2 -- + man/man8/tcprtt.8 | 2 -- man/man8/tcpstates.8 | 2 -- man/man8/tcpsubnet.8 | 2 -- + man/man8/tcpsynbl.8 | 2 -- man/man8/tcptop.8 | 2 -- man/man8/tcptracer.8 | 2 -- + man/man8/threadsnoop.8 | 2 -- man/man8/tplist.8 | 2 -- man/man8/trace.8 | 2 -- man/man8/ttysnoop.8 | 2 -- @@ -97,12 +103,13 @@ enough. man/man8/uthreads.8 | 2 -- man/man8/vfscount.8 | 2 -- man/man8/vfsstat.8 | 2 -- + man/man8/virtiostat.8 | 2 -- man/man8/wakeuptime.8 | 2 -- man/man8/xfsdist.8 | 2 -- man/man8/xfsslower.8 | 2 -- man/man8/zfsdist.8 | 2 -- man/man8/zfsslower.8 | 2 -- - 96 files changed, 194 deletions(-) + 103 files changed, 208 deletions(-) diff --git a/man/man8/argdist.8 b/man/man8/argdist.8 index 4116cd4d..aa128d2d 100644 @@ -143,10 +150,10 @@ index f8fa1850..05ed95a7 100644 Pavel Dubovitsky .SH SEE ALSO diff --git a/man/man8/biolatency.8 b/man/man8/biolatency.8 -index fe4da6b2..6ffa3429 100644 +index c303eec0..895deb31 100644 --- a/man/man8/biolatency.8 +++ b/man/man8/biolatency.8 -@@ -91,8 +91,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing +@@ -98,8 +98,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. .SH OS Linux @@ -709,6 +716,18 @@ index 5753079a..7daf074b 100644 .SH AUTHOR Brendan Gregg .SH SEE ALSO +diff --git a/man/man8/netqtop.8 b/man/man8/netqtop.8 +index bfa34d11..8750782b 100644 +--- a/man/man8/netqtop.8 ++++ b/man/man8/netqtop.8 +@@ -50,7 +50,5 @@ Also look in the bcc distribution for a netqtop_example.txt file containing + example usage, output and commentary for this tool. + .SH OS + Linux +-.SH STABILITY +-Unstable - in development + .SH AUTHOR + Yolandajn diff --git a/man/man8/nfsdist.8 b/man/man8/nfsdist.8 index c72cfaa6..34532c18 100644 --- a/man/man8/nfsdist.8 @@ -813,6 +832,19 @@ index 30871afe..8523a731 100644 .SH AUTHOR Brendan Gregg .SH SEE ALSO +diff --git a/man/man8/readahead.8 b/man/man8/readahead.8 +index a2a10914..da8e4fe4 100644 +--- a/man/man8/readahead.8 ++++ b/man/man8/readahead.8 +@@ -51,8 +51,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing + example usage, output, and commentary for this tool. + .SH OS + Linux +-.SH STABILITY +-Unstable - in development. + .SH AUTHOR + Suchakra Sharma + .SH SEE ALSO diff --git a/man/man8/reset-trace.8 b/man/man8/reset-trace.8 index e96d4790..90f525e0 100644 --- a/man/man8/reset-trace.8 @@ -971,6 +1003,19 @@ index c0555043..d1560b3c 100644 .SH OS Linux -.SH STABILITY +-Unstable - in development. + .SH AUTHOR + Brendan Gregg + .SH SEE ALSO +diff --git a/man/man8/swapin.8 b/man/man8/swapin.8 +index c5ef1ffc..89600460 100644 +--- a/man/man8/swapin.8 ++++ b/man/man8/swapin.8 +@@ -50,8 +50,6 @@ Also look in the bcc distribution for a companion _examples.txt file + containing example usage, output, and commentary for this tool. + .SH OS + Linux +-.SH STABILITY -Unstable - in development. .SH AUTHOR Brendan Gregg @@ -1015,10 +1060,10 @@ index 603a5ca4..4e7dfc9e 100644 Brendan Gregg .SH SEE ALSO diff --git a/man/man8/tcpconnect.8 b/man/man8/tcpconnect.8 -index c96058b0..843aaa9c 100644 +index 55105709..7c1740a4 100644 --- a/man/man8/tcpconnect.8 +++ b/man/man8/tcpconnect.8 -@@ -125,8 +125,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing +@@ -183,8 +183,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. .SH OS Linux @@ -1028,10 +1073,10 @@ index c96058b0..843aaa9c 100644 Brendan Gregg .SH SEE ALSO diff --git a/man/man8/tcpconnlat.8 b/man/man8/tcpconnlat.8 -index 996c21bb..7af1c57b 100644 +index 9c810071..236f0fb0 100644 --- a/man/man8/tcpconnlat.8 +++ b/man/man8/tcpconnlat.8 -@@ -101,8 +101,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing +@@ -111,8 +111,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. .SH OS Linux @@ -1079,6 +1124,19 @@ index 0ac82afa..04226dc6 100644 .SH AUTHOR Brendan Gregg .SH SEE ALSO +diff --git a/man/man8/tcprtt.8 b/man/man8/tcprtt.8 +index 729a1abb..e934102a 100644 +--- a/man/man8/tcprtt.8 ++++ b/man/man8/tcprtt.8 +@@ -78,8 +78,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing + example usage, output, and commentary for this tool. + .SH OS + Linux +-.SH STABILITY +-Unstable - in development. + .SH AUTHOR + zhenwei pi + .SH SEE ALSO diff --git a/man/man8/tcpstates.8 b/man/man8/tcpstates.8 index 26c7a8a1..d93c198d 100644 --- a/man/man8/tcpstates.8 @@ -1105,6 +1163,19 @@ index 525b8082..daf41583 100644 .SH AUTHOR Rodrigo Manyari .SH INSPIRATION +diff --git a/man/man8/tcpsynbl.8 b/man/man8/tcpsynbl.8 +index 4dd38c8a..93c353b1 100644 +--- a/man/man8/tcpsynbl.8 ++++ b/man/man8/tcpsynbl.8 +@@ -51,8 +51,6 @@ Also look in the bcc distribution for a companion _examples.txt file + containing example usage, output, and commentary for this tool. + .SH OS + Linux +-.SH STABILITY +-Unstable - in development. + .SH AUTHOR + Brendan Gregg + .SH SEE ALSO diff --git a/man/man8/tcptop.8 b/man/man8/tcptop.8 index e636f456..633b0c93 100644 --- a/man/man8/tcptop.8 @@ -1131,6 +1202,19 @@ index d2346c77..893604d6 100644 .SH AUTHOR Iago López Galeiras .SH SEE ALSO +diff --git a/man/man8/threadsnoop.8 b/man/man8/threadsnoop.8 +index 3c655f24..007281ad 100644 +--- a/man/man8/threadsnoop.8 ++++ b/man/man8/threadsnoop.8 +@@ -52,8 +52,6 @@ Also look in the bcc distribution for a companion _examples.txt file + containing example usage, output, and commentary for this tool. + .SH OS + Linux +-.SH STABILITY +-Unstable - in development. + .SH AUTHOR + Brendan Gregg + .SH SEE ALSO diff --git a/man/man8/tplist.8 b/man/man8/tplist.8 index da5edf37..f7e459da 100644 --- a/man/man8/tplist.8 @@ -1272,6 +1356,19 @@ index 929e6b63..f439857e 100644 .SH AUTHOR Brendan Gregg .SH SEE ALSO +diff --git a/man/man8/virtiostat.8 b/man/man8/virtiostat.8 +index 8578f8d3..ac312c56 100644 +--- a/man/man8/virtiostat.8 ++++ b/man/man8/virtiostat.8 +@@ -58,8 +58,6 @@ Also look in the bcc distribution for a companion _examples.txt file containing + example usage, output, and commentary for this tool. + .SH OS + Linux +-.SH STABILITY +-Unstable - in development. + .SH AUTHOR + zhenwei pi + .SH SEE ALSO diff --git a/man/man8/wakeuptime.8 b/man/man8/wakeuptime.8 index 8630ae4a..3c7cf80a 100644 --- a/man/man8/wakeuptime.8 @@ -1338,5 +1435,5 @@ index d1e2f9c1..31d382f6 100644 Brendan Gregg .SH SEE ALSO -- -2.25.4 +2.30.2 diff --git a/bcc-src-with-submodule.tar.gz b/bcc-0.19.0.tar.gz similarity index 39% rename from bcc-src-with-submodule.tar.gz rename to bcc-0.19.0.tar.gz index d9087517a3da96e73de02a3cb08ca1954fa3dd7f..b0a14587ce1f22c7e1b0399a88aaafaacb326569 100644 Binary files a/bcc-src-with-submodule.tar.gz and b/bcc-0.19.0.tar.gz differ diff --git a/bcc.spec b/bcc.spec index 0c9bdb35b618a72b0fad9c3ee08136ca5d13a9dc..1c0073fc76b3c87494f0f8d6e5e1b5491349fdb8 100644 --- a/bcc.spec +++ b/bcc.spec @@ -10,30 +10,17 @@ %endif Name: bcc -Version: 0.16.0 -Release: 3%{anolis_release}%{?dist} +Version: 0.19.0 +Release: 4%{anolis_release}%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc -# Upstream now provides a release with the git submodule embedded in it -Source0: %{url}/releases/download/v%{version}/%{name}-src-with-submodule.tar.gz -#Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-Manpages-remove-unstable-statement.patch -Patch1: %{name}-%{version}-tools-tcptracer-fix-alignement-in-tcp_ipv6_event_t.patch -Patch2: %{name}-%{version}-sync-with-libbpf-repo.patch -Patch3: %{name}-%{version}-slabratetop-Add-memcg_cache_params-struct-def.patch -Patch4: %{name}-%{version}-tools-include-kasan-header-in-slabtoprate.patch - -Patch1000: 1000-bcc-anolis-ali-enhanced-tools-for-fs-schedule-sys.patch -Patch1001: 1001-bcc-anolis-tests-test_array.py-add-clock_nanosleep-to-attach-po.patch -Patch1002: 1002-bcc-anolis-fix-some-test-cases-failed-3235.patch -Patch1003: 1003-bcc-anolis-test-test_histogram.py-fix-test-failed-on-kernel-5.1.patch -Patch1004: 1004-bcc-anolis-aarch64-turn-off-jump-table-optimization-during-jit-.patch -Patch1005: 1005-bcc-anolis-Netqtop-3037-3048.patch -Patch1006: 1006-bcc-anolis-fix-python3-compatible-issue-for-netqtop.patch -Patch1007: 1007-bcc-anolis-fix-netqtop-python3-compatible-3140.patch -Patch1008: 1008-bcc-anolis-tools-netqtop-fix-rx-queue-id.patch -Patch1009: 1009-bcc-anolis-set-larger-range-to-get-probes-evnet-for-test_usdt2.patch +Patch1: %{name}-%{version}-Fix-BPF-src_file-foo.patch +Patch2: %{name}-%{version}-Define-missing-BPF_-macros.patch + +Patch1000: 1000-bcc-anolis-enhanced-tools-for-fs-schedule-sys.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -55,13 +42,16 @@ BuildRequires: ncurses-devel BuildRequires: pkgconfig(luajit) %endif BuildRequires: libbpf-devel >= 0.0.9, libbpf-static >= 0.0.9 + +Requires: libbpf >= 0.0.9 +Requires: tar +Recommends: kernel-devel +Recommends: %{name}-tools = %{version}-%{release} + %if %{with python2} BuildRequires: python2 python2-rpm-macros %endif -Requires: %{name}-tools = %{version}-%{release} -Requires: libbpf >= 0.0.9 - %if %{with python2} %global python_cmds python2;python3 %else @@ -132,13 +122,12 @@ Standalone tool to run BCC tracers written in Lua Summary: Command line tools for BPF Compiler Collection (BCC) Requires: python3-%{name} = %{version}-%{release} Requires: python3-netaddr -Requires: kernel-devel %description tools Command line tools for BPF Compiler Collection (BCC) %prep -%autosetup -p1 -n %{name} +%autosetup -p1 %build %cmake . \ @@ -193,14 +182,12 @@ done %license LICENSE.txt %{_libdir}/lib%{name}.so.* %{_libdir}/libbcc_bpf.so.* -%{_libdir}/libbcc-no-libbpf.so.* %files devel %exclude %{_libdir}/lib%{name}*.a %exclude %{_libdir}/lib%{name}*.la %{_libdir}/lib%{name}.so %{_libdir}/libbcc_bpf.so -%{_libdir}/libbcc-no-libbpf.so %{_libdir}/pkgconfig/lib%{name}.pc %{_includedir}/%{name}/ @@ -256,16 +243,23 @@ done %changelog -* Fri Nov 19 2021 Chunmei Xu - 0.16.0-3.0.1 -- add ali enhanced tools for fs schedule and sys -- fix testcases: test_array/test_uprobes/test_clang/test_histogram -- support tools/netqtop -- provides python2-bcc -- set larger range to get probes evnet for test_usdt2.py - -* Mon Feb 22 2021 Jerome Marchand - 0.16.0-3 -- Fix slabratetop header issues -- Rebuild with latest libbpf +* Fri Jan 14 2022 Chunmei Xu - 0.19.0-4.0.1 +- add enhanced tools for fs schedule and sys +- provide python2-bcc + +* Fri Jul 02 2021 Jerome Marchand - 0.19.0-4 +- Build bcc from standard sources +- Don't require bcc-tools by default + +* Wed Jun 09 2021 Jerome Marchand - 0.19.0-3 +- Rebuild on LLVM 12 + +* Fri Apr 30 2021 Jerome Marchand - 0.19.0-2 +- Fix BPF src_file. + +* Tue Apr 27 2021 Jerome Marchand - 0.19.0-1 +- Rebased to version 0.19.0 +- Remove hard dependency on kernel-devel * Fri Jan 22 2021 Jerome Marchand - 0.16.0-2 - Build with libbpf package