On Thu, 28 Aug 2025 at 11:58, Arnaldo Carvalho de Melo <arnaldo.melo@xxxxxxxxx> wrote: > > > >Give the damn thing an actual filename or something *useful*, not a > >number that user space can't even necessarily match up to anything. > > A build ID? I think that's a better thing than the disgusting inode number, yes. That said, I think they are problematic too, in that I don't think they are universally available, so if you want to trace some executable without build ids - and there are good reasons to do that - you might hate being limited that way. So I think you'd be much better off with just actual pathnames. Are there no trace events for "mmap this path"? Create a good u64 hash from the contents of a 'struct path' (which is just two pointers: the dentry and the mnt) when mmap'ing the file, and then you can just associate the stack trace entry with that hash. That should be simple and straightforward, and hashing two pointers should be simple and straightforward. And then matching that hash against the mmap event where the actual path was saved off gives you an actual *pathname*. Which is *so* much better than those horrific inode numbers. And yes, yes, obviously filenames can go away and aren't some kind of long-term stable thing. But inode numbers can be re-used too, so that's no different. With the "create a hash of 'struct path' contents" you basically have an ID that can be associated with whatever the file name was at the time it was mmap'ed into the thing you are tracing, which is I think what you really want anyway. Now, what would be even simpler is to not create a hash at all, but simply just create the whole pathname when the stack trace entry is created. But it would probably waste too much space, since you'd probably want to have at least 32 bytes (as opposed to just 64 bits) for a (truncated) pathname. And it would be more expensive than just hashing the dentry/mnt pointers, although '%pD' isn't actually *that* expensive. But probably expensive enough to not really be acceptable. I'm just throwing it out as a stupid idea that at least generates much more usable output than the inode numbers do. Linus