samples/bpf, selftests/bpf: Use bpf_probe_read_kernel
A handful of samples and selftests fail to build on s390, because
after commit 0ebeea8ca8
("bpf: Restrict bpf_probe_read{, str}()
only to archs where they work") bpf_probe_read is not available
anymore.
Fix by using bpf_probe_read_kernel.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200720114806.88823-1-iii@linux.ibm.com
This commit is contained in:

committed by
Alexei Starovoitov

parent
6bd557275a
commit
e4d9c23207
@@ -71,7 +71,8 @@ int iter(struct bpf_iter__task_file *ctx)
|
||||
|
||||
e.pid = task->tgid;
|
||||
e.id = get_obj_id(file->private_data, obj_type);
|
||||
bpf_probe_read(&e.comm, sizeof(e.comm), task->group_leader->comm);
|
||||
bpf_probe_read_kernel(&e.comm, sizeof(e.comm),
|
||||
task->group_leader->comm);
|
||||
bpf_seq_write(ctx->meta->seq, &e, sizeof(e));
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user