iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.45k stars 3.86k forks source link

Feature request: Show Full path in zfsslower #1954

Open jan-rosendahl opened 6 years ago

jan-rosendahl commented 6 years ago

Is it possible to add an option to tools/zfsslower that allows for absolute/full paths to be displayed?

In our setup we have a lot of automatically generated files which have similar or identical files names so we need the full path to distinguish them. I assume this can be handy in a variety of different situations.

I tried to extract the information from valp->fp->f_path.dentry but gave up after some time. Trying to use dentry_path_raw(valp->fp->f_path.dentry, CHAR_ARRAY, ARRAY_LENGTH) as suggested by https://stackoverflow.com/questions/17216856/how-to-get-full-pathname-from-struct-dentry-in-linux-kernel yielded: LLVM ERROR: Program used external function 'dentry_path' which could not be resolved!

Do the open issues https://github.com/iovisor/bcc/issues/366 and https://github.com/iovisor/bcc/issues/365 indicate that this is currently not supported?

yonghong-song commented 6 years ago

This will be probably hard to implement inside the bpf program since involves recursively visiting the parents. Maybe you could come up with a reasonable interface for a helper?

201341 commented 5 years ago

are there some solutions for the problem now? @yonghong-song Maybe https://github.com/iovisor/bpftrace/issues/29 is a good idea. And the open issues #365 and #366 are another choices.