diff options
author | Michael Holzheu <holzheu@linux.vnet.ibm.com> | 2016-11-28 13:48:30 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-28 16:26:46 -0500 |
commit | 2dbb4c05d048995455857a7c2927a4297fc66c3b (patch) | |
tree | 41e787570b3556b00b59ffcba6d0ba826a62ebf2 /samples/bpf/trace_event_kern.c | |
parent | 7a99cd6e213685b78118382e6a8fed506c82ccb2 (diff) | |
download | linux-2dbb4c05d048995455857a7c2927a4297fc66c3b.tar.gz linux-2dbb4c05d048995455857a7c2927a4297fc66c3b.tar.bz2 linux-2dbb4c05d048995455857a7c2927a4297fc66c3b.zip |
bpf/samples: Fix PT_REGS_IP on s390x and use it
The files "sampleip_kern.c" and "trace_event_kern.c" directly access
"ctx->regs.ip" which is not available on s390x. Fix this and use the
PT_REGS_IP() macro instead.
Also fix the macro for s390x and use "psw.addr" from "pt_regs".
Reported-by: Zvonko Kosic <zvonko.kosic@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/trace_event_kern.c')
-rw-r--r-- | samples/bpf/trace_event_kern.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/trace_event_kern.c b/samples/bpf/trace_event_kern.c index 71a8ed32823e..41b6115a32eb 100644 --- a/samples/bpf/trace_event_kern.c +++ b/samples/bpf/trace_event_kern.c @@ -50,7 +50,7 @@ int bpf_prog1(struct bpf_perf_event_data *ctx) key.userstack = bpf_get_stackid(ctx, &stackmap, USER_STACKID_FLAGS); if ((int)key.kernstack < 0 && (int)key.userstack < 0) { bpf_trace_printk(fmt, sizeof(fmt), cpu, ctx->sample_period, - ctx->regs.ip); + PT_REGS_IP(&ctx->regs)); return 0; } |