Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v5.4 28 lines 524 B view raw
1// SPDX-License-Identifier: GPL-2.0 2// Copyright (c) 2019 Facebook 3#include <linux/sched.h> 4#include <linux/ptrace.h> 5#include <stdint.h> 6#include <stddef.h> 7#include <stdbool.h> 8#include <linux/bpf.h> 9#include "bpf_helpers.h" 10 11char _license[] SEC("license") = "GPL"; 12 13SEC("raw_tracepoint/kfree_skb") 14int nested_loops(volatile struct pt_regs* ctx) 15{ 16 int i, j, sum = 0, m; 17 18 for (j = 0; j < 300; j++) 19 for (i = 0; i < j; i++) { 20 if (j & 1) 21 m = PT_REGS_RC(ctx); 22 else 23 m = j; 24 sum += i * m; 25 } 26 27 return sum; 28}