Skip to content

DLPX-75470 estat zpl and arc_prefetch scripts need znode parameter (#61) #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bpf/estat/zpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ equal_to_pool(char *str)
}

static inline int
zfs_read_write_entry(io_info_t *info, struct inode *ip, uio_t *uio, int flags)
zfs_read_write_entry(io_info_t *info, struct znode *zn, zfs_uio_t *uio, int flags)
{
// Essentially ITOZSB, but written explicitly so that BCC can insert
// the necessary calls to bpf_probe_read.
zfsvfs_t *zfsvfs = ip->i_sb->s_fs_info;
zfsvfs_t *zfsvfs = zn->z_inode.i_sb->s_fs_info;

objset_t *z_os = zfsvfs->z_os;
spa_t *spa = z_os->os_spa;
Expand All @@ -72,26 +72,26 @@ zfs_read_write_entry(io_info_t *info, struct inode *ip, uio_t *uio, int flags)

// @@ kprobe|zfs_read|zfs_read_entry
int
zfs_read_entry(struct pt_regs *ctx, struct inode *ip, uio_t *uio, int flags)
zfs_read_entry(struct pt_regs *ctx, struct znode *zn, zfs_uio_t *uio, int flags)
{
io_info_t info = {};
info.is_write = false;
return (zfs_read_write_entry(&info, ip, uio, flags));
return (zfs_read_write_entry(&info, zn, uio, flags));
}

// @@ kprobe|zfs_write|zfs_write_entry
int
zfs_write_entry(struct pt_regs *ctx, struct inode *ip, uio_t *uio, int flags)
zfs_write_entry(struct pt_regs *ctx, struct znode *zn, zfs_uio_t *uio, int flags)
{
io_info_t info = {};
info.is_write = true;
return (zfs_read_write_entry(&info, ip, uio, flags));
return (zfs_read_write_entry(&info, zn, uio, flags));
}

// @@ kretprobe|zfs_read|zfs_read_write_exit
// @@ kretprobe|zfs_write|zfs_read_write_exit
int
zfs_read_write_exit(struct pt_regs *ctx, struct inode *ip, uio_t *uio)
zfs_read_write_exit(struct pt_regs *ctx, struct znode *zn, zfs_uio_t *uio)
{
u32 tid = bpf_get_current_pid_tgid();
io_info_t *info = io_info_map.lookup(&tid);
Expand Down
4 changes: 2 additions & 2 deletions bpf/standalone/arc_prefetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@
BPF_HASH(read_average, lat_key, average_t);
BPF_PERCPU_ARRAY(arc_count, u32, NCOUNT_INDEX);

int zfs_read_entry(struct pt_regs *ctx, struct inode *ip)
int zfs_read_entry(struct pt_regs *ctx, struct znode *zn)
{
u32 tid = bpf_get_current_pid_tgid();
u64 ts = bpf_ktime_get_ns();
arc_prefetch_info_t info = {ts};

// filter by pool
zfsvfs_t *zfsvfs = ip->i_sb->s_fs_info;
zfsvfs_t *zfsvfs = zn->z_inode.i_sb->s_fs_info;
objset_t *z_os = zfsvfs->z_os;
spa_t *spa = z_os->os_spa;
if (POOL_COMPARE(spa))
Expand Down