diff options
author | Michael Holzheu <holzheu@linux.vnet.ibm.com> | 2015-07-06 16:20:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-08 15:17:45 -0700 |
commit | d912557b346099584bbbfa8d3c1e101c46e33b59 (patch) | |
tree | 2752bc31be26f1c27776a0d52439efdd81f9eed7 /samples/bpf/tracex3_kern.c | |
parent | 7baaa9092dedad5f670a7b1716b2ce9e1175ba02 (diff) | |
download | lwn-d912557b346099584bbbfa8d3c1e101c46e33b59.tar.gz lwn-d912557b346099584bbbfa8d3c1e101c46e33b59.zip |
samples: bpf: enable trace samples for s390x
The trace bpf samples do not compile on s390x because they use x86
specific fields from the "pt_regs" structure.
Fix this and access the fields via new PT_REGS macros.
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/tracex3_kern.c')
-rw-r--r-- | samples/bpf/tracex3_kern.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/tracex3_kern.c b/samples/bpf/tracex3_kern.c index 255ff2792366..bf337fbb0947 100644 --- a/samples/bpf/tracex3_kern.c +++ b/samples/bpf/tracex3_kern.c @@ -23,7 +23,7 @@ struct bpf_map_def SEC("maps") my_map = { SEC("kprobe/blk_mq_start_request") int bpf_prog1(struct pt_regs *ctx) { - long rq = ctx->di; + long rq = PT_REGS_PARM1(ctx); u64 val = bpf_ktime_get_ns(); bpf_map_update_elem(&my_map, &rq, &val, BPF_ANY); @@ -51,7 +51,7 @@ struct bpf_map_def SEC("maps") lat_map = { SEC("kprobe/blk_update_request") int bpf_prog2(struct pt_regs *ctx) { - long rq = ctx->di; + long rq = PT_REGS_PARM1(ctx); u64 *value, l, base; u32 index; |