On Mon, Dec 30, 2024 at 12:49:45PM -0800, Alexei Starovoitov wrote: > On Mon, Dec 30, 2024 at 12:46 PM Daniel Xu <dxu@xxxxxxxxx> wrote: > > > > Hi, > > > > I was poking around bpftrace test suite and noticed that our d_path() > > wrapper is truncating at the beginning of the path. See [0] for an > > example. > > > > bpftrace codegen doesn't do anything fancy here. And I see in the kernel > > d_path() implementation there's some prepend logic going on. > > > > I wanted to confirm this is the expected behavior. And if so, whether it > > should be documented. > > This is expected behavior when the buffer is too small. > bpftrace may react to the -ENAMETOOLONG error code in such a case. Got it, thanks. I've sent a patch to document this in uapi/bpf.h. Seems like a good thing to do.