summaryrefslogtreecommitdiffstats
path: root/include/exec
diff options
context:
space:
mode:
authorAlex Bennée2019-12-05 13:25:15 +0100
committerAlex Bennée2019-12-19 09:20:16 +0100
commit10d0d505de750590c21a78c0652bf5a9c142302a (patch)
tree3b1038de85afaa311646fcd2f1cba666db4d22f1 /include/exec
parentlinux-user: add target_mmap_complete tracepoint (diff)
downloadqemu-10d0d505de750590c21a78c0652bf5a9c142302a.tar.gz
qemu-10d0d505de750590c21a78c0652bf5a9c142302a.tar.xz
qemu-10d0d505de750590c21a78c0652bf5a9c142302a.zip
linux-user: log page table changes under -d page
The CPU_LOG_PAGE flag is woefully underused and could stand to do extra duty tracking page changes. If the user doesn't want to see the details as things change they still have the tracepoints available. We push the locking into log_page_dump and pass a reason for the banner text. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20191205122518.10010-5-alex.bennee@linaro.org>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/log.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/exec/log.h b/include/exec/log.h
index 9bd1e4aa20..fcc7b9e00b 100644
--- a/include/exec/log.h
+++ b/include/exec/log.h
@@ -69,15 +69,14 @@ static inline void log_disas(void *code, unsigned long size)
#if defined(CONFIG_USER_ONLY)
/* page_dump() output to the log file: */
-static inline void log_page_dump(void)
+static inline void log_page_dump(const char *operation)
{
- QemuLogFile *logfile;
- rcu_read_lock();
- logfile = atomic_rcu_read(&qemu_logfile);
+ FILE *logfile = qemu_log_lock();
if (logfile) {
- page_dump(logfile->fd);
+ qemu_log("page layout changed following %s\n", operation);
+ page_dump(logfile);
}
- rcu_read_unlock();
+ qemu_log_unlock(logfile);
}
#endif
#endif