On Fri, 9 May 2025 at 00:38, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > On Wed, 2025-05-07 at 10:17 -0700, Kumar Kartikeya Dwivedi wrote: > > [...] > > > +static bool dump_stack_cb(void *cookie, u64 ip, u64 sp, u64 bp) > > +{ > > + struct dump_stack_ctx *ctxp = cookie; > > + const char *file = "", *line = ""; > > + struct bpf_prog *prog; > > + int num; > > + > > + if (is_bpf_text_address(ip)) { > > + prog = bpf_prog_ksym_find(ip); > > + num = bpf_prog_get_file_line(prog, ip, &file, &line); > > + if (num == -1) > > + goto end; > > Should this be `num < 0` ? > bpf_prog_get_file_line() can return -EINVAL and -ENOENT. My bad, I modified the error code when cleaning it up but forgot to change caller, thanks for catching it. > > > + ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n %s @ %s:%d\n", > > + (void *)ip, line, file, num); > > + return !ctxp->err; > > + } > > +end: > > + ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n", (void *)ip); > > + return !ctxp->err; > > +} > > [...] >