summaryrefslogtreecommitdiffstats
path: root/samples/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2016-02-18 04:58:59 +0100
committerDavid S. Miller <davem@davemloft.net>2016-02-20 06:21:44 +0100
commita6ffe7b9df6228d11c5689914eceb488bc4e38df (patch)
treeec8f20a73795ff16ed02887eb72870eeeee186a8 /samples/bpf/bpf_helpers.h
parentbpf: introduce BPF_MAP_TYPE_STACK_TRACE (diff)
downloadlinux-a6ffe7b9df6228d11c5689914eceb488bc4e38df.tar.xz
linux-a6ffe7b9df6228d11c5689914eceb488bc4e38df.zip
samples/bpf: offwaketime example
This is simplified version of Brendan Gregg's offwaketime: This program shows kernel stack traces and task names that were blocked and "off-CPU", along with the stack traces and task names for the threads that woke them, and the total elapsed time from when they blocked to when they were woken up. The combined stacks, task names, and total time is summarized in kernel context for efficiency. Example: $ sudo ./offwaketime | flamegraph.pl > demo.svg Open demo.svg in the browser as FlameGraph visualization. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/bpf_helpers.h')
-rw-r--r--samples/bpf/bpf_helpers.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/samples/bpf/bpf_helpers.h b/samples/bpf/bpf_helpers.h
index 7ad19e1dbaf4..811bcca0f29d 100644
--- a/samples/bpf/bpf_helpers.h
+++ b/samples/bpf/bpf_helpers.h
@@ -39,6 +39,8 @@ static int (*bpf_redirect)(int ifindex, int flags) =
(void *) BPF_FUNC_redirect;
static int (*bpf_perf_event_output)(void *ctx, void *map, int index, void *data, int size) =
(void *) BPF_FUNC_perf_event_output;
+static int (*bpf_get_stackid)(void *ctx, void *map, int flags) =
+ (void *) BPF_FUNC_get_stackid;
/* llvm builtin functions that eBPF C program may use to
* emit BPF_LD_ABS and BPF_LD_IND instructions