__noinline int global_subprog(struct __sk_buff *ctx)
{ volatileint ret = 0;
if (ctx->protocol)
ret += ctx->protocol; return ret + ctx->mark;
}
__noinline staticint static_subprog_call_global(struct __sk_buff *ctx)
{ volatileint ret = 0;
if (ctx->protocol) return ret; return ret + ctx->len + global_subprog(ctx);
}
SEC("?tc") int lock_global_subprog_call1(struct __sk_buff *ctx)
{ int ret = 0;
bpf_spin_lock(&lockA); if (ctx->mark == 42)
ret = global_subprog(ctx);
bpf_spin_unlock(&lockA); return ret;
}
SEC("?tc") int lock_global_subprog_call2(struct __sk_buff *ctx)
{ int ret = 0;
bpf_spin_lock(&lockA); if (ctx->mark == 42)
ret = static_subprog_call_global(ctx);
bpf_spin_unlock(&lockA); return ret;
}
int __noinline
global_subprog_int(int i)
{ if (i)
bpf_printk("%p", &i); return i;
}
int __noinline
global_sleepable_helper_subprog(int i)
{ if (i)
bpf_copy_from_user(&i, sizeof(i), NULL); return i;
}
int __noinline
global_sleepable_kfunc_subprog(int i)
{ if (i)
bpf_copy_from_user_str(&i, sizeof(i), NULL, 0);
global_subprog_int(i); return i;
}
int __noinline
global_subprog_calling_sleepable_global(int i)
{ if (!i)
global_sleepable_kfunc_subprog(i); return i;
}
SEC("?syscall") int lock_global_sleepable_helper_subprog(struct __sk_buff *ctx)
{ int ret = 0;
bpf_spin_lock(&lockA); if (ctx->mark == 42)
ret = global_sleepable_helper_subprog(ctx->mark);
bpf_spin_unlock(&lockA); return ret;
}
SEC("?syscall") int lock_global_sleepable_kfunc_subprog(struct __sk_buff *ctx)
{ int ret = 0;
bpf_spin_lock(&lockA); if (ctx->mark == 42)
ret = global_sleepable_kfunc_subprog(ctx->mark);
bpf_spin_unlock(&lockA); return ret;
}
SEC("?syscall") int lock_global_sleepable_subprog_indirect(struct __sk_buff *ctx)
{ int ret = 0;
bpf_spin_lock(&lockA); if (ctx->mark == 42)
ret = global_subprog_calling_sleepable_global(ctx->mark);
bpf_spin_unlock(&lockA); return ret;
}
char _license[] SEC("license") = "GPL";
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
(vorverarbeitet am 2026-04-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.