root/tools/testing/selftests/bpf/progs/loop3.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. SEC

   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 
  11 char _license[] SEC("license") = "GPL";
  12 
  13 SEC("raw_tracepoint/consume_skb")
  14 int while_true(volatile struct pt_regs* ctx)
  15 {
  16         __u64 i = 0, sum = 0;
  17         do {
  18                 i++;
  19                 sum += PT_REGS_RC(ctx);
  20         } while (i < 0x100000000ULL);
  21         return sum;
  22 }

/* [<][>][^][v][top][bottom][index][help] */