Add a writable bare tracepoint in bpf_testmod module, and trigger its calling when reading /sys/kernel/bpf_testmod with a specific buffer length. The reading will return the value in writable context if the early return flag is enabled in writable context. Signed-off-by: Hou Tao <houtao1@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20211004094857.30868-4-hotforest@gmail.com
25 lines
399 B
C
25 lines
399 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright (c) 2020 Facebook */
|
|
#ifndef _BPF_TESTMOD_H
|
|
#define _BPF_TESTMOD_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct bpf_testmod_test_read_ctx {
|
|
char *buf;
|
|
loff_t off;
|
|
size_t len;
|
|
};
|
|
|
|
struct bpf_testmod_test_write_ctx {
|
|
char *buf;
|
|
loff_t off;
|
|
size_t len;
|
|
};
|
|
|
|
struct bpf_testmod_test_writable_ctx {
|
|
bool early_ret;
|
|
int val;
|
|
};
|
|
|
|
#endif /* _BPF_TESTMOD_H */
|