#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"
char _license[] SEC("license") = "GPL";
#define C(fn, off) "r1 = r10;" \
"r1 += -" #off ";" \
"call " #fn ";"
#define CALLS_50(fn) \
C(fn, 8) C(fn, 16) C(fn, 24) C(fn, 32) C(fn, 40) \
C(fn, 48) C(fn, 56) C(fn, 64) C(fn, 72) C(fn, 80) \
C(fn, 88) C(fn, 96) C(fn, 104) C(fn, 112) C(fn, 120) \
C(fn, 128) C(fn, 136) C(fn, 144) C(fn, 152) C(fn, 160) \
C(fn, 168) C(fn, 176) C(fn, 184) C(fn, 192) C(fn, 200) \
C(fn, 208) C(fn, 216) C(fn, 224) C(fn, 232) C(fn, 240) \
C(fn, 248) C(fn, 256) C(fn, 264) C(fn, 272) C(fn, 280) \
C(fn, 288) C(fn, 296) C(fn, 304) C(fn, 312) C(fn, 320) \
C(fn, 328) C(fn, 336) C(fn, 344) C(fn, 352) C(fn, 360) \
C(fn, 368) C(fn, 376) C(fn, 384) C(fn, 392) C(fn, 400)
__naked __noinline __used
static unsigned long exp_sub7(void)
{
asm volatile (
"r0 = 0;"
"exit;"
::: __clobber_all);
}
__naked __noinline __used
static unsigned long exp_sub6(void)
{
asm volatile (
CALLS_50(exp_sub7)
"r0 = 0;"
"exit;"
::: __clobber_all);
}
__naked __noinline __used
static unsigned long exp_sub5(void)
{
asm volatile (
CALLS_50(exp_sub6)
"r0 = 0;"
"exit;"
::: __clobber_all);
}
__naked __noinline __used
static unsigned long exp_sub4(void)
{
asm volatile (
CALLS_50(exp_sub5)
"r0 = 0;"
"exit;"
::: __clobber_all);
}
__naked __noinline __used
static unsigned long exp_sub3(void)
{
asm volatile (
CALLS_50(exp_sub4)
"r0 = 0;"
"exit;"
::: __clobber_all);
}
__naked __noinline __used
static unsigned long exp_sub2(void)
{
asm volatile (
CALLS_50(exp_sub3)
"r0 = 0;"
"exit;"
::: __clobber_all);
}
__naked __noinline __used
static unsigned long exp_sub1(void)
{
asm volatile (
CALLS_50(exp_sub2)
"r0 = 0;"
"exit;"
::: __clobber_all);
}
SEC("?raw_tp")
__failure __log_level(2)
__msg("liveness analysis exceeded complexity limit")
__naked int liveness_exponential_complexity(void)
{
asm volatile (
CALLS_50(exp_sub1)
"r0 = 0;"
"exit;"
::: __clobber_all);
}