aboutsummaryrefslogtreecommitdiff
path: root/include/exec/log.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-04-17 11:29:49 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-04-20 10:51:11 -0700
commit78b548583e0725bb7054162a31dac552b01c02a8 (patch)
treee8e56b975713665391fddd1534e8642ed000c29f /include/exec/log.h
parent6fef222971e1f77d1e7b6c218edce72ceb568126 (diff)
downloadqemu-78b548583e0725bb7054162a31dac552b01c02a8.zip
qemu-78b548583e0725bb7054162a31dac552b01c02a8.tar.gz
qemu-78b548583e0725bb7054162a31dac552b01c02a8.tar.bz2
*: 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>
Diffstat (limited to 'include/exec/log.h')
-rw-r--r--include/exec/log.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/exec/log.h b/include/exec/log.h
index fb595d1..648f4d2 100644
--- a/include/exec/log.h
+++ b/include/exec/log.h
@@ -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);