- 24 May, 2016 1 commit
-
-
Mark Drayton authored
-
- 20 May, 2016 2 commits
-
-
Brenden Blanco authored
Fix a few fd leaks
-
Martin KaFai Lau authored
/sys/kernel/debug/tracing.
-
- 17 May, 2016 3 commits
-
-
Brendan Gregg authored
add --kernel-threads-only to tools/offcputime
-
Andrew Birchall authored
Summary: Adds `--kernel-threads-only` arg The kernel-threads-only arg is exclusive with pid/user-threads-only via `parser.add_mutually_exclusive_group`. The output message now indicates what we are tracing (pid/user threads/kernel threads/all threads). Removed the --verbose arg (unused). Test Plan: Run with combinations of the args; validate output looks sane: // test mutually exclusive group ``` devbig680[bcc](abirchall_dev): ~/bcc_run_tool.sh offcputime -k -u 1 [Running] /data/users/abirchall/bcc/tools/offcputime.py -k -u 1 usage: offcputime.py [-h] [-p PID | -k | -u] [-v] [-f] [duration] offcputime.py: error: argument -u/--user-threads-only: not allowed with argument -k/--kernel-threads-only ``` // kernel threads only ``` devbig680[bcc](abirchall_dev): ~/bcc_run_tool.sh offcputime -f -k 1 [Running] /data/users/abirchall/bcc/tools/offcputime.py -f -k 1 swapper/21;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 11 swapper/16;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 19 swapper/22;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 20 swapper/31;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 20 swapper/23;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 67 swapper/25;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 74 ... ``` `~/bcc_run_tool.sh offcputime -f --kernel-threads-only 1` // user threads only `~/bcc_run_tool.sh offcputime -f --user-threads-only 1` `~/bcc_run_tool.sh offcputime -f -u 1` // specific pid `~/bcc_run_tool.sh offcputime -f -p $(pidof hphpi) 1` ``` devbig680[bcc](abirchall_dev): ~/bcc_run_tool.sh offcputime --pid $(pidof mcrouter) 10 | head [Running] /data/users/abirchall/bcc/tools/offcputime.py --pid 95929 10 Tracing off-CPU time (us) of PID 95929 by kernel stack for 10 secs. ``` Note that this last case (specific PID) doesn't appear to be working; I can debug that in a follow up commit.
-
4ast authored
handle ENOMEM in tools/offcputime
-
- 16 May, 2016 4 commits
-
-
Andrew Birchall authored
Summary: * move ENOMEM comment from tools/offcputime.py to src/cc/export/helpers.h * create --stack-storage-size arg to allow the user to set the stack storage size * requires a positive_nonzero_int type checking function for argparse * clean up the rest of the args a bit * use parser.add_mutually_exclusive_group instead of manually handling the mutual exclusion * use positive_nonzero_int for duration arg * use positive_int for pid arg * only print a warning about increasing the storage size if at least one of the get_stackid errors was a -ENOMEM * remove the debug param (we can add this manually when testing) * fix a bug where all processes are traced when specifying pid of 0 Test Plan: ``` devbig680[bcc](no branch, rebasing abirchall_dev): ~/bcc_run_tool.sh offcputime --help [Running] /data/users/abirchall/bcc/tools/offcputime.py --help usage: offcputime.py [-h] [-u | -p PID] [-v] [-f] [--stack-storage-size STACK_STORAGE_SIZE] [duration] Summarize off-CPU time by kernel stack trace positional arguments: duration duration of trace, in seconds optional arguments: -h, --help show this help message and exit -u, --useronly user threads only (no kernel threads) -p PID, --pid PID trace this PID only -v, --verbose show raw addresses -f, --folded output folded format --stack-storage-size STACK_STORAGE_SIZE the number of unique stack traces that can be stored and displayed examples: ./offcputime # trace off-CPU stack time until Ctrl-C ./offcputime 5 # trace for 5 seconds only ./offcputime -f 5 # 5 seconds, and output in folded format ./offcputime -u # don't include kernel threads (user only) ./offcputime -p 185 # trace fo PID 185 only devbig680[bcc](no branch, rebasing abirchall_dev): ~/bcc_run_tool.sh offcputime -f 0 [Running] /data/users/abirchall/bcc/tools/offcputime.py -f 0 usage: offcputime.py [-h] [-u | -p PID] [-v] [-f] [--stack-storage-size STACK_STORAGE_SIZE] [duration] offcputime.py: error: argument duration: must be positive and nonzero devbig680[bcc](no branch, rebasing abirchall_dev): ~/bcc_run_tool.sh offcputime -f -1 [Running] /data/users/abirchall/bcc/tools/offcputime.py -f -1 usage: offcputime.py [-h] [-u | -p PID] [-v] [-f] [--stack-storage-size STACK_STORAGE_SIZE] [duration] offcputime.py: error: argument duration: must be positive and nonzero devbig680[bcc](no branch, rebasing abirchall_dev): ~/bcc_run_tool.sh offcputime --stack-storage-size 0 -f 1 [Running] /data/users/abirchall/bcc/tools/offcputime.py --stack-storage-size 0 -f 1 usage: offcputime.py [-h] [-u | -p PID] [-v] [-f] [--stack-storage-size STACK_STORAGE_SIZE] [duration] offcputime.py: error: argument --stack-storage-size: must be positive and nonzero devbig680[bcc](no branch, rebasing abirchall_dev): ~/bcc_run_tool.sh offcputime --stack-storage-size 1 -f 1 [Running] /data/users/abirchall/bcc/tools/offcputime.py --stack-storage-size 1 -f 1 swapper/27;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 7 swapper/29;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 102 swapper/25;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 113 swapper/26;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 138 swapper/28;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 164 swapper/30;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 177 swapper/24;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 980 swapper/31;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 1556 swapper/1;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2038 swapper/3;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2190 swapper/2;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2235 swapper/15;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2260 swapper/13;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2450 swapper/6;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2646 swapper/12;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2675 swapper/11;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2769 swapper/8;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2885 swapper/4;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 3134 swapper/10;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 3416 swapper/14;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 3702 swapper/7;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 4343 swapper/9;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 5397 swapper/5;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 6836 swapper/17;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 13792 swapper/19;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 14488 swapper/22;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 15298 swapper/18;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 15735 swapper/20;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 17333 swapper/16;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 17645 swapper/23;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 17681 swapper/21;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 18607 WARNING: 92 stack traces could not be displayed. Consider increasing --stack-storage-size.
-
Andrew Birchall authored
Summary: BPF_STACK_TRACE(_name, _size) will allocate space for _size stack traces (see https://github.com/torvalds/linux/blob/master/kernel/bpf/stackmap.c#L30-L50). If we've already used all of this space, subsequent calls to bpf_get_stackid() will return -ENOMEM (see https://github.com/torvalds/linux/blob/master/kernel/bpf/stackmap.c#L173-L176). This causes our BPF bytecode to store this value in key_t.stack_id and subsequently causes our python application to crash due to a KeyError when invoking stack_traces.walk(k.stack_id). Let's avoid calling stack_traces.walk(k.stack_id) with back stackid's Test Plan: Run offcputime.py in an extreme case; with space for only a single stack trace ``` devbig680[bcc](tools): sed_in_file 's/BPF_STACK_TRACE(stack_traces, 1024)/BPF_STACK_TRACE(stack_traces, 1)/' tools/offcputime.py && \ > ~/bcc_run_tool.sh offcputime -f 5; \ > git reset --hard HEAD swapper/30;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 496 swapper/26;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 553 swapper/28;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 604 swapper/31;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 692 swapper/23;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 713 swapper/18;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 919 swapper/16;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 1051 swapper/20;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 1056 swapper/21;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 1585 swapper/24;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 1597 swapper/27;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 1610 swapper/17;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 1674 swapper/22;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2390 swapper/25;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2574 swapper/19;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 2589 swapper/29;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 8428 swapper/8;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 15272 swapper/15;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 15591 swapper/11;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 17934 swapper/9;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 18100 swapper/14;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 18266 swapper/10;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 20124 swapper/12;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 20887 swapper/13;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 23453 swapper/3;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 27296 swapper/5;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 29094 swapper/6;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 29799 swapper/7;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 31522 swapper/1;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 32269 swapper/4;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 35585 swapper/2;start_secondary;cpu_startup_entry;schedule_preempt_disabled;schedule 37627 WARNING: 249 stack traces could not be displayed. Consider increasing stack trace storage size. HEAD is now at d3365e9 [RFC] handle ENOMEM in tools/offcputime` ```
-
4ast authored
http_filter fixes
-
Bertrone Matteo authored
-
- 13 May, 2016 1 commit
-
-
4ast authored
Lua ports of biosnoop and stacksnoop
-
- 12 May, 2016 3 commits
-
-
Mark Drayton authored
-
Brenden Blanco authored
updated cmake system to include lua and new networking example
-
Zaafar Ahmed authored
-
- 11 May, 2016 5 commits
-
-
4ast authored
Add new example with test case for for unroll, as requested.
-
Brenden Blanco authored
Revert "Force lua main.c to include luajit headers"
-
Brenden Blanco authored
This reverts commit c21b9c03. Instead, use `LUAJIT_DIR=/usr/include/luajit-2.0 cmake ..` or similar as required. Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
-
Valkum authored
-
Valkum authored
Add dns_matching example with test case for for unroll, as requested at iovisor-dev@lists.iovisor.org
-
- 06 May, 2016 13 commits
-
-
Brenden Blanco authored
Lua installation instructions.
-
Nicole Izumi authored
-
Brenden Blanco authored
[RFC] New USDT API
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
Vicent Marti authored
-
- 05 May, 2016 8 commits
-
-
4ast authored
Add check for number of arguments
-
Brenden Blanco authored
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 authored
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 authored
Introduce helpers to access pt_regs in an arch-independent manner
-
Naveen N. Rao authored
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 authored
fix llvm 3.9 build
-
Brenden Blanco authored
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
-
4ast authored
Force lua main.c to include luajit headers
-