On Tue, 22 Aug 2023 at 10:43, Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > On Wed, Aug 09, 2023 at 05:11:05PM +0530, Kumar Kartikeya Dwivedi wrote: > > + > > +static bool bpf_stack_walker(void *cookie, u64 ip, u64 sp, u64 bp) > > +{ > > + struct bpf_throw_ctx *ctx = cookie; > > + struct bpf_prog *prog; > > + > > + if (!is_bpf_text_address(ip)) > > + return !ctx->cnt; > > + prog = bpf_prog_ksym_find(ip); > > + ctx->cnt++; > > + if (!prog->aux->id) > > + return true; > > + ctx->aux = prog->aux; > > + ctx->sp = sp; > > + ctx->bp = bp; > > + return false; > > +} > > Took me some time to understand what !prog->aux->id is doing. > Let's add a helper: is_subprog() and check: > prog->aux->func_idx != 0 > since that's what arm64, x64, s390 JITs are using. Ack, I will fix it.