4ast [Fri, 13 May 2016 00:26:02 +0000 (17:26 -0700)]
Merge pull request #539 from markdrayton/lua-tools
Lua ports of biosnoop and stacksnoop
Mark Drayton [Wed, 20 Apr 2016 21:11:00 +0000 (14:11 -0700)]
Lua ports of biosnoop and stacksnoop
Brenden Blanco [Thu, 12 May 2016 16:06:21 +0000 (09:06 -0700)]
Merge pull request #541 from zaafar/master
updated cmake system to include lua and new networking example
Zaafar Ahmed [Wed, 11 May 2016 22:38:35 +0000 (03:38 +0500)]
Updated the cmake file system to include lua and new networking tools.
4ast [Wed, 11 May 2016 20:58:14 +0000 (13:58 -0700)]
Merge pull request #536 from valkum/master
Add new example with test case for for unroll, as requested.
Brenden Blanco [Wed, 11 May 2016 20:48:54 +0000 (13:48 -0700)]
Merge pull request #538 from iovisor/luajit_header_revert
Revert "Force lua main.c to include luajit headers"
Brenden Blanco [Wed, 11 May 2016 19:57:16 +0000 (12:57 -0700)]
Revert "Force lua main.c to include luajit headers"
This reverts commit
c21b9c036cba26e2927fbb5e46985faa73ef743e.
Instead, use `LUAJIT_DIR=/usr/include/luajit-2.0 cmake ..` or similar as
required.
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
Valkum [Wed, 11 May 2016 18:34:30 +0000 (20:34 +0200)]
Missed this one by extracting this from my actual program.
Valkum [Wed, 11 May 2016 12:47:35 +0000 (14:47 +0200)]
Add dns_matching example with test case for for unroll, as requested at iovisor-dev@lists.iovisor.org
Brenden Blanco [Fri, 6 May 2016 18:29:41 +0000 (11:29 -0700)]
Merge pull request #531 from kivikakk/lua-install-docs
Lua installation instructions.
Nicole Izumi [Fri, 6 May 2016 18:19:14 +0000 (11:19 -0700)]
Lua installation instructions.
Brenden Blanco [Fri, 6 May 2016 14:09:18 +0000 (07:09 -0700)]
Merge pull request #518 from vmg/vmg/lua-usdt-2
[RFC] New USDT API
Vicent Marti [Fri, 6 May 2016 08:51:54 +0000 (10:51 +0200)]
cc: Use `unique_ptr` instead of `shared_ptr`
Vicent Marti [Wed, 4 May 2016 14:59:57 +0000 (16:59 +0200)]
cc: Style fixes
Vicent Marti [Wed, 4 May 2016 14:58:51 +0000 (16:58 +0200)]
cc: Better memory handling for USDT probes
Vicent Marti [Wed, 4 May 2016 11:01:55 +0000 (13:01 +0200)]
usdt: Implement `bpf_usdt_readarg` as frontend action
Vicent Marti [Sun, 1 May 2016 11:41:33 +0000 (13:41 +0200)]
cc: Style fixes
Vicent Marti [Sun, 1 May 2016 11:40:43 +0000 (13:40 +0200)]
lua: Fix tests
Vicent Marti [Sun, 1 May 2016 10:54:51 +0000 (12:54 +0200)]
lua: Implement "Hello world" USDT example
Vicent Marti [Sun, 1 May 2016 10:54:25 +0000 (12:54 +0200)]
lua: Implement an USDT helper
Vicent Marti [Sun, 1 May 2016 10:53:46 +0000 (12:53 +0200)]
cc: Wrap the USDT probe context in a C API
Vicent Marti [Sun, 1 May 2016 10:52:46 +0000 (12:52 +0200)]
cc: Implement `bcc_resolve_global_addr` helper
4ast [Thu, 5 May 2016 20:44:13 +0000 (13:44 -0700)]
Merge pull request #530 from iovisor/bblanco_dev
Add check for number of arguments
Brenden Blanco [Thu, 5 May 2016 19:05:07 +0000 (12:05 -0700)]
Fixup tplist and argdist for python3 compat
sys.exc_value and sys.exc_type should come from sys.exc_info()
Convert (decode) char* return values from C functions to a native python
str.
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
Brenden Blanco [Thu, 5 May 2016 18:37:59 +0000 (11:37 -0700)]
Add check for number of arguments
There are two problems here:
1. bcc is leaving the extra function parameters in the prototype, when
these really just serve as an annotation on the method being traced.
They aren't really passed into the function. LLVM lowering phase later
errors out on such functions.
2. bcc doesn't limit the size of the argument list, when currently it
just supports up to the number of arguments held in registers (6).
Fix 1. by rewriting the arguments out of the prototype and into the
preamble where they are currently being initialized.
Fix 2. by enforcing the limit and returning a more meaningful error
message.
Added a test case.
Extra fix included for string type on python3.
Fixes: #497
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
Brenden Blanco [Thu, 5 May 2016 15:36:22 +0000 (08:36 -0700)]
Merge pull request #529 from rnav/ptregs_helpers_v2
Introduce helpers to access pt_regs in an arch-independent manner
Naveen N. Rao [Tue, 3 May 2016 09:24:21 +0000 (14:54 +0530)]
cc: introduce helpers to access pt_regs in an arch-independent manner
Convert some of the examples and tools to use the new helpers.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Brenden Blanco [Thu, 5 May 2016 06:20:37 +0000 (23:20 -0700)]
Merge pull request #528 from iovisor/bblanco_dev
fix llvm 3.9 build
Brenden Blanco [Thu, 5 May 2016 06:13:01 +0000 (23:13 -0700)]
fix llvm 3.9 build
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
4ast [Thu, 5 May 2016 00:19:49 +0000 (17:19 -0700)]
Merge pull request #524 from iovisor/luajit_header
Force lua main.c to include luajit headers
Brenden Blanco [Wed, 4 May 2016 06:49:37 +0000 (23:49 -0700)]
Force lua main.c to include luajit headers
On my system, when both lua and luajit are installed, multiple headers
exist in /usr/include. However, my lua installation is 5.3, which has
some api-breaking changes, which means that the standard lua.h must not
be included.
Simply force lua.h to come from luajit-2.0 directory.
4ast [Tue, 3 May 2016 16:49:57 +0000 (09:49 -0700)]
Merge pull request #523 from iovisor/bblanco_dev
Make style-check test non-blocking
Brenden Blanco [Tue, 3 May 2016 16:39:54 +0000 (09:39 -0700)]
Make style-check test non-blocking
Since the codebase is as of yet inconsistent, disable per-commit style
check enforcement.
This should be turned back on once the codebase style is consistent.
Brendan Gregg [Tue, 3 May 2016 16:18:23 +0000 (09:18 -0700)]
Merge pull request #521 from iovisor/bblanco_dev
Adjust pid filtering/display in runqlat
Brenden Blanco [Tue, 3 May 2016 06:32:44 +0000 (23:32 -0700)]
Adjust pid filtering/display in runqlat
The filtering and display of pids in the runqlat tool was not correct.
Internally, the kernel keeps pid and tgid, which correspond to thread-id
and user process-id, respectively. The runqlat tool was filtering and
displaying pid instead of tgid.
Change -P and -p options to filter by tgid, and add a new option to give
a breakdown by pid (thread-id).
Update the docs with the -L option.
4ast [Mon, 2 May 2016 15:46:58 +0000 (08:46 -0700)]
Merge pull request #519 from iovisor/bblanco_dev
Fixes for clang frontend bugs and misc
Brenden Blanco [Mon, 2 May 2016 15:34:47 +0000 (08:34 -0700)]
Merge branch 'master' into bblanco_dev
4ast [Mon, 2 May 2016 15:34:15 +0000 (08:34 -0700)]
Merge pull request #520 from rnav/powerpc-support-v2
Powerpc support v2
Naveen N. Rao [Fri, 29 Apr 2016 11:16:05 +0000 (16:46 +0530)]
tests: fix a few tests to use the right register on powerpc
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Naveen N. Rao [Fri, 29 Apr 2016 11:14:41 +0000 (16:44 +0530)]
tests: only test arch-specific symbols
__per_cpu_start has a different address on each architecture. Instead,
use a arch-unique symbol for the test.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Naveen N. Rao [Fri, 29 Apr 2016 11:12:58 +0000 (16:42 +0530)]
cc: add powerpc support
Basic support for building on powerpc. Tested on ppc64le.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Brenden Blanco [Mon, 2 May 2016 05:42:04 +0000 (22:42 -0700)]
Fix errors on python3
Brenden Blanco [Mon, 2 May 2016 04:31:16 +0000 (21:31 -0700)]
Use local key/leaf definition instead of bpf_tunnel_key
Even after fixing the nested union issue in the preceding commits, this
example was failing. The reason was that the kernel was filling in all
bits of the bpf_tunnel_key, which in recent kernels includes non-zero
fields such as ttl. That non-zero field would break the lookup in the
tunkey2if table, which was populated assuming all extra bytes would be
zero.
Fix it by defining a simpler key structure, and copy the required fields
out from the local variable.
Fixes: #510
Brenden Blanco [Mon, 2 May 2016 04:29:08 +0000 (21:29 -0700)]
Add clang support for nested struct/union as key field
Clang was up until now not able to parse nested structs or unions as a
field in the table key or leaf. Add support in the library side, as well
as python support for the exported json description.
Brenden Blanco [Mon, 2 May 2016 04:27:19 +0000 (21:27 -0700)]
Add a test for broken nested union clang parsing
Brenden Blanco [Mon, 2 May 2016 04:26:04 +0000 (21:26 -0700)]
Avoid a warning in bpf_module.cc
The variable inside the if statement was unused, unliked the blocks
above and below it. Use the isa<> check instead.
Brenden Blanco [Mon, 2 May 2016 04:24:29 +0000 (21:24 -0700)]
skip include of kernel bpf.h in test, forward declare instead
4ast [Sat, 30 Apr 2016 23:04:00 +0000 (16:04 -0700)]
Merge pull request #517 from vmg/vmg/clang-diag
cc/clang: Use positional arguments for diagnostic messages
4ast [Sat, 30 Apr 2016 15:11:31 +0000 (08:11 -0700)]
Merge pull request #515 from vmg/vmg/static-lua
Lua tooling improvements
Vicent Marti [Sat, 30 Apr 2016 12:57:52 +0000 (14:57 +0200)]
cc/clang: Use positional arguments for diagnostic messages
Vicent Marti [Sat, 30 Apr 2016 12:35:47 +0000 (14:35 +0200)]
lua: Proper style for main.c
Vicent Marti [Sat, 30 Apr 2016 12:13:26 +0000 (14:13 +0200)]
lua: Do not try to detach buffers as kprobes
Vicent Marti [Sat, 30 Apr 2016 12:00:11 +0000 (14:00 +0200)]
table.py: Call `__delitem__ when deleting an item :)
Vicent Marti [Sat, 30 Apr 2016 11:50:48 +0000 (13:50 +0200)]
lua: Fix regeneration of `bcc.lua`
Vicent Marti [Sat, 30 Apr 2016 11:37:09 +0000 (13:37 +0200)]
bcc-lua: Build as a C executable
Vicent Marti [Sat, 30 Apr 2016 11:22:42 +0000 (13:22 +0200)]
lua: Make all probes executable
Vicent Marti [Sat, 30 Apr 2016 11:14:28 +0000 (13:14 +0200)]
lua: build as a standalone tool with static libbcc
Brendan Gregg [Fri, 29 Apr 2016 17:57:45 +0000 (10:57 -0700)]
Merge pull request #514 from mcaleavya/master
updated opensnoop to use bpf_perf_output
mcaleavya [Fri, 29 Apr 2016 12:38:51 +0000 (13:38 +0100)]
updated opensnoop to use bpf_perf_output
4ast [Thu, 28 Apr 2016 21:14:41 +0000 (14:14 -0700)]
Merge pull request #498 from vmg/vmg/usdt
[WIP] Native implementation for USDT probes
Vicent Marti [Thu, 28 Apr 2016 17:42:55 +0000 (19:42 +0200)]
cc: Finish USDT implementation
Vicent Marti [Thu, 28 Apr 2016 10:24:05 +0000 (12:24 +0200)]
cc: Implement symbol resolution for USDT
Vicent Marti [Thu, 28 Apr 2016 10:22:22 +0000 (12:22 +0200)]
cc: Split bcc_syms.cc into a C++ header file
Vicent Marti [Thu, 28 Apr 2016 10:20:57 +0000 (12:20 +0200)]
cc: Allow callback cancellation on bcc_procutils
Vicent Marti [Thu, 28 Apr 2016 10:19:30 +0000 (12:19 +0200)]
cc: Add missing include
Vicent Marti [Wed, 27 Apr 2016 14:57:58 +0000 (16:57 +0200)]
usdt: Implement probe resolution [WIP]
Vicent Marti [Wed, 27 Apr 2016 10:36:26 +0000 (12:36 +0200)]
usdt: Implement `assign_to_local`
Vicent Marti [Wed, 27 Apr 2016 09:45:10 +0000 (11:45 +0200)]
Add missing license headers
Vicent Marti [Wed, 27 Apr 2016 09:41:54 +0000 (11:41 +0200)]
usdt: Use `optional` to properly handle missing args
Brenden Blanco [Sun, 24 Apr 2016 03:02:45 +0000 (20:02 -0700)]
Move implementation of USDT::Argument into cc file
To avoid exposing the implementation of new/delete of the Argument
class, move it out of the header file. This also requires making private
the std::string members, so that they cannot be assigned to directly.
Let the ArgumentParser assign to them as a friend, and expose const
functions to access them as const only from the client.
Also, convert non-const reference usages to pass-by-pointer.
Vicent Marti [Wed, 20 Apr 2016 23:19:48 +0000 (01:19 +0200)]
cc: Implement USDT argument parsing in C++
Vicent Marti [Wed, 20 Apr 2016 23:18:40 +0000 (01:18 +0200)]
tests: Port the C API suite to C++/Catch
Brenden Blanco [Thu, 28 Apr 2016 13:30:56 +0000 (06:30 -0700)]
Merge pull request #511 from vmg/vmg/find-library
bpf: Wrap `bcc_procutils_which_so` as `BPF.find_library`
Vicent Marti [Thu, 28 Apr 2016 08:26:26 +0000 (10:26 +0200)]
bpf: Wrap `bcc_procutils_which_so` as `BPF.find_library`
This class method was being used outside of the BPF class in the
`tracer` and `usdt` tools.
Brenden Blanco [Wed, 27 Apr 2016 03:26:54 +0000 (20:26 -0700)]
Merge pull request #507 from vmg/vmg/elf-so
Explicitly list the libelf runtime dependency
Vicent Marti [Tue, 26 Apr 2016 14:34:11 +0000 (16:34 +0200)]
packaging: Add `libelf.so` as a runtime dependency
Vicent Marti [Tue, 26 Apr 2016 14:33:55 +0000 (16:33 +0200)]
lua: Only build if LuaJIT is available
4ast [Sat, 23 Apr 2016 15:51:08 +0000 (08:51 -0700)]
Merge pull request #502 from sublimino/patch-1
Add libelf-dev to Ubuntu build deps
Andrew Martin [Sat, 23 Apr 2016 14:10:55 +0000 (15:10 +0100)]
Add libelf-dev to Ubuntu build deps
This was required on a Debian system, but in lieu of instructions for that distribution, and as Debian users will follow Ubuntu, would you consider verifying it on Ubuntu and accepting this PR?
4ast [Wed, 20 Apr 2016 15:11:10 +0000 (08:11 -0700)]
Merge pull request #495 from vmg/vmg/elf-2
[RFC] Remove all dependencies on external binaries
Vicent Marti [Wed, 20 Apr 2016 11:37:55 +0000 (13:37 +0200)]
cc: Clang format
Vicent Marti [Wed, 20 Apr 2016 11:24:55 +0000 (13:24 +0200)]
cc: Add tests for the C API
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Looser heuristic to detect .so modules
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Only try to list ksyms if we're root
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Move `bcc_resolve_symname` to its proper header
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Add missing license headers
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Format C and C++ code according to Google's styleguide
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
deps: Add `libelf` to the build requirements
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
python: Use the native Symbol resolution APIs
The native resolvers are used for the Kernel Symbol resolution in the
`BPF` class, and for the ProcessSymbols class. A lot of redundant code
has been removed.
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
python: Wrap the new native symbol APIs
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
lua: Remove unused files
The `sym` module no longer needs to be exported. The `LD` module is no
longer used anywhere.
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
lua: Use the new native Symbol resolver
The static `BPF.SymbolCache` now uses a native symbol resolver instead
of the Lua/binutils implementation. Likewise for the kernel symbol
resolver, and the `check_path_symbol` API to find a probe's hook
address.
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
lua: Wrap the new native APIs
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Add a native Symbol Resolver cache
This new set of C/C++ APIs is capable of performing symbol resolution
for any given running process, using the native `libelf` APIs instead of
shelling out to binutils tools.
This is a reimplementation of the original ProcSyms Python/Lua code.
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Add a set of process utils written in C/C++
These APIs mimic behavior that was being performed using native tools.
- bcc_procutils_which_so: resolves a short library name into a full path
so a shared object. Equivalent to `ldconfig -p`
- bcc_procutils_which: resolves a short name into a full path to a
binary. Equivalent to a shell's builtin `which`
- bcc_procutils_each_module: lists all the modules loaded in a process'
memory space. Uses the kernel's `/proc/$pid/maps`
- bcc_procutils_each_ksym: lists all symbols and addresses for the
kernel. Uses the kernel's `/proc/kallsyms`
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cc: Add a set of ELF-related APIs based on libelf
The following APIs have been implemented inside `libbcc`, which
programatically replicate the previous usage of `binutils` tools like
`objdump` and `elfdump`.
- bcc_elf_foreach_usdt: finds all USDT probes inside a given binary
- bcc_elf_loadadddr: find the load address for a shared object
- bcc_elf_foreach_sym: lists all symbols in an ELF binary or SO
- bcc_elf_shared_obj: returns whether a given path is an ELF shared
object, a binary, or neither
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cmake: Add dependency to LibELF
Add a new a `FindLibElf.cmake` package, and use it to link the main
`libbcc` library against the system's LibELF. This library will be used
to re-implement functionality that was previously dependent on
`binutils`.
Vicent Marti [Wed, 20 Apr 2016 11:24:54 +0000 (13:24 +0200)]
cmake: Properly use library detection modules
Instead of importing the `Find*.cmake` modules directly, place them in
the root `cmake/` folder and define it as a CMake Module path. This lets
us use the `find_package` builtin to require any given packages.
4ast [Tue, 19 Apr 2016 21:58:58 +0000 (14:58 -0700)]
Merge pull request #496 from iovisor/bblanco_dev
Add infra and ctest for code style formatting
Brenden Blanco [Tue, 19 Apr 2016 21:14:42 +0000 (14:14 -0700)]
Add clang-format file, tweak style-check.sh
Add an initial .clang-format file, based on LLVM's style base. Inform
the style-check wrapper to only consider h, c, and cc files when it
runs, and print out the --verbose output upon failure.