Bug 29388 - Support using systemtap with overlayfs
Summary: Support using systemtap with overlayfs
Status: UNCONFIRMED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-20 01:41 UTC by Jhan-Shuo Liu
Modified: 2022-07-20 01:48 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jhan-Shuo Liu 2022-07-20 01:41:06 UTC
When using systemtap with overlay filesystem, we need to get real inode and pass it into uprobe_register function. Otherwise, there will be an inode error. To fix the problem, we need to modify 4 places in runtime/linux/uprobes-inode.c file to let systemtap get the real inode value. The following is the way to support this feature.

733c733
---                     inode = vm_file->f_path.dentry->d_inode;
+++                     inode = d_real_inode(vm_file->f_path.dentry);
915c915
---     p->inode = dentry->d_inode;
+++     p->inode = d_real_inode(dentry);
928c928
---                          offset, vm_flags, dentry->d_inode);
+++                          offset, vm_flags, d_real_inode(dentry));
938c938
---   rc = stapiu_change_semaphore_plus(c, task, addr, dentry->d_inode);
+++   rc = stapiu_change_semaphore_plus(c, task, addr, d_real_inode(dentry));
Comment 1 Frank Ch. Eigler 2022-07-20 01:48:40 UTC
Those sound like usable porting options, yup.  Since the runtime is compiled on a wide range of kernel versions (2.6.32+ believe it, or not), we may well need some compile-time protection for the macro/function.