Skip to content

Commit ac43e68

Browse files
authored
DLPX-75470 estat zpl and arc_prefetch scripts need znode parameter (#61) (#64)
1 parent 8d5620b commit ac43e68

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

bpf/estat/zpl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ equal_to_pool(char *str)
4646
}
4747

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

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

7373
// @@ kprobe|zfs_read|zfs_read_entry
7474
int
75-
zfs_read_entry(struct pt_regs *ctx, struct inode *ip, uio_t *uio, int flags)
75+
zfs_read_entry(struct pt_regs *ctx, struct znode *zn, zfs_uio_t *uio, int flags)
7676
{
7777
io_info_t info = {};
7878
info.is_write = false;
79-
return (zfs_read_write_entry(&info, ip, uio, flags));
79+
return (zfs_read_write_entry(&info, zn, uio, flags));
8080
}
8181

8282
// @@ kprobe|zfs_write|zfs_write_entry
8383
int
84-
zfs_write_entry(struct pt_regs *ctx, struct inode *ip, uio_t *uio, int flags)
84+
zfs_write_entry(struct pt_regs *ctx, struct znode *zn, zfs_uio_t *uio, int flags)
8585
{
8686
io_info_t info = {};
8787
info.is_write = true;
88-
return (zfs_read_write_entry(&info, ip, uio, flags));
88+
return (zfs_read_write_entry(&info, zn, uio, flags));
8989
}
9090

9191
// @@ kretprobe|zfs_read|zfs_read_write_exit
9292
// @@ kretprobe|zfs_write|zfs_read_write_exit
9393
int
94-
zfs_read_write_exit(struct pt_regs *ctx, struct inode *ip, uio_t *uio)
94+
zfs_read_write_exit(struct pt_regs *ctx, struct znode *zn, zfs_uio_t *uio)
9595
{
9696
u32 tid = bpf_get_current_pid_tgid();
9797
io_info_t *info = io_info_map.lookup(&tid);

bpf/standalone/arc_prefetch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@
8989
BPF_HASH(read_average, lat_key, average_t);
9090
BPF_PERCPU_ARRAY(arc_count, u32, NCOUNT_INDEX);
9191
92-
int zfs_read_entry(struct pt_regs *ctx, struct inode *ip)
92+
int zfs_read_entry(struct pt_regs *ctx, struct znode *zn)
9393
{
9494
u32 tid = bpf_get_current_pid_tgid();
9595
u64 ts = bpf_ktime_get_ns();
9696
arc_prefetch_info_t info = {ts};
9797
9898
// filter by pool
99-
zfsvfs_t *zfsvfs = ip->i_sb->s_fs_info;
99+
zfsvfs_t *zfsvfs = zn->z_inode.i_sb->s_fs_info;
100100
objset_t *z_os = zfsvfs->z_os;
101101
spa_t *spa = z_os->os_spa;
102102
if (POOL_COMPARE(spa))

0 commit comments

Comments
 (0)