summaryrefslogtreecommitdiff
path: root/samples/bpf/tracex6_kern.c
diff options
context:
space:
mode:
authorKaixu Xia <xiakaixu@huawei.com>2015-08-12 09:37:53 +0000
committerDavid S. Miller <davem@davemloft.net>2015-08-12 16:39:12 -0700
commit5ed3ccbd5ac11414d61c16182718e68868becc16 (patch)
treedf41b5ddd7767528d1a26b204dca9586c9008524 /samples/bpf/tracex6_kern.c
parent47b344b27a003fcdaccbdc07b3d558a7ccdfec04 (diff)
bpf: fix build warnings and add function read_trace_pipe()
There are two improvements in this patch: 1. Fix the build warnings; 2. Add function read_trace_pipe() to print the result on the screen; Before this patch, we can get the result through /sys/kernel/de bug/tracing/trace_pipe and get nothing on the screen. By applying this patch, the result can be printed on the screen. $ ./tracex6 ... tracex6-705 [003] d..1 131.428593: : CPU-3 19981414 sshd-683 [000] d..1 131.428727: : CPU-0 221682321 sshd-683 [000] d..1 131.428821: : CPU-0 221808766 sshd-683 [000] d..1 131.428950: : CPU-0 221982984 sshd-683 [000] d..1 131.429045: : CPU-0 222111851 tracex6-705 [003] d..1 131.429168: : CPU-3 20757551 sshd-683 [000] d..1 131.429170: : CPU-0 222281240 sshd-683 [000] d..1 131.429261: : CPU-0 222403340 sshd-683 [000] d..1 131.429378: : CPU-0 222561024 ... Signed-off-by: Kaixu Xia <xiakaixu@huawei.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/tracex6_kern.c')
-rw-r--r--samples/bpf/tracex6_kern.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/samples/bpf/tracex6_kern.c b/samples/bpf/tracex6_kern.c
index 23d1cffaf249..be479c4af9e2 100644
--- a/samples/bpf/tracex6_kern.c
+++ b/samples/bpf/tracex6_kern.c
@@ -1,3 +1,4 @@
+#include <linux/ptrace.h>
#include <linux/version.h>
#include <uapi/linux/bpf.h>
#include "bpf_helpers.h"