mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
*: Use fprintf between qemu_log_trylock/unlock
Inside qemu_log, we perform qemu_log_trylock/unlock, which need not be done if we have already performed the lock beforehand. Always check the result of qemu_log_trylock -- only checking qemu_loglevel_mask races with the acquisition of the lock on the logfile. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220417183019.755276-10-richard.henderson@linaro.org>
This commit is contained in:
parent
6fef222971
commit
78b548583e
9 changed files with 162 additions and 132 deletions
|
@ -73,7 +73,7 @@ static inline void log_page_dump(const char *operation)
|
|||
{
|
||||
FILE *logfile = qemu_log_trylock();
|
||||
if (logfile) {
|
||||
qemu_log("page layout changed following %s\n", operation);
|
||||
fprintf(logfile, "page layout changed following %s\n", operation);
|
||||
page_dump(logfile);
|
||||
}
|
||||
qemu_log_unlock(logfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue