-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
Description
Would like a macro or function for mapping a file descriptor to a pathname. I was trying something like (this may be wrong):
#include <uapi/linux/ptrace.h>
#include <linux/sched.h>
#include <linux/fdtable.h>
int kprobe__vfs_fstat(struct pt_regs *ctx, unsigned int fd)
{
struct file *file = (struct file *)¤t->files->fdt[fd];
bpf_trace_printk("fstat file %d %s\\n", fd, file->f_path.dentry->d_iname);
return 0;
}and got:
error: couldn't allocate output register for constraint 'r' at line 2148418561Reactions are currently unavailable