[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 11/12] linux-user: Add support for KCOV_<ENABLE|DISABLE> ioctl
From: |
Aleksandar Markovic |
Subject: |
[PATCH v3 11/12] linux-user: Add support for KCOV_<ENABLE|DISABLE> ioctls |
Date: |
Fri, 3 Jan 2020 23:18:01 +0100 |
From: Aleksandar Markovic <address@hidden>
KCOV_ENABLE and KCOV_DISABLE play the role in kernel coverage
tracing. These ioctls do not use the third argument of ioctl()
system call and are straightforward to implement in QEMU.
Signed-off-by: Aleksandar Markovic <address@hidden>
---
linux-user/ioctls.h | 5 +++++
linux-user/syscall.c | 3 +++
linux-user/syscall_defs.h | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 060ab28..6be143a 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -543,3 +543,8 @@
IOCTL_IGNORE(TIOCSTART)
IOCTL_IGNORE(TIOCSTOP)
#endif
+
+#ifdef CONFIG_KCOV
+ IOCTL(KCOV_ENABLE, 0, TYPE_NULL)
+ IOCTL(KCOV_DISABLE, 0, TYPE_NULL)
+#endif
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 171c0ca..6edcb0d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -73,6 +73,9 @@
#ifdef CONFIG_SENDFILE
#include <sys/sendfile.h>
#endif
+#ifdef CONFIG_KCOV
+#include <sys/kcov.h>
+#endif
#define termios host_termios
#define winsize host_winsize
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 75604e7..ab4414f 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2454,6 +2454,10 @@ struct target_mtpos {
#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct target_mtget)
#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct target_mtpos)
+/* kcov ioctls */
+#define TARGET_KCOV_ENABLE TARGET_IO('c', 100)
+#define TARGET_KCOV_DISABLE TARGET_IO('c', 101)
+
struct target_sysinfo {
abi_long uptime; /* Seconds since boot */
abi_ulong loads[3]; /* 1, 5, and 15 minute load averages */
--
2.7.4
- [PATCH v3 00/12] linux-user: Misc patches for 5.0, Aleksandar Markovic, 2020/01/03
- [PATCH v3 04/12] linux-user: Add support for FS_IOC32_<GET|SET>FLAGS ioctls, Aleksandar Markovic, 2020/01/03
- [PATCH v3 03/12] linux-user: Add support for FS_IOC_<GET|SET>VERSION ioctls, Aleksandar Markovic, 2020/01/03
- [PATCH v3 10/12] configure: Detect kcov support and introduce CONFIG_KCOV, Aleksandar Markovic, 2020/01/03
- [PATCH v3 11/12] linux-user: Add support for KCOV_<ENABLE|DISABLE> ioctls,
Aleksandar Markovic <=
- [PATCH v3 06/12] linux-user: Add support for FS_IOC_FS<GET|SET>XATTR ioctls, Aleksandar Markovic, 2020/01/03
- [PATCH v3 07/12] linux-user: Add support for FD<SETEMSGTRESH|SETMAXERRS|GETMAXERRS> ioctls, Aleksandar Markovic, 2020/01/03
- [PATCH v3 02/12] linux-user: mips: Update syscall numbers to kernel 5.5 rc3 level, Aleksandar Markovic, 2020/01/03
- [PATCH v3 08/12] linux-user: Add support for FDFMT<BEG|TRK|END> ioctls, Aleksandar Markovic, 2020/01/03
- [PATCH v3 12/12] linux-user: Add support for KCOV_INIT_TRACE ioctl, Aleksandar Markovic, 2020/01/03
- [PATCH v3 09/12] linux-user: Add support for FDGETFDCSTAT ioctl, Aleksandar Markovic, 2020/01/03
- [PATCH v3 05/12] linux-user: Add support for FS_IOC32_<GET|SET>VERSION ioctls, Aleksandar Markovic, 2020/01/03
- [PATCH v3 01/12] linux-user: Fix some constants in termbits.h, Aleksandar Markovic, 2020/01/03