linux-user: Expand log_page_dump inline

We have extra stuff to log at the same time.
Hoist the qemu_log_lock/unlock to the caller and use fprintf.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417183019.755276-23-richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2022-04-17 11:30:02 -07:00
parent 43b761618d
commit 93756fdcf6
3 changed files with 35 additions and 30 deletions

View file

@ -42,19 +42,4 @@ static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
}
}
#ifdef NEED_CPU_H
#if defined(CONFIG_USER_ONLY)
/* page_dump() output to the log file: */
static inline void log_page_dump(const char *operation)
{
FILE *logfile = qemu_log_trylock();
if (logfile) {
fprintf(logfile, "page layout changed following %s\n", operation);
page_dump(logfile);
}
qemu_log_unlock(logfile);
}
#endif
#endif
#endif