Linux Audio

Check our new training course

Linux kernel drivers training

May 6-19, 2025
Register
Loading...
Note: File does not exist in v4.6.
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright (c) 2020 Facebook */
 3#include <vmlinux.h>
 4#include <bpf/bpf_helpers.h>
 5
 6char _license[] SEC("license") = "GPL";
 7int count = 0;
 8
 9SEC("iter/task")
10int dump_task(struct bpf_iter__task *ctx)
11{
12	struct seq_file *seq = ctx->meta->seq;
13	char c;
14
15	if (count < 4) {
16		c = START_CHAR + count;
17		bpf_seq_write(seq, &c, sizeof(c));
18		count++;
19	}
20
21	return 0;
22}