platform/upstream/bcc.git
8 years agofix pep8 lint errors in biolatency and biosnoop
Alexei Starovoitov [Sat, 9 Jan 2016 20:06:40 +0000 (12:06 -0800)]
fix pep8 lint errors in biolatency and biosnoop

Signed-off-by: Alexei Starovoitov <ast@fb.com>
8 years agoMerge pull request #309 from iovisor/sharedmaps
4ast [Fri, 8 Jan 2016 19:28:27 +0000 (11:28 -0800)]
Merge pull request #309 from iovisor/sharedmaps

Add ability to export maps, enables cross-program sharing

8 years agoRename BPF_EXPORT to BPF_TABLE_PUBLIC
Brenden Blanco [Fri, 8 Jan 2016 16:30:13 +0000 (08:30 -0800)]
Rename BPF_EXPORT to BPF_TABLE_PUBLIC

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoAdd ability to export maps, enables cross-program sharing
Brenden Blanco [Wed, 16 Dec 2015 00:39:35 +0000 (16:39 -0800)]
Add ability to export maps, enables cross-program sharing

Allow a program to export a map for other programs to use. This enables
cross-program map sharing.

parent program syntax:
BPF_TABLE("array", int, int, shared, 10);
BPF_TABLE_EXPORT(shared);

child program syntax:
BPF_TABLE("extern", int, int, shared, 10);

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #308 from iovisor/cflags
4ast [Wed, 6 Jan 2016 21:58:26 +0000 (13:58 -0800)]
Merge pull request #308 from iovisor/cflags

Add ability to set custom cflags when loading programs

8 years agoAdd ability to set custom cflags when loading programs
Brenden Blanco [Wed, 6 Jan 2016 16:45:42 +0000 (08:45 -0800)]
Add ability to set custom cflags when loading programs

Example:
b = bcc.BPF("myprog.c", cflags=["-DMYCUSTOMFLAG1", ...])

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #307 from iovisor/kbuild_fix
4ast [Mon, 4 Jan 2016 19:47:08 +0000 (11:47 -0800)]
Merge pull request #307 from iovisor/kbuild_fix

Remove runtime dependency on gcc stdarg headers and make

8 years agoRemove runtime dependency on gcc stdarg headers and make
Brenden Blanco [Mon, 4 Jan 2016 17:54:00 +0000 (09:54 -0800)]
Remove runtime dependency on gcc stdarg headers and make

Remove the runtime dependency on gcc's stdarg.h. Do this by packaging
the (non-GPL) version shipped with clang. This allows the bulk of
kbuild_helper to be removed, at the expense of hardcoding the kernel
include paths. If in the future the kernel make system changes again to
require different -I paths, we'll have to think this through again.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #306 from troyengel/te_dev
Brenden Blanco [Fri, 1 Jan 2016 20:13:11 +0000 (12:13 -0800)]
Merge pull request #306 from troyengel/te_dev

add new Arch packages, new TOC and spiffy up the formatting

8 years agoadd new Arch packages, new TOC and spiffy up the formatting
troyengel [Fri, 1 Jan 2016 19:51:29 +0000 (13:51 -0600)]
add new Arch packages, new TOC and spiffy up the formatting

8 years agoMerge pull request #305 from iovisor/bblanco_dev
Brenden Blanco [Thu, 10 Dec 2015 17:57:27 +0000 (09:57 -0800)]
Merge pull request #305 from iovisor/bblanco_dev

Drop broken p4/docs symlink and create README.md+URL

8 years agoDrop broken p4/docs symlink and create README.md+URL
Brenden Blanco [Thu, 10 Dec 2015 16:00:02 +0000 (08:00 -0800)]
Drop broken p4/docs symlink and create README.md+URL

There was a symlink to a local file, which would instead work better as
a URL to the bpf-docs repository.

Fixes: #304
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #303 from iovisor/bblanco_dev
4ast [Mon, 7 Dec 2015 04:05:53 +0000 (20:05 -0800)]
Merge pull request #303 from iovisor/bblanco_dev

Improve json type support for misc struct/union types

8 years agoImprove json type support for misc struct/union types
Brenden Blanco [Mon, 7 Dec 2015 03:58:38 +0000 (19:58 -0800)]
Improve json type support for misc struct/union types

The ability of the clang rewriter to extract the type information for
some types of structs, unions, and pointers to the aforementioned was
somewhat buggy. This became exposed in a test_clang case after a user
upgraded to a newer kernel, wherein the struct definition changed. The
functionality in question is only used to pass json-ified representation
of the struct to python in order to program the Key/Leaf metaclass.

Improve support for this and other types, including unions.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #302 from iovisor/ast_dev
Brenden Blanco [Thu, 3 Dec 2015 22:11:00 +0000 (14:11 -0800)]
Merge pull request #302 from iovisor/ast_dev

make sure LDFLAGS are propagated as well

8 years agomake sure LDFLAGS are propagated as well
Alexei Starovoitov [Thu, 3 Dec 2015 22:04:16 +0000 (14:04 -0800)]
make sure LDFLAGS are propagated as well

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
8 years agoMerge pull request #301 from iovisor/bblanco_dev
4ast [Thu, 3 Dec 2015 21:00:06 +0000 (13:00 -0800)]
Merge pull request #301 from iovisor/bblanco_dev

Fix breakage from LLVM 3.8 API change

8 years agoFix breakage from LLVM 3.8 API change
Brenden Blanco [Thu, 3 Dec 2015 20:43:52 +0000 (12:43 -0800)]
Fix breakage from LLVM 3.8 API change

There is some difference in how to take a pointer from an iterator. This
code should work for both 3.7 and 3.8 APIs.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #299 from iovisor/bblanco_dev
Brenden Blanco [Tue, 1 Dec 2015 07:08:20 +0000 (23:08 -0800)]
Merge pull request #299 from iovisor/bblanco_dev

p4: fixed bugs in control-flow generation

8 years agoMerge pull request #300 from lcp/build_and_test
Brenden Blanco [Tue, 1 Dec 2015 07:06:49 +0000 (23:06 -0800)]
Merge pull request #300 from lcp/build_and_test

Honor the external C/CXX FLAGS

8 years agoHonor the external C/CXX FLAGS
Gary Lin [Tue, 17 Nov 2015 02:48:39 +0000 (10:48 +0800)]
Honor the external C/CXX FLAGS

Signed-off-by: Gary Lin <glin@suse.com>
8 years agofixed bugs in control-flow generation
Mihai Budiu [Tue, 1 Dec 2015 00:25:00 +0000 (16:25 -0800)]
fixed bugs in control-flow generation

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #298 from iovisor/bblanco_dev
Brenden Blanco [Mon, 30 Nov 2015 19:21:50 +0000 (11:21 -0800)]
Merge pull request #298 from iovisor/bblanco_dev

Automatically bump memlock ulimit

8 years agoAutomatically bump memlock ulimit
Brenden Blanco [Mon, 30 Nov 2015 18:54:47 +0000 (10:54 -0800)]
Automatically bump memlock ulimit

Instead of requiring the user to bump the ulimit in their shell before
starting a bcc script, try to setrlimit automatically when a failure
occurs. Since there is no getrusage for memlock limit, unfortunately we
have to brute force setting the limit. For now, just try bpf() once and
then try to set unlimited ulimit, then try bpf() again.

Fixes: #281
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #297 from iovisor/bblanco_dev
Brenden Blanco [Mon, 30 Nov 2015 07:24:15 +0000 (23:24 -0800)]
Merge pull request #297 from iovisor/bblanco_dev

Fixup dependencies of bcc-tools package

8 years agoFixup dependencies of bcc-tools package
Brenden Blanco [Mon, 30 Nov 2015 01:51:01 +0000 (17:51 -0800)]
Fixup dependencies of bcc-tools package

This should depend on python-bcc, which itself depends on libbcc.

Fixes: #291
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #296 from iovisor/bblanco_dev
Brenden Blanco [Mon, 30 Nov 2015 01:41:36 +0000 (17:41 -0800)]
Merge pull request #296 from iovisor/bblanco_dev

Add bcc-tools package

8 years agoAdd rpm and deb packaging for bcc-tools
Brenden Blanco [Mon, 30 Nov 2015 01:07:52 +0000 (17:07 -0800)]
Add rpm and deb packaging for bcc-tools

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoPackage tools into share/bcc/tools
Brenden Blanco [Thu, 26 Nov 2015 02:22:42 +0000 (18:22 -0800)]
Package tools into share/bcc/tools

Ticket: #291
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #294 from iovisor/bblanco_dev
Brenden Blanco [Wed, 18 Nov 2015 07:56:42 +0000 (23:56 -0800)]
Merge pull request #294 from iovisor/bblanco_dev

Fixup broken symlink tests/cc/simulation.py

8 years agoFixup broken symlink tests/cc/simulation.py
Brenden Blanco [Wed, 18 Nov 2015 07:47:25 +0000 (23:47 -0800)]
Fixup broken symlink tests/cc/simulation.py

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #293 from iovisor/bblanco_dev
Brenden Blanco [Tue, 17 Nov 2015 23:22:55 +0000 (15:22 -0800)]
Merge pull request #293 from iovisor/bblanco_dev

added P4 deparser synthesis

8 years agoadded P4 deparser synthesis
Brenden Blanco [Tue, 17 Nov 2015 19:07:46 +0000 (11:07 -0800)]
added P4 deparser synthesis

9 years agoMerge pull request #292 from iovisor/bblanco_dev
Brenden Blanco [Mon, 16 Nov 2015 08:39:56 +0000 (00:39 -0800)]
Merge pull request #292 from iovisor/bblanco_dev

Updates to INSTALL.md for readability and ease of use

9 years agoMove INSTALL.md to use more block code
Brenden Blanco [Mon, 16 Nov 2015 08:30:17 +0000 (00:30 -0800)]
Move INSTALL.md to use more block code

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoUpdate INSTALL.md instructions for Ubuntu
Brenden Blanco [Mon, 16 Nov 2015 08:22:10 +0000 (00:22 -0800)]
Update INSTALL.md instructions for Ubuntu

A stable 4.3 kernel is available, suggest users use that version
instead.

Move LLVM build instructions to the end, prefer that they pull llvm
binaries instead.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #290 from iovisor/bblanco_dev
Brenden Blanco [Fri, 13 Nov 2015 03:15:55 +0000 (19:15 -0800)]
Merge pull request #290 from iovisor/bblanco_dev

Fix unary operator handling of probe reads with parens

9 years agoFix unary operator handling of probe reads with parens
Brenden Blanco [Thu, 12 Nov 2015 18:17:53 +0000 (10:17 -0800)]
Fix unary operator handling of probe reads with parens

Testing for bpf_probe_read should not include parenethes when walking
the tree, since the inner operation will have already been rewritten.

Fixes: #289
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #288 from SomaLDEN/drzix
Brenden Blanco [Thu, 12 Nov 2015 01:12:55 +0000 (17:12 -0800)]
Merge pull request #288 from SomaLDEN/drzix

Edit README, link path of some example files

9 years agoEdit README, link path of some example files
Dr.Z [Wed, 11 Nov 2015 19:45:21 +0000 (04:45 +0900)]
Edit README, link path of some example files

As some example files were reorganized into subdirecotries, some
pathes in README bring connection on 404. So it have to be new pathes.

9 years agoMerge pull request #286 from troyengel/master
Brenden Blanco [Tue, 10 Nov 2015 06:23:54 +0000 (22:23 -0800)]
Merge pull request #286 from troyengel/master

Fixes #285 - build process assumes git use

9 years agoFixes #287 - build process assumes python cmd
troyengel [Tue, 10 Nov 2015 02:00:22 +0000 (20:00 -0600)]
Fixes #287 - build process assumes python cmd

9 years agoFixes #285 - build process assumes git use
troyengel [Tue, 10 Nov 2015 01:51:32 +0000 (19:51 -0600)]
Fixes #285 - build process assumes git use

9 years agoMerge pull request #284 from iovisor/bblanco_dev
Brenden Blanco [Mon, 9 Nov 2015 05:23:33 +0000 (21:23 -0800)]
Merge pull request #284 from iovisor/bblanco_dev

Add bpf() syscall feature check and readme update

9 years agoAdd bpf() syscall feature check and readme update
Brenden Blanco [Mon, 9 Nov 2015 05:18:51 +0000 (21:18 -0800)]
Add bpf() syscall feature check and readme update

Fixes: #283
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #282 from iovisor/bblanco_dev
yonghong-song [Fri, 6 Nov 2015 23:22:40 +0000 (15:22 -0800)]
Merge pull request #282 from iovisor/bblanco_dev

Add perf_output support for high rate events

9 years agoUpdate trace perf output with struct deserialize example
Brenden Blanco [Fri, 6 Nov 2015 21:55:53 +0000 (13:55 -0800)]
Update trace perf output with struct deserialize example

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoDisable custom perf output support in older kernels
Brenden Blanco [Fri, 6 Nov 2015 21:12:11 +0000 (13:12 -0800)]
Disable custom perf output support in older kernels

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoLet perf_output be always per-cpu
Brenden Blanco [Fri, 6 Nov 2015 21:03:05 +0000 (13:03 -0800)]
Let perf_output be always per-cpu

Incoporating feedback from bgregg:
Make per-cpu nature of output buffer be hidden and implicit. As such,
incoporate some rewriting into the definition of the PERF_OUTPUT.
Create two different macros to distinguish the perf_array (hardware
counters) from the perf_output (ring buffer) use cases.

Also, rename perf_output to perf_submit.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoAdd per-cpu parameters to buffered perf output
Brenden Blanco [Fri, 6 Nov 2015 18:43:05 +0000 (10:43 -0800)]
Add per-cpu parameters to buffered perf output

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoAdd perf_output support for high rate events
Brenden Blanco [Fri, 6 Nov 2015 07:31:22 +0000 (23:31 -0800)]
Add perf_output support for high rate events

This adds support for the bpf_perf_event_output command. This is
intended for per-process events from bpf to userspace at high rate. The
events from the bpf program can be completely customized.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoUpdate compat bpf.h with 4.4 features
Brenden Blanco [Thu, 5 Nov 2015 22:04:56 +0000 (14:04 -0800)]
Update compat bpf.h with 4.4 features

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoChange indentation in bpf/helpers.h
Brenden Blanco [Thu, 5 Nov 2015 21:28:32 +0000 (13:28 -0800)]
Change indentation in bpf/helpers.h

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #280 from iovisor/bblanco_dev
yonghong-song [Wed, 4 Nov 2015 22:00:50 +0000 (14:00 -0800)]
Merge pull request #280 from iovisor/bblanco_dev

Reorganize examples into subdirectories

9 years agoReorganize examples into subdirectories
Brenden Blanco [Thu, 29 Oct 2015 23:58:23 +0000 (08:58 +0900)]
Reorganize examples into subdirectories

Examples directory has been growing, so add a bit of organization.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #279 from iovisor/bblanco_dev
4ast [Sat, 24 Oct 2015 16:05:10 +0000 (09:05 -0700)]
Merge pull request #279 from iovisor/bblanco_dev

Bump ulimit for locked memory in test wrapper

9 years agoBump ulimit for locked memory in test wrapper
Brenden Blanco [Sat, 24 Oct 2015 15:59:53 +0000 (08:59 -0700)]
Bump ulimit for locked memory in test wrapper

This follows from a change in upstream kernel for counting bpf maps
against the locked memory limit.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #278 from SomaLDEN/drzix
Brenden Blanco [Fri, 23 Oct 2015 15:37:55 +0000 (08:37 -0700)]
Merge pull request #278 from SomaLDEN/drzix

Python: fix detach_kprobe()

9 years agoPython: fix detach_kprobe()
Dr.Z [Fri, 23 Oct 2015 09:59:10 +0000 (18:59 +0900)]
Python: fix detach_kprobe()

As open_kprobes contains not fd but pointer to struct perf_reader,
it should call lib.perf_reader_free() instead of os.close()

9 years agoMerge pull request #277 from SomaLDEN/drzix
Brenden Blanco [Wed, 21 Oct 2015 14:30:24 +0000 (07:30 -0700)]
Merge pull request #277 from SomaLDEN/drzix

perf_reader: allow more than one reader to poll

9 years agoperf_reader: allow more than one reader to poll
Dr.Z [Wed, 21 Oct 2015 12:52:10 +0000 (21:52 +0900)]
perf_reader: allow more than one reader to poll

When more than one events are used with attach_kprobe, the
perf_reader_poll() will segfault by buffer overflow like below.

*** buffer overflow detected ***: python terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7fcc971fb38f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fcc97292c9c]
/lib/x86_64-linux-gnu/libc.so.6(+0x109b60)[0x7fcc97291b60]
/lib/x86_64-linux-gnu/libc.so.6(+0x10ac04)[0x7fcc97292c04]
/usr/lib/x86_64-linux-gnu/libbcc.so(perf_reader_poll+0x42)[0x7fcc93969cc2]
/usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c)[0x7fcc95c2badc]
/usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x1fc)[0x7fcc95c2b40c]
/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(_ctypes_callproc+0x48e)[0x7fcc95e425fe]
/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(+0x15f9e)[0x7fcc95e43f9e]
python(PyEval_EvalFrameEx+0x965)[0x499be5]
python(PyEval_EvalCodeEx+0x2ac)[0x4a090c]
python(PyEval_EvalFrameEx+0x7d2)[0x499a52]
python[0x4a1634]
python(PyRun_FileExFlags+0x92)[0x44e4a5]
python(PyRun_SimpleFileExFlags+0x2ee)[0x44ec9f]
python(Py_Main+0xb5e)[0x44f904]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fcc971a9ec5]
python[0x578c4e]

9 years agoMerge pull request #276 from brendangregg/master
Brenden Blanco [Wed, 21 Oct 2015 00:34:03 +0000 (17:34 -0700)]
Merge pull request #276 from brendangregg/master

softirq and hardirq

9 years agosoftirq and hardirq
Brendan Gregg [Tue, 20 Oct 2015 22:52:23 +0000 (15:52 -0700)]
softirq and hardirq

9 years agoMerge pull request #274 from brendangregg/master
Brenden Blanco [Fri, 16 Oct 2015 04:06:01 +0000 (21:06 -0700)]
Merge pull request #274 from brendangregg/master

tcpconnect for IPv4 and IPv6, and make tcpv4connect a trimmed example

9 years agorefer to tcpconnect
Brendan Gregg [Fri, 16 Oct 2015 00:22:32 +0000 (17:22 -0700)]
refer to tcpconnect

9 years agotcpconnect for IPv4 and IPv6, and make tcpv4connect a trimmed example
Brendan Gregg [Fri, 16 Oct 2015 00:21:32 +0000 (17:21 -0700)]
tcpconnect for IPv4 and IPv6, and make tcpv4connect a trimmed example

9 years agoMerge pull request #272 from SomaLDEN/poll_timeout
Brenden Blanco [Wed, 14 Oct 2015 14:48:12 +0000 (07:48 -0700)]
Merge pull request #272 from SomaLDEN/poll_timeout

perf_reader : add timeout argument to perf_reader_poll

9 years agoperf_reader : add timeout argument to perf_reader_poll
SunKyu [Wed, 14 Oct 2015 11:47:05 +0000 (04:47 -0700)]
perf_reader : add timeout argument to perf_reader_poll

9 years agoMerge pull request #271 from brendangregg/master
Brenden Blanco [Tue, 13 Oct 2015 23:44:22 +0000 (16:44 -0700)]
Merge pull request #271 from brendangregg/master

tcpaccept

9 years agofilter to match TCP only
Brendan Gregg [Tue, 13 Oct 2015 23:35:25 +0000 (16:35 -0700)]
filter to match TCP only

9 years agoUSAGE message typos
Brendan Gregg [Tue, 13 Oct 2015 22:41:46 +0000 (15:41 -0700)]
USAGE message typos

9 years agotcpaccept
Brendan Gregg [Tue, 13 Oct 2015 22:35:58 +0000 (15:35 -0700)]
tcpaccept

9 years agoMerge pull request #268 from iovisor/bblanco_dev
4ast [Mon, 12 Oct 2015 18:51:53 +0000 (11:51 -0700)]
Merge pull request #268 from iovisor/bblanco_dev

Fixes for deb/rpm packaging

9 years agoFixes for deb/rpm packaging
Brenden Blanco [Mon, 12 Oct 2015 18:13:48 +0000 (11:13 -0700)]
Fixes for deb/rpm packaging

These fixes are manually included in the released 0.1.7 packages, but
will help with future builds.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #267 from iovisor/bblanco_dev v0.1.7
4ast [Mon, 12 Oct 2015 16:59:13 +0000 (09:59 -0700)]
Merge pull request #267 from iovisor/bblanco_dev

Update tag to v0.1.7

9 years agoUpdate tag to v0.1.7
Brenden Blanco [Mon, 12 Oct 2015 16:31:03 +0000 (09:31 -0700)]
Update tag to v0.1.7

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #265 from iovisor/yhs_dev
Brenden Blanco [Mon, 12 Oct 2015 16:45:03 +0000 (09:45 -0700)]
Merge pull request #265 from iovisor/yhs_dev

handle return value in kretprobe handler for tcpv4connect

9 years agoMerge pull request #264 from iovisor/yhs_dev
Brenden Blanco [Thu, 8 Oct 2015 17:10:29 +0000 (10:10 -0700)]
Merge pull request #264 from iovisor/yhs_dev

Fix an uninitialized variable access in test_clang

9 years agohandle return value in kretprobe handler for tcpv4connect
Yonghong Song [Wed, 7 Oct 2015 15:59:42 +0000 (08:59 -0700)]
handle return value in kretprobe handler for tcpv4connect

Signed-off-by: Yonghong Song <yhs@plumgrid.com>
9 years agoFix an uninitialized variable access in test_clang
Yonghong Song [Wed, 7 Oct 2015 12:16:15 +0000 (05:16 -0700)]
Fix an uninitialized variable access in test_clang

Signed-off-by: Yonghong Song <yhs@plumgrid.com>
9 years agoMerge pull request #262 from iovisor/bblanco_dev
4ast [Tue, 6 Oct 2015 21:16:08 +0000 (14:16 -0700)]
Merge pull request #262 from iovisor/bblanco_dev

Make KeyboardInterrupt catch more aggressive

9 years agoMake KeyboardInterrupt catch more aggressive
Brenden Blanco [Tue, 6 Oct 2015 21:08:03 +0000 (14:08 -0700)]
Make KeyboardInterrupt catch more aggressive

Fixes: #186
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #261 from iovisor/bblanco_dev
4ast [Tue, 6 Oct 2015 20:01:49 +0000 (13:01 -0700)]
Merge pull request #261 from iovisor/bblanco_dev

Fixes for table indexing and clear()

9 years agoAvoid infinite loops in BPF.Table destructor
Brenden Blanco [Tue, 6 Oct 2015 19:12:42 +0000 (12:12 -0700)]
Avoid infinite loops in BPF.Table destructor

In the case that python process tries to clear() a table object while
the bpf program is still running and doing lookup_or_init, the python
clean() routine will race with the bpf program (and bpf will win in the
case of frequent kprobe hits) causing a hang. Instead, first get the
full list of keys and then delete them rather than rely on the default
popitem implementation.

Fixes: #233
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoSupport iterating from a 0-filled table key
Brenden Blanco [Tue, 6 Oct 2015 19:05:25 +0000 (12:05 -0700)]
Support iterating from a 0-filled table key

In the case that 0-filled keys are valid in the table, the previous
algorithm did not properly iterate.

The API of the bpf_get_next_key routine is such that the iteration
over a map should start with an invalid key. When a 0 key is valid, this
causes iteration to start anywhere inside the hash table, skipping some
entries. So, add logic to the Iter object to test if the init key is
invalid. If otherwise, try a few alternatives until an invalid key is
found. If none found, raise an exception.

Also adds a test for indexing arrays from 0, which nows works with this
too.

Fixes: #260
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #259 from iovisor/bblanco_dev
4ast [Thu, 1 Oct 2015 19:01:10 +0000 (12:01 -0700)]
Merge pull request #259 from iovisor/bblanco_dev

Don't treat fundamentally typed args as needing probe_read

9 years agoDon't treat fundamentally typed args as needing probe_read
Brenden Blanco [Thu, 1 Oct 2015 18:18:07 +0000 (11:18 -0700)]
Don't treat fundamentally typed args as needing probe_read

The rewriter was aggressively parsing PoD types as requiring probe_read
and poisoning other decls when those arguments were used.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #257 from iovisor/bblanco_dev
yonghong-song [Tue, 29 Sep 2015 21:19:23 +0000 (14:19 -0700)]
Merge pull request #257 from iovisor/bblanco_dev

Mask function calls from influencing probe_read

9 years agoMask function calls from influencing probe_read
Brenden Blanco [Tue, 29 Sep 2015 20:44:19 +0000 (13:44 -0700)]
Mask function calls from influencing probe_read

Calls to functions were propagating the needs_probe state, causing map
values to require a probe_read improperly. Although there may be a use
case for this, generally it will not be needed and should be solved
differently.

Fixes: #256
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #255 from iovisor/bblanco_dev
4ast [Mon, 28 Sep 2015 18:46:06 +0000 (11:46 -0700)]
Merge pull request #255 from iovisor/bblanco_dev

Add ability to consume perf events in python

9 years agoAdd check for fd < 0 in perf_reader_free
Brenden Blanco [Mon, 28 Sep 2015 18:35:26 +0000 (11:35 -0700)]
Add check for fd < 0 in perf_reader_free

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoAdd ability to consume perf events in python
Brenden Blanco [Fri, 25 Sep 2015 20:58:30 +0000 (13:58 -0700)]
Add ability to consume perf events in python

This adds the ability to consume perf events in libbpf/python using the
ring buffer. For now, this is the only way to get access to the function
call graph. Only kernel functions are supported.

It does this by introducing a new set of libbpf helper functions that
can open the perf fd, mmap it, and poll over the events as they are
submitted by the kernel. This allow for faster event processing than
trace_printks, but has not been tested.

The functionality is disabled by default, the user can enable it by
passing a non-empty cb parameter into the BPF constructor. That cb
function will be invoked for each event that is read from the buffer.
Buffers are per-fd, so each event is distinct as well as separated from
other processes that may be running simultaneously.

The initial test case uses this functionality to build a histogram of
events keyed by the callchain.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #254 from brendangregg/master
Brenden Blanco [Sun, 27 Sep 2015 03:19:54 +0000 (23:19 -0400)]
Merge pull request #254 from brendangregg/master

tcpv4connect

9 years agotcpv4connect
Brendan Gregg [Sat, 26 Sep 2015 00:01:17 +0000 (17:01 -0700)]
tcpv4connect

9 years agoMerge pull request #252 from iovisor/bblanco_dev
Brenden Blanco [Fri, 25 Sep 2015 21:05:59 +0000 (17:05 -0400)]
Merge pull request #252 from iovisor/bblanco_dev

Add custom formatter function to print_log2_hist

9 years agoAdd custom formatter function to print_log2_hist
Brenden Blanco [Fri, 25 Sep 2015 20:57:18 +0000 (13:57 -0700)]
Add custom formatter function to print_log2_hist

Fixes: #251
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
9 years agoMerge pull request #250 from brendangregg/master
Brenden Blanco [Fri, 25 Sep 2015 20:34:49 +0000 (16:34 -0400)]
Merge pull request #250 from brendangregg/master

begin using new histogram breakdowns feature

9 years agobiolatency -D
Brendan Gregg [Fri, 25 Sep 2015 20:20:16 +0000 (13:20 -0700)]
biolatency -D

9 years agofunclatency -F
Brendan Gregg [Fri, 25 Sep 2015 19:47:53 +0000 (12:47 -0700)]
funclatency -F

9 years agoMerge pull request #249 from brendangregg/master
Brenden Blanco [Fri, 25 Sep 2015 18:22:57 +0000 (14:22 -0400)]
Merge pull request #249 from brendangregg/master

use BPF_HISTOGRAM and num_open_kprobes