WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / bpf_iter_test_kern_common.h
blobd5e3df66ad9af29ba5dd930a59daaf8f4174570e
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2020 Facebook */
3 #include "bpf_iter.h"
4 #include <bpf/bpf_helpers.h>
6 char _license[] SEC("license") = "GPL";
7 int count = 0;
9 SEC("iter/task")
10 int dump_task(struct bpf_iter__task *ctx)
12 struct seq_file *seq = ctx->meta->seq;
13 char c;
15 if (count < 4) {
16 c = START_CHAR + count;
17 bpf_seq_write(seq, &c, sizeof(c));
18 count++;
21 return 0;