Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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(struct pt_regs *ctx)
11{
12 volatile __u64 i = 0, sum = 0;
13 do {
14 i++;
15 sum += PT_REGS_RC(ctx);
16 } while (i < 0x100000000ULL);
17 return sum;
18}