summaryrefslogtreecommitdiff
path: root/src/defs.h
diff options
context:
space:
mode:
authorMasatake YAMATO <yamato@redhat.com>2022-03-11 17:52:37 +0900
committerDmitry V. Levin <ldv@strace.io>2023-02-20 08:00:00 +0000
commitc15a5b82351bfd7e4116a8ed83f769543c5227b9 (patch)
treefd2eda0d8a3890b52669434dfaa1ff0905ee9ee3 /src/defs.h
parent940b43ed6986b3734b8e2dc1867543c120173fbf (diff)
downloadstrace-c15a5b82351bfd7e4116a8ed83f769543c5227b9.tar.gz
ioctl: collect finfo just before decoding ioctl command
This way finfo can be used as hints for decoding ioctl commands. * src/defs.h (get_finfo_for_dev): New declaration. (printfd_with_finfo): New inline function - a thin wrapper around printfd_pid_with_finfo. * src/util.c (get_finfo_for_dev): Remove static modifier to make it reusable the ioctl syscall decoder. (SYS_FUNC(ioctl)): Call get_finfo_for_dev and printfd_with_finfo instead of calling printfd. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Dmitry V. Levin <ldv@strace.io>
Diffstat (limited to 'src/defs.h')
-rw-r--r--src/defs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/defs.h b/src/defs.h
index 1b5f90e01..3a2bdcfae 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -671,6 +671,9 @@ struct finfo {
} dev;
};
+extern struct finfo *
+get_finfo_for_dev(const char *path, struct finfo *finfo);
+
/**
* @return 0 on success, -1 on error.
*/
@@ -1240,6 +1243,12 @@ printfd(struct tcb *tcp, int fd)
printfd_pid(tcp, tcp->pid, fd);
}
+static inline void
+printfd_with_finfo(struct tcb *tcp, int fd, const struct finfo *finfo)
+{
+ printfd_pid_with_finfo(tcp, tcp->pid, fd, finfo);
+}
+
/**
* Helper function, converts pid to string, or to "self" for pid == 0.
* Uses static buffer for operation.