[Bug tapsets/17920] New: File descriptor to pathname function

brendan.d.gregg at gmail dot com sourceware-bugzilla@sourceware.org
Tue Feb 3 18:25:00 GMT 2015


https://sourceware.org/bugzilla/show_bug.cgi?id=17920

            Bug ID: 17920
           Summary: File descriptor to pathname function
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: brendan.d.gregg at gmail dot com

FD to pathname translations are handy. Eg:

# ls -l /proc/1130/fd/1
l-wx------ 1 root root 64 Feb  3 18:21 /proc/1130/fd/1 ->
/mnt/logs/system/auth.log

I'd like a function in SystemTap that converts an integer file descriptor, for
the current process/task, to the pathname as seen by /proc/PID/fd. Without
needing kernel debuginfo (/proc/PID/fd doesn't need it).

The use case is identifying which file system files are being opened, read, and
written to. Other file descriptor types, like pipes and sockets, are less
important. I'd be fine with them returning just "[socket]" for now, or, better
still, just match what /proc already uses. Eg:

# ls -l /proc/18959/fd/3
lr-x------ 1 root root 64 Feb  3 18:20 /proc/18959/fd/3 -> socket:[181107359]

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Systemtap mailing list