platform/upstream/bcc.git
8 years agomakes more sense to invert the -X usage
Brendan Gregg [Tue, 9 Feb 2016 08:28:09 +0000 (00:28 -0800)]
makes more sense to invert the -X usage

8 years agoMerge pull request #355 from goldshtn/master
Brenden Blanco [Mon, 8 Feb 2016 21:51:26 +0000 (22:51 +0100)]
Merge pull request #355 from goldshtn/master

New tool: memleak

8 years agoMerge pull request #353 from brendangregg/master
Brenden Blanco [Mon, 8 Feb 2016 21:30:19 +0000 (22:30 +0100)]
Merge pull request #353 from brendangregg/master

3 tools: fsslower, execsnoop, runqlat

8 years agomecs typo
Brendan Gregg [Mon, 8 Feb 2016 15:50:33 +0000 (07:50 -0800)]
mecs typo

8 years agoMerge pull request #357 from iovisor/prandom
4ast [Mon, 8 Feb 2016 14:34:44 +0000 (15:34 +0100)]
Merge pull request #357 from iovisor/prandom

Add bpf_get_prandom_u32 to helpers

8 years agoAdd bpf_get_prandom_u32 to helpers
Brenden Blanco [Mon, 8 Feb 2016 14:22:23 +0000 (15:22 +0100)]
Add bpf_get_prandom_u32 to helpers

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoAdded -s switch to perform allocation sampling
Sasha Goldshtein [Mon, 8 Feb 2016 13:48:31 +0000 (05:48 -0800)]
Added -s switch to perform allocation sampling

8 years agoAdded memleak.py to README
Sasha Goldshtein [Mon, 8 Feb 2016 12:05:48 +0000 (04:05 -0800)]
Added memleak.py to README

8 years agoAdded man page
Sasha Goldshtein [Mon, 8 Feb 2016 12:04:15 +0000 (04:04 -0800)]
Added man page

8 years agoClarified example output
Sasha Goldshtein [Mon, 8 Feb 2016 11:41:43 +0000 (03:41 -0800)]
Clarified example output

8 years agoFixed indentation and Python style issues from pep
Sasha Goldshtein [Mon, 8 Feb 2016 11:39:44 +0000 (03:39 -0800)]
Fixed indentation and Python style issues from pep

8 years agoAdded examples
Sasha Goldshtein [Mon, 8 Feb 2016 11:10:13 +0000 (03:10 -0800)]
Added examples

8 years agoAdded -c switch to run a command and trace that process
Sasha Goldshtein [Mon, 8 Feb 2016 10:57:02 +0000 (02:57 -0800)]
Added -c switch to run a command and trace that process

8 years agorunqlat
Brendan Gregg [Mon, 8 Feb 2016 09:20:31 +0000 (01:20 -0800)]
runqlat

8 years agorename fsslower to fileslower
Brendan Gregg [Mon, 8 Feb 2016 02:48:20 +0000 (18:48 -0800)]
rename fsslower to fileslower

8 years agoextra dot
Brendan Gregg [Mon, 8 Feb 2016 00:36:10 +0000 (16:36 -0800)]
extra dot

8 years agoexecsnoop
Brendan Gregg [Sun, 7 Feb 2016 23:28:50 +0000 (15:28 -0800)]
execsnoop

8 years agodocs typo
Brendan Gregg [Sun, 7 Feb 2016 21:05:09 +0000 (13:05 -0800)]
docs typo

8 years agomore advice in the man page
Brendan Gregg [Sun, 7 Feb 2016 20:22:50 +0000 (12:22 -0800)]
more advice in the man page

8 years agoRefactored StackDecoder, added 'run command' option with no implementation yet
Sasha Goldshtein [Sun, 7 Feb 2016 20:20:19 +0000 (12:20 -0800)]
Refactored StackDecoder, added 'run command' option with no implementation yet

8 years agofsslower
Brendan Gregg [Sun, 7 Feb 2016 20:14:37 +0000 (12:14 -0800)]
fsslower

8 years agoRefactored Time class and added usage example
Sasha Goldshtein [Sun, 7 Feb 2016 20:03:54 +0000 (12:03 -0800)]
Refactored Time class and added usage example

8 years agoMerge remote-tracking branch 'upstream/master'
Sasha Goldshtein [Sun, 7 Feb 2016 19:16:24 +0000 (11:16 -0800)]
Merge remote-tracking branch 'upstream/master'

8 years agoAdded source for gettime code
Sasha Goldshtein [Sun, 7 Feb 2016 19:11:56 +0000 (11:11 -0800)]
Added source for gettime code

8 years agoDon't show allocations newer than a configurable age
Sasha Goldshtein [Sun, 7 Feb 2016 19:09:36 +0000 (11:09 -0800)]
Don't show allocations newer than a configurable age

8 years agoMerge pull request #351 from iovisor/iteritems
4ast [Sun, 7 Feb 2016 15:11:55 +0000 (07:11 -0800)]
Merge pull request #351 from iovisor/iteritems

Fix python map.items() racing with bpf delete

8 years agoFix python map.items() racing with bpf delete
Brenden Blanco [Sun, 7 Feb 2016 14:57:17 +0000 (06:57 -0800)]
Fix python map.items() racing with bpf delete

The default python implementation of itervalues(), iteritems(), items(), and
values() do a sequence of iter().next followed by self[key], which may
produce a KeyError since a bpf program can delete them quickly. It
should be safe to suppress such errors, hiding them from the user.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #349 from brendangregg/master
4ast [Sun, 7 Feb 2016 14:30:37 +0000 (06:30 -0800)]
Merge pull request #349 from brendangregg/master

biotop

8 years agoMerge pull request #348 from iovisor/scanf_fix
4ast [Sun, 7 Feb 2016 14:03:01 +0000 (06:03 -0800)]
Merge pull request #348 from iovisor/scanf_fix

Support array and pointer types in scanf generated function

8 years agoAdded memory leak tracer
Sasha Goldshtein [Sun, 7 Feb 2016 09:57:42 +0000 (01:57 -0800)]
Added memory leak tracer

8 years agoupdate comments
Brendan Gregg [Sun, 7 Feb 2016 08:54:44 +0000 (00:54 -0800)]
update comments

8 years agobiotop
Brendan Gregg [Sun, 7 Feb 2016 08:46:34 +0000 (00:46 -0800)]
biotop

8 years agoSupport array and pointer types in scanf generated function
Brenden Blanco [Sun, 7 Feb 2016 04:59:10 +0000 (20:59 -0800)]
Support array and pointer types in scanf generated function

The rewriter-created sscanf and snprintf routines did not support map
structs with arrays or pointer types in them. Add such support.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #346 from brendangregg/master
Brenden Blanco [Sun, 7 Feb 2016 04:07:03 +0000 (20:07 -0800)]
Merge pull request #346 from brendangregg/master

biosnoop.py: use one map instead of two

8 years agosimplify
Brendan Gregg [Sun, 7 Feb 2016 01:19:59 +0000 (17:19 -0800)]
simplify

8 years agonits
Brendan Gregg [Sun, 7 Feb 2016 01:11:59 +0000 (17:11 -0800)]
nits

8 years agobitesize nits
Brendan Gregg [Sun, 7 Feb 2016 01:08:38 +0000 (17:08 -0800)]
bitesize nits

8 years agouse one map instead of two
Brendan Gregg [Sun, 7 Feb 2016 00:45:29 +0000 (16:45 -0800)]
use one map instead of two

8 years agoMerge pull request #343 from ceeaspb/master
Brenden Blanco [Sat, 6 Feb 2016 20:34:53 +0000 (12:34 -0800)]
Merge pull request #343 from ceeaspb/master

typo trawl

8 years agoMerge pull request #340 from linuxfood/master
Brenden Blanco [Sat, 6 Feb 2016 20:34:25 +0000 (12:34 -0800)]
Merge pull request #340 from linuxfood/master

Add bpf_module.h to CMakeLists.txt

8 years agoMerge pull request #342 from mcaleavya/master
Brenden Blanco [Sat, 6 Feb 2016 20:33:57 +0000 (12:33 -0800)]
Merge pull request #342 from mcaleavya/master

Add in tool bitesize

8 years agoMerge pull request #337 from mbertrone/master
Brenden Blanco [Sat, 6 Feb 2016 17:07:20 +0000 (09:07 -0800)]
Merge pull request #337 from mbertrone/master

Simple HTTP Filter Example

8 years agoMerge branch 'master' into master
Bertrone Matteo [Sat, 6 Feb 2016 17:04:47 +0000 (18:04 +0100)]
Merge branch 'master' into master

8 years agoREADME changes
Bertrone Matteo [Sat, 6 Feb 2016 16:12:45 +0000 (17:12 +0100)]
README changes

8 years agoone slipped the net
Alex Bagehot [Sat, 6 Feb 2016 16:09:58 +0000 (16:09 +0000)]
one slipped the net

8 years agorecommend using a spell checker before committing
Alex Bagehot [Sat, 6 Feb 2016 16:04:10 +0000 (16:04 +0000)]
recommend using a spell checker before committing

8 years agotrawl typos with aspell
Alex Bagehot [Sat, 6 Feb 2016 16:01:02 +0000 (16:01 +0000)]
trawl typos with aspell

8 years agohttp filter example
Bertrone Matteo [Sat, 6 Feb 2016 15:56:01 +0000 (16:56 +0100)]
http filter example

8 years agoUpdate README.md
Allan McAleavy [Sat, 6 Feb 2016 12:06:18 +0000 (12:06 +0000)]
Update README.md

8 years agoAdded update to README.md
mcaleavya [Sat, 6 Feb 2016 12:02:40 +0000 (12:02 +0000)]
Added update to README.md

8 years agoAdd bitesize tool
mcaleavya [Sat, 6 Feb 2016 12:00:34 +0000 (12:00 +0000)]
Add bitesize tool

8 years agoMerge pull request #1 from iovisor/master
Allan McAleavy [Sat, 6 Feb 2016 11:54:17 +0000 (11:54 +0000)]
Merge pull request #1 from iovisor/master

update local repo

8 years agoMerge pull request #341 from iovisor/brendangregg-patch-1
Brendan Gregg [Fri, 5 Feb 2016 23:45:55 +0000 (15:45 -0800)]
Merge pull request #341 from iovisor/brendangregg-patch-1

documentation typos

8 years agoMerge branch 'master' into brendangregg-patch-1
Brendan Gregg [Fri, 5 Feb 2016 23:40:28 +0000 (15:40 -0800)]
Merge branch 'master' into brendangregg-patch-1

8 years agoMerge pull request #339 from iovisor/segfault_fix
4ast [Fri, 5 Feb 2016 23:39:01 +0000 (15:39 -0800)]
Merge pull request #339 from iovisor/segfault_fix

Fix segfault in ~BPFModule on syntax error

8 years agodocumentation typos
Brendan Gregg [Fri, 5 Feb 2016 23:37:56 +0000 (15:37 -0800)]
documentation typos

8 years agoMerge branch 'master' into master
linuxfood [Fri, 5 Feb 2016 23:03:56 +0000 (15:03 -0800)]
Merge branch 'master' into master

8 years agoFix segfault in ~BPFModule on syntax error
Brenden Blanco [Fri, 5 Feb 2016 22:49:10 +0000 (14:49 -0800)]
Fix segfault in ~BPFModule on syntax error

~BPFModule was segfaulting because tables_ was an empty pointer. The
pointer is valid only for valid compilations. Add a test as well.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #338 from brendangregg/master
Brenden Blanco [Fri, 5 Feb 2016 22:44:00 +0000 (14:44 -0800)]
Merge pull request #338 from brendangregg/master

contributing scripts guide

8 years agodifferent man formats
Brendan Gregg [Fri, 5 Feb 2016 22:40:34 +0000 (14:40 -0800)]
different man formats

8 years agoAdd bpf_module.h to CMakeLists.txt
Brian Smith [Fri, 5 Feb 2016 22:03:16 +0000 (14:03 -0800)]
Add bpf_module.h to CMakeLists.txt

The C++ API should also be exported, in addition to the C API.
Because type safety is nice.

8 years agocontributing scripts guide
Brendan Gregg [Fri, 5 Feb 2016 21:36:06 +0000 (13:36 -0800)]
contributing scripts guide

8 years agohttp filter example
Bertrone Matteo [Fri, 5 Feb 2016 10:38:06 +0000 (11:38 +0100)]
http filter example

8 years agoMerge pull request #335 from iovisor/p4-fixes
4ast [Thu, 4 Feb 2016 17:13:06 +0000 (09:13 -0800)]
Merge pull request #335 from iovisor/p4-fixes

Reorder P4 struct key initializers and blocks

8 years agoReorder P4 struct key initializers and blocks
Brenden Blanco [Wed, 3 Feb 2016 00:07:56 +0000 (16:07 -0800)]
Reorder P4 struct key initializers and blocks

The basic_routing.p4 program was failing verification due to missed map
key initializers in some paths. Put the goto label at the head of the
block and add a " = {}" for each key declaration inside the block.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #334 from iovisor/ast_dev
Brenden Blanco [Thu, 4 Feb 2016 06:07:52 +0000 (22:07 -0800)]
Merge pull request #334 from iovisor/ast_dev

use __builtin_memcpy() instead of unrolled loop

8 years agouse __builtin_memcpy() instead of unrolled loop
Alexei Starovoitov [Thu, 4 Feb 2016 05:25:43 +0000 (21:25 -0800)]
use __builtin_memcpy() instead of unrolled loop

also remove tab and unused import

Signed-off-by: Alexei Starovoitov <ast@fb.com>
8 years agoMerge pull request #332 from mcaleavya/master
4ast [Sun, 31 Jan 2016 18:38:14 +0000 (10:38 -0800)]
Merge pull request #332 from mcaleavya/master

Added cachestat tool

8 years agoupdate with cachestat , squashed commit
unixtest [Sun, 31 Jan 2016 10:47:03 +0000 (10:47 +0000)]
update with cachestat , squashed commit

Added .txt to exmaple file to allow link to work

duplicate file

duplicate of .txt version

  Author:    allan mcaleavy <allan.mcaleavy@gmail.com>

8 years agoMerge pull request #331 from brendangregg/master
4ast [Sat, 30 Jan 2016 19:15:48 +0000 (11:15 -0800)]
Merge pull request #331 from brendangregg/master

offwaketime

8 years agofix synopsis options in docs
Brendan Gregg [Sat, 30 Jan 2016 19:05:40 +0000 (11:05 -0800)]
fix synopsis options in docs

8 years agooffwaketime
Brendan Gregg [Sat, 30 Jan 2016 19:02:29 +0000 (11:02 -0800)]
offwaketime

8 years agoMerge pull request #329 from iovisor/dump_func
4ast [Fri, 29 Jan 2016 20:06:48 +0000 (12:06 -0800)]
Merge pull request #329 from iovisor/dump_func

Update test_dump_func to be python3 compatible

8 years agoUpdate test_dump_func to be python3 compatible
Brenden Blanco [Fri, 29 Jan 2016 19:58:54 +0000 (11:58 -0800)]
Update test_dump_func to be python3 compatible

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #326 from brendangregg/master
Brenden Blanco [Fri, 29 Jan 2016 07:18:26 +0000 (23:18 -0800)]
Merge pull request #326 from brendangregg/master

gethostlatency

8 years agoMerge remote-tracking branch 'upstream/master'
Brendan Gregg [Fri, 29 Jan 2016 07:00:44 +0000 (23:00 -0800)]
Merge remote-tracking branch 'upstream/master'

8 years agogethostlatency
Brendan Gregg [Fri, 29 Jan 2016 07:00:00 +0000 (23:00 -0800)]
gethostlatency

8 years agoMerge pull request #325 from brendangregg/master
Brenden Blanco [Fri, 29 Jan 2016 06:48:38 +0000 (22:48 -0800)]
Merge pull request #325 from brendangregg/master

bashreadline

8 years agobashreadline
Brendan Gregg [Fri, 29 Jan 2016 06:43:37 +0000 (22:43 -0800)]
bashreadline

8 years agoMerge pull request #324 from brendangregg/master
Brenden Blanco [Fri, 29 Jan 2016 06:42:39 +0000 (22:42 -0800)]
Merge pull request #324 from brendangregg/master

more strlen examples

8 years agomore strlen examples
Brendan Gregg [Fri, 29 Jan 2016 06:39:23 +0000 (22:39 -0800)]
more strlen examples

8 years agoMerge pull request #323 from iovisor/strlen
4ast [Fri, 29 Jan 2016 06:24:39 +0000 (22:24 -0800)]
Merge pull request #323 from iovisor/strlen

Add uprobe strlen histogram example

8 years agoAdd uprobe strlen histogram example
Brenden Blanco [Fri, 29 Jan 2016 06:15:25 +0000 (22:15 -0800)]
Add uprobe strlen histogram example

This example traces all calls to libc's strlen(). The program is attached as a
retprobe, therefore giving access to the resulting string length. The value is
kept in a log2 histogram that is printed to console once per second.

Example:
```
$ sudo ./strlen_hist.py
22:12:51
     strlen return:      : count     distribution
         0 -> 1          : 2041     |****************                        |
         2 -> 3          : 1120     |********                                |
         4 -> 7          : 3300     |**************************              |
         8 -> 15         : 4995     |****************************************|
        16 -> 31         : 2130     |*****************                       |
        32 -> 63         : 562      |****                                    |
^C
```

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #322 from iovisor/uprobes
4ast [Fri, 29 Jan 2016 05:12:02 +0000 (21:12 -0800)]
Merge pull request #322 from iovisor/uprobes

Uprobe support

8 years agoFixup objdump calling syntax and add docstrings
Brenden Blanco [Fri, 29 Jan 2016 05:07:28 +0000 (21:07 -0800)]
Fixup objdump calling syntax and add docstrings

Use the full path invocation of objdump in both places.

Add a docstring for the variants of attach_retprobe.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoFixes for address calculation
Brenden Blanco [Thu, 28 Jan 2016 22:18:46 +0000 (14:18 -0800)]
Fixes for address calculation

The calculation of function address in non-shared libraries was
incorrect. Fix it.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoAdd python support for attaching bpf programs to uprobes
Brenden Blanco [Thu, 28 Jan 2016 18:26:06 +0000 (10:26 -0800)]
Add python support for attaching bpf programs to uprobes

This adds a similar set of functions to kprobes for userspace probes.
The calling convention is different, however, since the user must
provide a library/binary name and function symbol or address. Add two
simple test cases for both.

I don't see an easy way in this api to add auto-loading support, as in
kprobe functions that start with "kprobe__". Such niceties can come
later.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoAdd libbpf.c support for uprobes
Brenden Blanco [Thu, 28 Jan 2016 18:24:56 +0000 (10:24 -0800)]
Add libbpf.c support for uprobes

The base calling convention for uprobes is the same as kprobes, but just
the path in debug/tracing/ is slightly different. Add a new API for this
and slightly refactor the code.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #321 from brendangregg/master
4ast [Thu, 28 Jan 2016 17:32:13 +0000 (09:32 -0800)]
Merge pull request #321 from brendangregg/master

wakeuptime

8 years agowakeuptime
Brendan Gregg [Thu, 28 Jan 2016 07:17:40 +0000 (23:17 -0800)]
wakeuptime

8 years agowordwrap fix, and terminology adjustment
Brendan Gregg [Thu, 28 Jan 2016 07:11:12 +0000 (23:11 -0800)]
wordwrap fix, and terminology adjustment

8 years agoMerge pull request #320 from iovisor/offcputime_fix
Brenden Blanco [Wed, 27 Jan 2016 16:15:24 +0000 (08:15 -0800)]
Merge pull request #320 from iovisor/offcputime_fix

Add decode() to ascii string in offcputime.py

8 years agoAdd decode() to ascii string in offcputime.py
Brenden Blanco [Wed, 27 Jan 2016 07:12:59 +0000 (23:12 -0800)]
Add decode() to ascii string in offcputime.py

Fixes: #318
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #319 from iovisor/cmake_fixes
4ast [Wed, 27 Jan 2016 06:10:25 +0000 (22:10 -0800)]
Merge pull request #319 from iovisor/cmake_fixes

Updates to use cmake GLOB and libbcc.so.0 in python init

8 years agoUpdates to use cmake GLOB and libbcc.so.0 in python init
Brenden Blanco [Tue, 26 Jan 2016 20:04:06 +0000 (12:04 -0800)]
Updates to use cmake GLOB and libbcc.so.0 in python init

In order not to miss some files in the tools and examples source
directories, use cmake file(GLOB) to collect relevant files. To ease the
implementation, move all tools to be .py suffixed in the source, but
sans-suffix in the installation (same as before)

In addition, to prevent future API breakage confusion (though of course
that may still happen), use CDLL("libbcc.so.0") in the bcc __init__.py.

Fixes: #317
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
8 years agoMerge pull request #316 from brendangregg/master
Brenden Blanco [Wed, 20 Jan 2016 01:39:27 +0000 (17:39 -0800)]
Merge pull request #316 from brendangregg/master

offcputime improvements

8 years agodocs for offcputime -u
Brendan Gregg [Wed, 20 Jan 2016 01:15:02 +0000 (17:15 -0800)]
docs for offcputime -u

8 years agoadd -u, and change from 2 to 1 traced funcitons
Brendan Gregg [Wed, 20 Jan 2016 01:12:52 +0000 (17:12 -0800)]
add -u, and change from 2 to 1 traced funcitons

8 years agooptimize code, remove unnecessary filter check
Brendan Gregg [Tue, 19 Jan 2016 22:40:41 +0000 (14:40 -0800)]
optimize code, remove unnecessary filter check

8 years agoMerge pull request #315 from brendangregg/master
Brenden Blanco [Tue, 19 Jan 2016 15:12:21 +0000 (07:12 -0800)]
Merge pull request #315 from brendangregg/master

stack walker typo and improvement