File Index
Files and directories
Sign in
FILE

loop2.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/loop2.c C
 1// SPDX-License-Identifier: GPL-2.0
 2// Copyright (c) 2019 Facebook
 3#include "vmlinux.h"
 4#include <bpf/bpf_helpers.h>
 5#include <bpf/bpf_tracing.h>
 6
 7char _license[] SEC("license") = "GPL";
 8
 9SEC("raw_tracepoint/consume_skb")
10int while_true(volatile struct pt_regs* ctx)
11{
12	int i = 0;
13
14	while (true) {
15		if (PT_REGS_RC(ctx) & 1)
16			i += 3;
17		else
18			i += 7;
19		if (i > 40)
20			break;
21	}
22
23	return i;
24}
~/ Read-only file preview.