From 88a1edf4a50475ad595e01eb87a98606159c97d8 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2020 09:33:40 +0000 Subject: import bcc-0.10.0-1.el7 --- diff --git a/.bcc.metadata b/.bcc.metadata index 4c0f80b..0e97130 100644 --- a/.bcc.metadata +++ b/.bcc.metadata @@ -1 +1 @@ -168b517240fd27aaa48f480d2470907fe1875dac SOURCES/bcc-0.8.0.tar.gz +70e35f9ad5989dfeab4c0e87b98602e78493a730 SOURCES/bcc-0.10.0.tar.gz diff --git a/.gitignore b/.gitignore index 8294aed..4f367d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/bcc-0.8.0.tar.gz +SOURCES/bcc-0.10.0.tar.gz diff --git a/SOURCES/Disable-tests-cc.patch b/SOURCES/Disable-tests-cc.patch deleted file mode 100644 index 8661bf3..0000000 --- a/SOURCES/Disable-tests-cc.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b3faa19c61a5a5385899a80bdd0d6a3052f1415a Mon Sep 17 00:00:00 2001 -From: Jerome Marchand -Date: Thu, 24 May 2018 16:11:30 +0200 -Subject: [PATCH] Disable tests/cc - -Some files in tests/cc/ don't compile on s390x. We can just disable -them until a better fix is available: the build target are not -installed anyway. - ---- - tests/CMakeLists.txt | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 86abec9..48e9029 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -8,7 +8,6 @@ add_test(NAME style-check COMMAND ${CMAKE_SOURCE_DIR}/scripts/style-check.sh) - set_tests_properties(style-check PROPERTIES PASS_REGULAR_EXPRESSION ".*") - - if(ENABLE_CLANG_JIT) --add_subdirectory(cc) - add_subdirectory(python) - add_subdirectory(lua) - endif() --- -2.13.6 - diff --git a/SOURCES/Fix-tools-for-RHEL-7.patch b/SOURCES/Fix-tools-for-RHEL-7.patch index 9135b3f..f6c8362 100644 --- a/SOURCES/Fix-tools-for-RHEL-7.patch +++ b/SOURCES/Fix-tools-for-RHEL-7.patch @@ -1,4 +1,4 @@ -From ac5050ea551af40b47bf2010e179e9020acada69 Mon Sep 17 00:00:00 2001 +From 5848b9fe9ad49151492cb2652a06921fa4b49031 Mon Sep 17 00:00:00 2001 From: Jerome Marchand Date: Thu, 16 Aug 2018 14:58:56 +0200 Subject: [PATCH] Fix tools for RHEL 7 @@ -38,10 +38,10 @@ fixes the following: 20 files changed, 88 insertions(+), 62 deletions(-) diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py -index 1d99afd..f38d23f 100644 +index bff5f282..19933cf7 100644 --- a/src/python/bcc/__init__.py +++ b/src/python/bcc/__init__.py -@@ -511,8 +511,11 @@ DEBUG_BPF_REGISTER_STATE = 0x10 +@@ -525,8 +525,11 @@ DEBUG_BTF = 0x20 @staticmethod def get_kprobe_functions(event_re): @@ -56,7 +56,7 @@ index 1d99afd..f38d23f 100644 in_init_section = 0 diff --git a/tools/btrfsdist.py b/tools/btrfsdist.py -index a0aeb24..3f179d0 100755 +index 4659ab46..3326b67a 100755 --- a/tools/btrfsdist.py +++ b/tools/btrfsdist.py @@ -60,6 +60,7 @@ debug = 0 @@ -96,10 +96,10 @@ index a0aeb24..3f179d0 100755 b.attach_kretprobe(event="btrfs_sync_file", fn_name="trace_fsync_return") diff --git a/tools/btrfsslower.py b/tools/btrfsslower.py -index cff61b8..26aff65 100755 +index bacbc06a..b650cea0 100755 --- a/tools/btrfsslower.py +++ b/tools/btrfsslower.py -@@ -63,6 +63,7 @@ debug = 0 +@@ -62,6 +62,7 @@ debug = 0 bpf_text = """ #include #include @@ -107,7 +107,7 @@ index cff61b8..26aff65 100755 #include #include -@@ -97,7 +98,7 @@ BPF_PERF_OUTPUT(events); +@@ -96,7 +97,7 @@ BPF_PERF_OUTPUT(events); // Store timestamp and size on entry // @@ -116,7 +116,7 @@ index cff61b8..26aff65 100755 // own read function. So we need to trace that and then filter on btrfs, which // I do by checking file->f_op. int trace_read_entry(struct pt_regs *ctx, struct kiocb *iocb) -@@ -124,7 +125,7 @@ int trace_read_entry(struct pt_regs *ctx, struct kiocb *iocb) +@@ -123,7 +124,7 @@ int trace_read_entry(struct pt_regs *ctx, struct kiocb *iocb) return 0; } @@ -125,7 +125,7 @@ index cff61b8..26aff65 100755 int trace_write_entry(struct pt_regs *ctx, struct kiocb *iocb) { u64 id = bpf_get_current_pid_tgid(); -@@ -329,12 +330,12 @@ TASK_COMM_LEN = 16 # linux/sched.h +@@ -313,12 +314,12 @@ int trace_fsync_return(struct pt_regs *ctx) b = BPF(text=bpf_text) # Common file functions. See earlier comment about generic_*(). @@ -143,7 +143,7 @@ index cff61b8..26aff65 100755 b.attach_kretprobe(event="btrfs_sync_file", fn_name="trace_fsync_return") diff --git a/tools/cpudist.py b/tools/cpudist.py -index 9e61341..e5fd550 100755 +index 4d7c9eb4..ddb675e2 100755 --- a/tools/cpudist.py +++ b/tools/cpudist.py @@ -94,7 +94,9 @@ static inline void update_hist(u32 tgid, u32 pid, u64 ts) @@ -158,7 +158,7 @@ index 9e61341..e5fd550 100755 u64 ts = bpf_ktime_get_ns(); u64 pid_tgid = bpf_get_current_pid_tgid(); diff --git a/tools/ext4dist.py b/tools/ext4dist.py -index b71cfda..a6a7e55 100755 +index 384a4c14..559e4a5f 100755 --- a/tools/ext4dist.py +++ b/tools/ext4dist.py @@ -60,6 +60,7 @@ debug = 0 @@ -169,37 +169,47 @@ index b71cfda..a6a7e55 100755 #include #define OP_NAME_LEN 8 -@@ -81,7 +82,7 @@ int trace_entry(struct pt_regs *ctx) - return 0; - } +@@ -136,18 +137,18 @@ int trace_fsync_return(struct pt_regs *ctx) + """ --// The current ext4 (Linux 4.5) uses generic_file_read_iter(), instead of it's -+// ext4 uses generic_file_aio_read(), instead of it's - // own function, for reads. So we need to trace that and then filter on ext4, - // which I do by checking file->f_op. - int trace_read_entry(struct pt_regs *ctx, struct kiocb *iocb) -@@ -189,12 +190,12 @@ b = BPF(text=bpf_text) + # Starting from Linux 4.10 ext4_file_operations.read_iter has been changed from +-# using generic_file_read_iter() to its own ext4_file_read_iter(). ++# using generic_file_aio_read() to its own ext4_file_read_iter(). + # + # To detect the proper function to trace check if ext4_file_read_iter() is + # defined in /proc/kallsyms, if it's defined attach to that function, otherwise +-# use generic_file_read_iter() and inside the trace hook filter on ext4 read ++# use generic_file_aio_read() and inside the trace hook filter on ext4 read + # events (checking if file->f_op == ext4_file_operations). if BPF.get_kprobe_functions(b'ext4_file_read_iter'): - b.attach_kprobe(event="ext4_file_read_iter", fn_name="trace_entry") + ext4_read_fn = 'ext4_file_read_iter' + ext4_trace_read_fn = 'trace_entry' + ext4_trace_read_code = '' else: -- b.attach_kprobe(event="generic_file_read_iter", fn_name="trace_read_entry") +- ext4_read_fn = 'generic_file_read_iter' ++ ext4_read_fn = 'generic_file_aio_read' + ext4_trace_read_fn = 'trace_read_entry' + ext4_file_ops_addr = '' + with open(kallsyms) as syms: +@@ -194,11 +195,11 @@ bpf_text = bpf_text.replace('FACTOR', str(factor)) + b = BPF(text=bpf_text) + + b.attach_kprobe(event=ext4_read_fn, fn_name=ext4_trace_read_fn) -b.attach_kprobe(event="ext4_file_write_iter", fn_name="trace_entry") -+ b.attach_kprobe(event="generic_file_aio_read", fn_name="trace_read_entry") +b.attach_kprobe(event="ext4_file_write", fn_name="trace_entry") b.attach_kprobe(event="ext4_file_open", fn_name="trace_entry") b.attach_kprobe(event="ext4_sync_file", fn_name="trace_entry") --b.attach_kretprobe(event="generic_file_read_iter", fn_name="trace_read_return") + b.attach_kretprobe(event=ext4_read_fn, fn_name='trace_read_return') -b.attach_kretprobe(event="ext4_file_write_iter", fn_name="trace_write_return") -+b.attach_kretprobe(event="generic_file_aio_read", fn_name="trace_read_return") +b.attach_kretprobe(event="ext4_file_write", fn_name="trace_write_return") b.attach_kretprobe(event="ext4_file_open", fn_name="trace_open_return") b.attach_kretprobe(event="ext4_sync_file", fn_name="trace_fsync_return") diff --git a/tools/ext4slower.py b/tools/ext4slower.py -index 344e68f..fe90046 100755 +index 0524f22e..d5fbb661 100755 --- a/tools/ext4slower.py +++ b/tools/ext4slower.py -@@ -64,6 +64,7 @@ debug = 0 +@@ -63,6 +63,7 @@ debug = 0 bpf_text = """ #include #include @@ -207,7 +217,7 @@ index 344e68f..fe90046 100755 #include #include -@@ -98,7 +99,7 @@ BPF_PERF_OUTPUT(events); +@@ -97,7 +98,7 @@ BPF_PERF_OUTPUT(events); // Store timestamp and size on entry // @@ -216,7 +226,7 @@ index 344e68f..fe90046 100755 // own function, for reads. So we need to trace that and then filter on ext4, // which I do by checking file->f_op. // The new Linux version (since form 4.10) uses ext4_file_read_iter(), And if the 'CONFIG_FS_DAX' -@@ -128,7 +129,7 @@ int trace_read_entry(struct pt_regs *ctx, struct kiocb *iocb) +@@ -127,7 +128,7 @@ int trace_read_entry(struct pt_regs *ctx, struct kiocb *iocb) return 0; } @@ -225,7 +235,7 @@ index 344e68f..fe90046 100755 int trace_write_entry(struct pt_regs *ctx, struct kiocb *iocb) { u64 id = bpf_get_current_pid_tgid(); -@@ -330,15 +331,15 @@ b = BPF(text=bpf_text) +@@ -314,15 +315,15 @@ b = BPF(text=bpf_text) if BPF.get_kprobe_functions(b'ext4_file_read_iter'): b.attach_kprobe(event="ext4_file_read_iter", fn_name="trace_read_entry") else: @@ -246,10 +256,10 @@ index 344e68f..fe90046 100755 b.attach_kretprobe(event="ext4_sync_file", fn_name="trace_fsync_return") diff --git a/tools/fileslower.py b/tools/fileslower.py -index 219a94a..46ead05 100755 +index 31e3adf9..05582c9e 100755 --- a/tools/fileslower.py +++ b/tools/fileslower.py -@@ -124,7 +124,7 @@ int trace_read_entry(struct pt_regs *ctx, struct file *file, +@@ -123,7 +123,7 @@ int trace_read_entry(struct pt_regs *ctx, struct file *file, char __user *buf, size_t count) { // skip non-sync I/O; see kernel code for __vfs_read() @@ -258,7 +268,7 @@ index 219a94a..46ead05 100755 return 0; return trace_rw_entry(ctx, file, buf, count); } -@@ -133,7 +133,7 @@ int trace_write_entry(struct pt_regs *ctx, struct file *file, +@@ -132,7 +132,7 @@ int trace_write_entry(struct pt_regs *ctx, struct file *file, char __user *buf, size_t count) { // skip non-sync I/O; see kernel code for __vfs_write() @@ -267,7 +277,7 @@ index 219a94a..46ead05 100755 return 0; return trace_rw_entry(ctx, file, buf, count); } -@@ -200,8 +200,13 @@ b = BPF(text=bpf_text) +@@ -199,8 +199,13 @@ b = BPF(text=bpf_text) # do_sync_read/do_sync_write), but those became static. So trace these from # the parent functions, at the cost of more overhead, instead. # Ultimately, we should be using [V]FS tracepoints. @@ -284,10 +294,10 @@ index 219a94a..46ead05 100755 b.attach_kprobe(event="__vfs_write", fn_name="trace_write_entry") b.attach_kretprobe(event="__vfs_write", fn_name="trace_write_return") diff --git a/tools/memleak.py b/tools/memleak.py -index 4021bf8..7e70af4 100755 +index fd08bc4d..db8b927a 100755 --- a/tools/memleak.py +++ b/tools/memleak.py -@@ -355,13 +355,21 @@ TRACEPOINT_PROBE(kmem, kmem_cache_free) { +@@ -357,13 +357,21 @@ TRACEPOINT_PROBE(kmem, kmem_cache_free) { return gen_free_enter((struct pt_regs *)args, (void *)args->ptr); } @@ -312,7 +322,7 @@ index 4021bf8..7e70af4 100755 """ diff --git a/tools/mountsnoop.py b/tools/mountsnoop.py -index b6f96ca..e2956f8 100755 +index eefb4ec7..5f3678b3 100755 --- a/tools/mountsnoop.py +++ b/tools/mountsnoop.py @@ -24,7 +24,6 @@ bpf_text = r""" @@ -360,10 +370,10 @@ index b6f96ca..e2956f8 100755 event.type = EVENT_UMOUNT_TARGET; diff --git a/tools/nfsslower.py b/tools/nfsslower.py -index 8113eff..e6c62ba 100755 +index 36918ca0..9c6d8f6c 100755 --- a/tools/nfsslower.py +++ b/tools/nfsslower.py -@@ -65,6 +65,7 @@ bpf_text = """ +@@ -64,6 +64,7 @@ bpf_text = """ #include #include @@ -372,7 +382,7 @@ index 8113eff..e6c62ba 100755 #include diff --git a/tools/offcputime.py b/tools/offcputime.py -index 6440260..ef328c1 100755 +index ac3b7281..ea36b264 100755 --- a/tools/offcputime.py +++ b/tools/offcputime.py @@ -128,7 +128,9 @@ BPF_HASH(counts, struct key_t); @@ -387,7 +397,7 @@ index 6440260..ef328c1 100755 u32 tgid = prev->tgid; u64 ts, *tsp; diff --git a/tools/offwaketime.py b/tools/offwaketime.py -index 3c4f0f3..89e7b60 100755 +index 4a1cebab..baa28801 100755 --- a/tools/offwaketime.py +++ b/tools/offwaketime.py @@ -163,7 +163,9 @@ int waker(struct pt_regs *ctx, struct task_struct *p) { @@ -402,10 +412,10 @@ index 3c4f0f3..89e7b60 100755 u32 pid = p->pid; u32 tgid = p->tgid; diff --git a/tools/oomkill.py b/tools/oomkill.py -index db3a537..5357d9f 100755 +index 4f3b6ce7..546c2dc6 100755 --- a/tools/oomkill.py +++ b/tools/oomkill.py -@@ -36,15 +36,15 @@ struct data_t { +@@ -35,15 +35,15 @@ struct data_t { BPF_PERF_OUTPUT(events); @@ -426,7 +436,7 @@ index db3a537..5357d9f 100755 bpf_probe_read(&data.tcomm, sizeof(data.tcomm), p->comm); events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/runqlat.py b/tools/runqlat.py -index 9c56d22..3a56d56 100755 +index 9fd40642..0c9bb1c4 100755 --- a/tools/runqlat.py +++ b/tools/runqlat.py @@ -111,7 +111,7 @@ int trace_ttwu_do_wakeup(struct pt_regs *ctx, struct rq *rq, struct task_struct @@ -439,10 +449,10 @@ index 9c56d22..3a56d56 100755 u32 pid, tgid; diff --git a/tools/runqslower.py b/tools/runqslower.py -index 0b3e1c1..8be9ef0 100755 +index 1d48be8a..16a5a4c2 100755 --- a/tools/runqslower.py +++ b/tools/runqslower.py -@@ -98,7 +98,7 @@ int trace_ttwu_do_wakeup(struct pt_regs *ctx, struct rq *rq, struct task_struct +@@ -97,7 +97,7 @@ int trace_ttwu_do_wakeup(struct pt_regs *ctx, struct rq *rq, struct task_struct } // calculate latency @@ -452,10 +462,10 @@ index 0b3e1c1..8be9ef0 100755 u32 pid, tgid; diff --git a/tools/solisten.py b/tools/solisten.py -index 81e82e0..f30a23f 100755 +index f2a0a342..16872212 100755 --- a/tools/solisten.py +++ b/tools/solisten.py -@@ -101,7 +101,7 @@ int kprobe__inet_listen(struct pt_regs *ctx, struct socket *sock, int backlog) +@@ -100,7 +100,7 @@ int kprobe__inet_listen(struct pt_regs *ctx, struct socket *sock, int backlog) // Get network namespace id, if kernel supports it #ifdef CONFIG_NET_NS @@ -465,7 +475,7 @@ index 81e82e0..f30a23f 100755 evt.netns = 0; #endif diff --git a/tools/tcpsubnet.py b/tools/tcpsubnet.py -index bf944e1..a054a7d 100755 +index 5f2a8062..1ba275bc 100755 --- a/tools/tcpsubnet.py +++ b/tools/tcpsubnet.py @@ -110,8 +110,8 @@ struct index_key_t { @@ -480,10 +490,10 @@ index bf944e1..a054a7d 100755 u16 family = sk->__sk_common.skc_family; diff --git a/tools/tcptracer.py b/tools/tcptracer.py -index 8f272eb..021803a 100755 +index e61fe9ba..f00f0d19 100755 --- a/tools/tcptracer.py +++ b/tools/tcptracer.py -@@ -116,7 +116,7 @@ static int read_ipv4_tuple(struct ipv4_tuple_t *tuple, struct sock *skp) +@@ -115,7 +115,7 @@ static int read_ipv4_tuple(struct ipv4_tuple_t *tuple, struct sock *skp) u16 sport = sockp->inet_sport; u16 dport = skp->__sk_common.skc_dport; #ifdef CONFIG_NET_NS @@ -492,7 +502,7 @@ index 8f272eb..021803a 100755 #endif ##FILTER_NETNS## -@@ -143,7 +143,7 @@ static int read_ipv6_tuple(struct ipv6_tuple_t *tuple, struct sock *skp) +@@ -142,7 +142,7 @@ static int read_ipv6_tuple(struct ipv6_tuple_t *tuple, struct sock *skp) u16 sport = sockp->inet_sport; u16 dport = skp->__sk_common.skc_dport; #ifdef CONFIG_NET_NS @@ -501,7 +511,7 @@ index 8f272eb..021803a 100755 #endif bpf_probe_read(&saddr, sizeof(saddr), skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); -@@ -361,8 +361,7 @@ int trace_close_entry(struct pt_regs *ctx, struct sock *skp) +@@ -360,8 +360,7 @@ int trace_close_entry(struct pt_regs *ctx, struct sock *skp) // Don't generate close events for connections that were never // established in the first place. if (oldstate == TCP_SYN_SENT || @@ -511,7 +521,7 @@ index 8f272eb..021803a 100755 return 0; u8 ipver = 0; -@@ -433,7 +432,7 @@ int trace_accept_return(struct pt_regs *ctx) +@@ -432,7 +431,7 @@ int trace_accept_return(struct pt_regs *ctx) // Get network namespace id, if kernel supports it #ifdef CONFIG_NET_NS @@ -521,7 +531,7 @@ index 8f272eb..021803a 100755 ##FILTER_NETNS## diff --git a/tools/xfsdist.py b/tools/xfsdist.py -index 1a7fdd9..8f2ab46 100755 +index f409f90d..2976f9e2 100755 --- a/tools/xfsdist.py +++ b/tools/xfsdist.py @@ -137,12 +137,12 @@ bpf_text = bpf_text.replace('FACTOR', str(factor)) @@ -542,10 +552,10 @@ index 1a7fdd9..8f2ab46 100755 b.attach_kretprobe(event="xfs_file_fsync", fn_name="trace_fsync_return") diff --git a/tools/xfsslower.py b/tools/xfsslower.py -index 5b4e0a2..0dd75b6 100755 +index 9fa12566..0ef50f6e 100755 --- a/tools/xfsslower.py +++ b/tools/xfsslower.py -@@ -60,6 +60,7 @@ debug = 0 +@@ -59,6 +59,7 @@ debug = 0 bpf_text = """ #include #include @@ -553,7 +563,7 @@ index 5b4e0a2..0dd75b6 100755 #include #include -@@ -94,7 +95,7 @@ BPF_PERF_OUTPUT(events); +@@ -93,7 +94,7 @@ BPF_PERF_OUTPUT(events); // Store timestamp and size on entry // @@ -562,7 +572,7 @@ index 5b4e0a2..0dd75b6 100755 int trace_rw_entry(struct pt_regs *ctx, struct kiocb *iocb) { u64 id = bpf_get_current_pid_tgid(); -@@ -280,12 +281,12 @@ TASK_COMM_LEN = 16 # linux/sched.h +@@ -264,12 +265,12 @@ int trace_fsync_return(struct pt_regs *ctx) b = BPF(text=bpf_text) # common file functions diff --git a/SOURCES/bcc-0.10.0-tools-fix-vfscount-output-when-no-duration-is-specif.patch b/SOURCES/bcc-0.10.0-tools-fix-vfscount-output-when-no-duration-is-specif.patch new file mode 100644 index 0000000..84be464 --- /dev/null +++ b/SOURCES/bcc-0.10.0-tools-fix-vfscount-output-when-no-duration-is-specif.patch @@ -0,0 +1,62 @@ +From 0206fc4e3568eab6cacfc1d5916258a9ba764f5d Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Mon, 5 Aug 2019 15:29:22 +0200 +Subject: [PATCH] tools: fix vfscount output when no duration is specified + +Since commit a2e71a9eb71a ("vfscount.py: add args time (#2344)"), +vfscount does not show any output when it is interrupted by a key +press, which is the only way out when no time limit is specified. I +assume the exit() that has been added in the keyboard interrupt +handler is there so that no output is displayed when the program has +been interrupted early when a time limit has been specified. But since +the tool still invite the user to use Ctrl-C to end the tracing in +that case, it seems more consistent to show an output in that case +too. + +This patch removes the exit() and the tools always show a result at +the end. It also adds the duration argument to the synopsis and the +option section in the man page. +--- + man/man8/vfscount.8 | 6 +++++- + tools/vfscount.py | 1 - + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/man/man8/vfscount.8 b/man/man8/vfscount.8 +index fbf0e89e..febbc9e6 100644 +--- a/man/man8/vfscount.8 ++++ b/man/man8/vfscount.8 +@@ -2,7 +2,7 @@ + .SH NAME + vfscount \- Count VFS calls ("vfs_*"). Uses Linux eBPF/bcc. + .SH SYNOPSIS +-.B vfscount ++.B vfscount [duration] + .SH DESCRIPTION + This counts VFS calls. This can be useful for general workload + characterization of these operations. +@@ -14,6 +14,10 @@ Edit the script to customize which functions to trace. + Since this uses BPF, only the root user can use this tool. + .SH REQUIREMENTS + CONFIG_BPF and bcc. ++.SH OPTIONS ++.TP ++duration ++duration of the trace in seconds. + .SH EXAMPLES + .TP + Count some VFS calls until Ctrl-C is hit: +diff --git a/tools/vfscount.py b/tools/vfscount.py +index b7c18efd..303d3fde 100755 +--- a/tools/vfscount.py ++++ b/tools/vfscount.py +@@ -54,7 +54,6 @@ print("Tracing... Ctrl-C to end.") + sleep(interval) + except KeyboardInterrupt: + pass +- exit() + + print("\n%-16s %-26s %8s" % ("ADDR", "FUNC", "COUNT")) + counts = b.get_table("counts") +-- +2.20.1 + diff --git a/SPECS/bcc.spec b/SPECS/bcc.spec index 0e43fbb..b7aa384 100644 --- a/SPECS/bcc.spec +++ b/SPECS/bcc.spec @@ -10,16 +10,24 @@ %endif Name: bcc -Version: 0.8.0 +Version: 0.10.0 Release: 1%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc -Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +# Generate source tarball until upstream bug is fixed +# See https://github.com/iovisor/bcc/issues/2261 +# To generate the tarball, use the following commands +# git clone -b "v0.10.0" --single-branch --depth 1 url bcc-0.10.0 +# pushd bcc-0.10.0 +# git submodule update --init +# popd +# tar zcvf bcc-0.10.0.tar.gz bcc-0.10.0/ +#Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Source0: %{name}-%{version}.tar.gz Patch0: link-against-libLLVM.so-instead-of-static-libs.patch Patch1: Fix-tools-for-RHEL-7.patch -# tests/cc doesn't compile on s390x, so disable it until we have a better fix -Patch10: Disable-tests-cc.patch +Patch2: %{name}-%{version}-tools-fix-vfscount-output-when-no-duration-is-specif.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -93,13 +101,7 @@ Requires: kernel-devel Command line tools for BPF Compiler Collection (BCC) %prep -%setup -%patch0 -p1 -%patch1 -p1 - -%ifarch s390x -%patch10 -p1 -%endif +%autosetup -p1 %build %cmake . \ @@ -141,11 +143,11 @@ mv %{buildroot}%{_datadir}/%{name}/examples %{buildroot}%{_docdir}/%{name}/ %doc README.md %license LICENSE.txt %{_libdir}/lib%{name}.so.* -%{_libdir}/libbpf.so.* +%{_libdir}/libbcc_bpf.so.* %files devel %{_libdir}/lib%{name}.so -%{_libdir}/libbpf.so +%{_libdir}/libbcc_bpf.so %{_libdir}/pkgconfig/lib%{name}.pc %{_includedir}/%{name}/ @@ -165,8 +167,20 @@ mv %{buildroot}%{_datadir}/%{name}/examples %{buildroot}%{_docdir}/%{name}/ %exclude %{_datadir}/%{name}/tools/old/ # inject relies on BPF_KPROBE_OVERRIDE which is absent on RHEL 7 %exclude %{_datadir}/%{name}/tools/inject +%exclude %{_datadir}/%{name}/tools/doc/inject_example.txt +%exclude %{_mandir}/man8/inject.8 # ZFS isn't available on RHEL %exclude %{_datadir}/%{name}/tools/zfs* +%exclude %{_datadir}/%{name}/tools/doc/zfs* +%exclude %{_mandir}/man8/zfs* +# criticalstat relies on CONFIG_PREEMPTIRQ_EVENTS which is absent on RHEL 7 +%exclude %{_datadir}/%{name}/tools/criticalstat +%exclude %{_datadir}/%{name}/tools/doc/criticalstat_example.txt +%exclude %{_mandir}/man8/criticalstat.8 +# tcpstates relies on sock:inet_sock_set_state which is absent on RHEL 7 +%exclude %{_datadir}/%{name}/tools/tcpstates +%exclude %{_datadir}/%{name}/tools/doc/tcpstates_example.txt +%exclude %{_mandir}/man8/tcpstates.8 %{_mandir}/man8/* %if %{with lua} @@ -176,6 +190,11 @@ mv %{buildroot}%{_datadir}/%{name}/examples %{buildroot}%{_docdir}/%{name}/ %changelog +* Tue Aug 06 2019 Jerome Marchand - 0.10.0-1 +- Rebase on bcc-0.10.0 +- Fix regression of vfscount +- Drop tools that relies on features unavailable on RHEL 7 + * Mon Jan 28 2019 Jerome Marchand - 0.8.0-1 - Rebase on bcc-8.0.0 - Update libLLVM.so name for 7.0