- 08 Nov, 2018 2 commits
-
-
Sandipan Das authored
This fixes the subtest that checks if bcc-lua depends on libluajit. Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
-
Teng Qin authored
Fix symbol resolution across mount namespaces (#2029)
-
- 05 Nov, 2018 2 commits
-
-
Sandipan Das authored
This updates the python and lua bindings for libbcc to be able to support attaching kprobes at custom offsets. Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
-
Xiaozhou Liu authored
docs: fix kernel versions for a few newly added helpers.
-
- 03 Nov, 2018 1 commit
-
-
Vijay Nag authored
-
- 02 Nov, 2018 1 commit
-
-
Ildar Musin authored
Fix parsing of /proc/pid/maps
-
- 01 Nov, 2018 2 commits
-
-
Jerome Marchand authored
* Coverity #def53: COPY_PASTE_ERROR * Coverity #def18: DC.STREAM_BUFFER. Double-check max length of dev * Coverity #def44: MISSING_BREAK. This looks like it should be here * Coverity #def67: STRING_NULL: potential OOB read if 0 bytes read. * Coverity #def66: FORWARD_NULL: potential null ptr deref * Coverity #def17: RESOURCE_LEAK: missing free() * Dont free the result of dirname dirname() may return pointers to statically allocated memory. Don't free the pointer it returns.
-
Ildar Musin authored
Fix USDT semaphore address calculation for position independent executables (resolves #1998) (#2023) Fix USDT semaphore address calculation for position independent executables
-
- 30 Oct, 2018 3 commits
-
-
yonghong-song authored
Fix issue #2017. For python programs, the map data passed from C++ library is parsed through the key/value desc types which are generated by C++ json map declaration visitor. The map declaration visitor visits the map key/value declaration types and generate a string to represent the type, which is later used by python to reconstruct the cttype. The map declaration already tries to add all the padding to the type string in order to make sure C++ and python see the same layout. This patch further added packed support such that if C++ json map visitor has applied padding, the python type reconstructor is free to add _pack_=1 for structure type since the structure is already packed. For example, for a type, struct t { char a; int b; } the structure after json visitor will look like struct t { char a; char __pad[3]; int b; } If the type is struct t { char a; int b; } __packed; the structure after json visitor will look like struct t { char a; int b; } In either case, it will be okay to add __packed attribute for the type generated by json map visitor in order to match the original declaration. Thanks Chaitanya for filing the issue and providing the test case! Signed-off-by: Yonghong Song <yhs@fb.com>
-
yonghong-song authored
frontends: disable uint128_t on 32-bit builds
-
Aleksa Sarai authored
On 32-bit, __uint128_t is generally not available. Removing it fixes builds on those systems. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
-
- 29 Oct, 2018 2 commits
-
-
yonghong-song authored
correct certain tracepoint types in tp frontend action
-
Yonghong Song authored
This is a correction for previous patch where function pointer is not proper specified static int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) = (void *) BPF_FUNC_map_push_elem; and some old gcc compiler (e.g., ubuntu 16.04) will complain with error: Illegal initializer (only variables can be initialized) The correct way is static int (*bpf_map_push_elem)(struct bpf_map *map, const void *value, u64 flags) = (void *) BPF_FUNC_map_push_elem; Signed-off-by: Yonghong Song <yhs@fb.com>
-
- 28 Oct, 2018 3 commits
-
-
Yonghong Song authored
Fix issue #2010. Alastair reported some missing cases in tp frontend action where certain types are not adjusted. For example, for tracepoint syscalls:sys_enter_kill, the kernel format: ... field:int __syscall_nr; offset:8; size:4; signed:1; field:pid_t pid; offset:16; size:8; signed:0; field:int sig; offset:24; size:8; signed:0; The size for "pid_t pid" is 8 bytes, but the kernel pid_t is "int", so it is needed to change its type to "s64" to be consistent to its size. This patch also added conversion for gid_t and uid_t as Alastair discovered that they are also used in some tracepoints with size 8. For type gid_t and uid_t, the corresponding kernel type is "unsigned int", so it should be converted to "u64". Signed-off-by: Yonghong Song <yhs@fb.com>
-
4ast authored
sync with latest net-next
-
Yonghong Song authored
Sync bpf uapi header bpf.h with latest net-next and update related documentation. Signed-off-by: Yonghong Song <yhs@fb.com>
-
- 15 Oct, 2018 2 commits
-
-
4ast authored
fix bcc build failure with latest llvm/clang trunk
-
Yonghong Song authored
The clang commit commit 247be3e41c41201641af01888ff0d84484c4e0f4 Author: Simon Pilgrim <llvm-dev@redking.me.uk> Date: Fri Oct 12 19:14:43 2018 +0000 Fix a clang::driver::ArgStringList usage I missed in rL344398. NFCI. removed using ArgStringList = llvm::opt::ArgStringList; in clang:include/clang/Driver/Job.h, and makes bcc compilation failure. Using llvm::opt::ArgStringList fixed the issue and should still work with previous llvm versions. Signed-off-by: Yonghong Song <yhs@fb.com>
-
- 12 Oct, 2018 1 commit
-
-
jeromemarchand authored
* tools: the argument of get_kprobe_functions() should be a bytes object It fixes the following error: Traceback (most recent call last): File "/usr/share/bcc/tools/ext4dist", line 189, in <module> if BPF.get_kprobe_functions('ext4_file_read_iter'): File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 519, in get_kprobe_functions if (t.lower() in [b't', b'w']) and re.match(event_re, fn) \ File "/usr/lib64/python3.6/re.py", line 172, in match return _compile(pattern, flags).match(string) TypeError: cannot use a string pattern on a bytes-like object * tools: fix freeze in offwaketime Since commit 47cecb65, the sigint signal is ignored unconditionally which prevents offwaketime to be stopped by pressing Ctrl-C when run without a specified duration.
-
- 11 Oct, 2018 1 commit
-
-
yonghong-song authored
Fix issue #2002 Signed-off-by: Yonghong Song <yhs@fb.com>
-
- 10 Oct, 2018 2 commits
-
-
yonghong-song authored
Sync compat bpf.h and virtual_bpf.h with latest net-next versions Also add a barrier for the test_brb bpf program like below meta.prog_id = skb->cb[0]; + asm volatile("" ::: "memory"); meta.rx_port_id = skb->cb[1]; so two cb read does not become a 8 byte load which is not allowed for ubuntu 16.04 kernel (4.4 based). The 8 byte load is allowed for skb->cb's for later kernels. Signed-off-by: Yonghong Song <yhs@fb.com>
-
Marko Myllynen authored
* Add perl* utools man page links Matches other languages, related to commit 9162be45. * uthreads: explicitly list C as supported uthreads supports C (pthreads) thread tracing, make this explicit. Earlier use of -l java and -l none unchanged. Add the corresponding man page and usage examples. * Add Tcl support for ucalls / uflow / uobjnew / ustat For some reason we need to use proc__args instead of proc__entry in uflow.py to get similar results as with e.g. Python.
-
- 09 Oct, 2018 3 commits
-
-
jeromemarchand authored
* tools: uses 'replace' error handler by default in decode() Tools might encouter characters from non utf-8 charset (e.g. a file name). When this happen, it's better to replace the unexpected character by a question mark than crash the tool when all we do is to print the string. * tools: fix a bytes/string issue in attach_perf_event()
-
Ildar Musin authored
Fixed Context::enable_probe method so that it does not discard the result of Probe::enable.
-
Alban Crequy authored
add bpf function call support link in docs. Signed-off-by: Alban Crequy <alban@kinvolk.io>
-
- 07 Oct, 2018 1 commit
-
-
Alastair Robertson authored
kbuild_helper.h: Add required #include ftw.h
-
- 05 Oct, 2018 3 commits
-
-
Teng Qin authored
uflow: convert bytes to str
-
Marko Myllynen authored
-
Marko Myllynen authored
Python 3 fix, similar to commit 99d14683 and commit 4e4c9e01 for ucalls. Closes #1996.
-
- 04 Oct, 2018 1 commit
-
-
Markus Rudy authored
-
- 03 Oct, 2018 1 commit
-
-
Marek Vavruša authored
* lua: eliding repetitive NULL checks, fixes for read types, luacheck This fixes verifier failures in some kernel versions that track whether a possible NULL pointer has been check (and shouldn't be checked twice). It also fixes accessing memory from maps with composite keys. It fixes a case when temporary variable is used in condition, and the body of the condition contains just an assignment from immediate value to a variable that existed before the condition, e.g.: ``` local x = 1 -- Assign constant to 'x', it will be materialized here if skb.len > 0 then -- New BB, not possible to fold as condition isn't const x = 2 -- Assign constant, it failed to materialize here end -- End of BB -- Value of x is always 1 ``` The `bpf.socket()` support ljsyscall socket as first parameter, and fixes compatibility with newer ljsyscall (type name has changed). * reverse BPF_LD ntohl() semantics for <= 32bit loads as well The loads using traditional instructions always do ntohl(): https://www.kernel.org/doc/Documentation/networking/filter.txt They are however needed to support reads not using `skb`, e.g. NET_OFF * proto: add builtins for traversing IPv6 header and extension headers The IPv6 header is fixed size (40B), but it may contain either extension header, or transport protocol after it, so the caller must check the `next_header` field before traversing to determine which dissector to use to traverse it, e.g.: ``` if ip6.next_header == 44 then ip6 = ip6.ip6_opt -- Skip fragment header end if ip6.next_header == c.ip.proto_tcp then local tcp = ip6.tcp -- Finally, TCP end ``` * reverse ntohl() for indirect BPF_LD as well * lua: started codegen tests, direct skb support, bugfixes This starts adding compiler correctness tests for basic expressions, variable source tracking, and control flow. Added: * direct skb->data access (in addition to BPF_LDABS, BPF_LDIND) * loads and stores from skb->data and map value backed memory * unified variable source tracking (ptr_to_ctx, ptr_to_map[_or_null], ptr_to_skb, ptr_to_pkt, ptr_to_stack) * BPF constants introduced between 4.10-4.15 * bpf.dump_string() to dump generated assembly (text) to string Fixes: * pointer nil check tracking * dissectors for map value backed memory * ljsyscall extensions when the version is too old * KPRI nil variables used in conditions * wrongly elided constant materialization on condition-less jumps * loads/stores from stack memory using variable offset * lua: track inverse null guards (if x ~= nil) The verifier prohibits pointer comparisons except the first NULL check, so both forms must be tracked, otherwise it will check for NULL twice and verifier will reject it. * lua: support cdata and constants larger than i32, fix shadowed variables This adds support for numeric cdata constants (either in program, or retrieved with GGET/UGET). Values larger than i32 are coerced into i64. This also fixes shadowing of variables, and fixes materialization of result of variable copy at the end of basic block.
-
- 01 Oct, 2018 1 commit
-
-
Bora M. Alper authored
Update INSTALL.md to include Ubuntu Bionic (18.04)
-
- 28 Sep, 2018 1 commit
-
-
Mauricio Vásquez authored
Currently tables can be created in two modes: 1. private to the ebpf program 2. shared among all the ebpf programs created by the same user-space process This commit extends bcc allowing to create a table that is shared among a set of specific ebpf programs. This is useful when creating network functions that are composed by more than 1 ebpf program, a map is shared among all the programs of the network function but isolated from different instances of that function. Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
-
- 27 Sep, 2018 1 commit
-
-
Mauricio Vásquez authored
After https://github.com/iovisor/bcc/pull/1826 version.py is generated by cmake in order to have the __version__ define in the module. The previous approach of installing the python module created a link between the src and the "build" folder, hence the version.py was actually created in the scr folder, this caused some git noise. This comit solves that problem by copying files instead of creating a link, then the version.py file is only created in the "build" dir. Signed-off-by: Mauricio Vasquez B <mauriciovasquezbernal@gmail.com>
-
- 26 Sep, 2018 1 commit
-
-
Marko Myllynen authored
Use argparse in cachestat, add --ebpf support. Add --ebpf support for u* tools, finalize language sorting. Remove sole --ebpf string on usage line in tcpsubnet.
-
- 25 Sep, 2018 1 commit
-
-
Teng Qin authored
Add #include to libbpf.h for base types.
-
- 21 Sep, 2018 4 commits
-
-
Michael Bolin authored
-
bolinfest authored
Note this allows us to eliminate the `bpf_ktime_get_ns()` call from `trace_entry()`.
-
Teng Qin authored
prevent array subscript expression if base/index is not rewritable
-
Yonghong Song authored
The following command failed: trace.py -U 'r::_do_fork (retval == -11) "%llu", ((struct task_struct *)bpf_get_current_task())->signal->rlim[RLIMIT_NPROC].rlim_cur' as rewriter generates code like __data.v0 = (unsigned long long)((struct task_struct *)bpf_get_current_task())->signal->rlim[RLIMIT_NPROC))); _val; }).rlim_cur; Let us prevent rewriting if either base or index is not rewritable and this fixed the issue. Signed-off-by: Yonghong Song <yhs@fb.com>
-