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

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

DEFINITIONS

This source file includes following definitions.
  1. SEC

   1 // SPDX-License-Identifier: GPL-2.0
   2 
   3 #include <linux/bpf.h>
   4 #include "bpf_helpers.h"
   5 
   6 #define MAX_STACK_RAWTP 10
   7 
   8 SEC("raw_tracepoint/sys_enter")
   9 int bpf_prog2(void *ctx)
  10 {
  11         __u64 stack[MAX_STACK_RAWTP];
  12         int error;
  13 
  14         /* set all the flags which should return -EINVAL */
  15         error = bpf_get_stack(ctx, stack, 0, -1);
  16         if (error < 0)
  17                 goto loop;
  18 
  19         return error;
  20 loop:
  21         while (1) {
  22                 error++;
  23         }
  24 }
  25 
  26 char _license[] SEC("license") = "GPL";

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