Skip to content

Commit

Permalink
tools/ttysnoop: Fix KFUNC_PROBE to support new iov_iter signature
Browse files Browse the repository at this point in the history
Kernel commit [1] used ->iter_type and ->data_source instead of ->type

[1] 8cd54c1c8480 iov_iter: separate direction from flavour

Signed-off-by: Sina Radmehr <[email protected]>
  • Loading branch information
Sina Radmehr authored and yonghong-song committed Sep 15, 2021
1 parent 598aba3 commit 68f294f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tools/ttysnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,20 @@ def usage():
if (iocb->ki_filp->f_inode->i_ino != PTS)
return 0;
/**
* commit 8cd54c1c8480 iov_iter: separate direction from flavour
* `type` is represented by iter_type and data_source seperately
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
if (from->type != (ITER_IOVEC + WRITE))
return 0;
#else
if (from->iter_type != ITER_IOVEC)
return 0;
if (from->data_source != WRITE)
return 0;
#endif
kvec = from->kvec;
buf = kvec->iov_base;
Expand Down

0 comments on commit 68f294f

Please sign in to comment.