WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / bpf_iter_test_kern3.c
blob2a4647f20c466b1735cf09e28b8583c15255f8a5
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";
8 SEC("iter/task")
9 int dump_task(struct bpf_iter__task *ctx)
11 struct seq_file *seq = ctx->meta->seq;
12 struct task_struct *task = ctx->task;
13 int tgid;
15 tgid = task->tgid;
16 bpf_seq_write(seq, &tgid, sizeof(tgid));
17 return 0;