Branch: refs/heads/staging Home: https://github.com/qemu/qemu Commit: 54ee5b3da00cdbee836a06a7e6eb319c895f2a57 https://github.com/qemu/qemu/commit/54ee5b3da00cdbee836a06a7e6eb319c895f2a57 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022)
Changed paths: M bsd-user/main.c M include/qemu/log.h M linux-user/main.c M util/log.c Log Message: ----------- util/log: Drop manual log buffering This buffering was introduced during the Paleozoic: 9fa3e853531. There has never been an explanation as to why we may not allow glibc to allocate the file buffer itself. We certainly have many other uses of mmap and malloc during user-only startup, so presumably whatever the issue was, it has been fixed during the preceeding 18 years. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-2-richard.hender...@linaro.org> Commit: eecb0c4e1125c751ded392456b43a036e8efe1ab https://github.com/qemu/qemu/commit/eecb0c4e1125c751ded392456b43a036e8efe1ab Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M target/hexagon/translate.c Log Message: ----------- target/hexagon: Remove qemu_set_log in hexagon_translate_init This code appears to be trying to make sure there is a logfile. But that's already true -- the logfile will either be set by -D, or will be stderr. In either case, not appropriate here. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-3-richard.hender...@linaro.org> Commit: e2c7c6a454c2c4221461aa04e4061dbb91b4986c https://github.com/qemu/qemu/commit/e2c7c6a454c2c4221461aa04e4061dbb91b4986c Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log.h M monitor/misc.c M util/log.c Log Message: ----------- util/log: Return bool from qemu_set_log_filename Per the recommendations in qapi/error.h, return false on failure. Use the return value in the monitor, the only place we aren't already passing error_fatal or error_abort. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-4-richard.hender...@linaro.org> Commit: c5955f4ff4689b7a04cf0a1109fa97ce885876b4 https://github.com/qemu/qemu/commit/c5955f4ff4689b7a04cf0a1109fa97ce885876b4 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M bsd-user/main.c M include/qemu/log.h M linux-user/main.c M monitor/misc.c M qemu-img.c M qemu-io.c M qemu-nbd.c M scsi/qemu-pr-helper.c M softmmu/vl.c M storage-daemon/qemu-storage-daemon.c M tests/unit/test-logging.c M util/log.c Log Message: ----------- util/log: Pass Error pointer to qemu_set_log Do not force exit within qemu_set_log; return bool and pass an Error value back up the stack as per usual. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-5-richard.hender...@linaro.org> Commit: 229ef2eb440d92df1bb663b45e57c3e3008aae13 https://github.com/qemu/qemu/commit/229ef2eb440d92df1bb663b45e57c3e3008aae13 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M os-posix.c Log Message: ----------- os-posix: Use qemu_log_enabled Do not reference qemu_logfile directly; use the predicate provided by qemu/log.h. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-6-richard.hender...@linaro.org> Commit: c59fe6e536adfb2d6f3410f19d592496933f68de https://github.com/qemu/qemu/commit/c59fe6e536adfb2d6f3410f19d592496933f68de Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log.h M util/log.c Log Message: ----------- util/log: Move qemu_log_lock, qemu_log_unlock out of line Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-7-richard.hender...@linaro.org> Commit: c60f599bcb9bf9256eb87c1c60add55d23f76de3 https://github.com/qemu/qemu/commit/c60f599bcb9bf9256eb87c1c60add55d23f76de3 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M accel/tcg/cpu-exec.c M accel/tcg/translate-all.c M accel/tcg/translator.c M cpu.c M hw/net/can/can_sja1000.c M include/exec/log.h M include/qemu/log.h M net/can/can_socketcan.c M target/i386/tcg/translate.c M tcg/tcg.c M tests/unit/test-logging.c M util/log.c Log Message: ----------- util/log: Rename qemu_log_lock to qemu_log_trylock This function can fail, which makes it more like ftrylockfile or pthread_mutex_trylock than flockfile or pthread_mutex_lock, so rename it. To closer match the other trylock functions, release rcu_read_lock along the failure path, so that qemu_log_unlock need not be called on failure. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-8-richard.hender...@linaro.org> Commit: 6fef222971e1f77d1e7b6c218edce72ceb568126 https://github.com/qemu/qemu/commit/6fef222971e1f77d1e7b6c218edce72ceb568126 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M hw/xen/xen_pvdev.c Log Message: ----------- hw/xen: Split out xen_pv_output_msg Do not replicate the individual logging statements. Use qemu_log_trylock/unlock instead of qemu_log directly. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-9-richard.hender...@linaro.org> Commit: 78b548583e0725bb7054162a31dac552b01c02a8 https://github.com/qemu/qemu/commit/78b548583e0725bb7054162a31dac552b01c02a8 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M accel/tcg/cpu-exec.c M accel/tcg/translate-all.c M accel/tcg/translator.c M cpu.c M hw/net/can/can_sja1000.c M include/exec/log.h M net/can/can_socketcan.c M target/i386/tcg/translate.c M tcg/tcg.c Log Message: ----------- *: 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.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-10-richard.hender...@linaro.org> Commit: 3fb659605f45be5abce9d54910334853482d98f7 https://github.com/qemu/qemu/commit/3fb659605f45be5abce9d54910334853482d98f7 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log.h Log Message: ----------- util/log: Remove qemu_log_vprintf This function is no longer used. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-11-richard.hender...@linaro.org> Commit: b7a83ff8df76d7f5a4abddcc01d2478f026dc9e8 https://github.com/qemu/qemu/commit/b7a83ff8df76d7f5a4abddcc01d2478f026dc9e8 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M tcg/tcg.c Log Message: ----------- tcg: Pass the locked filepointer to tcg_dump_ops We have already looked up and locked the filepointer. Use fprintf instead of qemu_log directly for output in and around tcg_dump_ops. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-12-richard.hender...@linaro.org> Commit: 8eb806a763f4a804ac80a6d4f4679c60fd66d8fa https://github.com/qemu/qemu/commit/8eb806a763f4a804ac80a6d4f4679c60fd66d8fa Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M accel/tcg/translator.c M include/exec/translator.h M target/alpha/translate.c M target/arm/translate-a64.c M target/arm/translate.c M target/avr/translate.c M target/cris/translate.c M target/hexagon/translate.c M target/hppa/translate.c M target/i386/tcg/translate.c M target/m68k/translate.c M target/microblaze/translate.c M target/mips/tcg/translate.c M target/nios2/translate.c M target/openrisc/translate.c M target/ppc/translate.c M target/riscv/translate.c M target/rx/translate.c M target/s390x/tcg/translate.c M target/sh4/translate.c M target/sparc/translate.c M target/tricore/translate.c M target/xtensa/translate.c Log Message: ----------- exec/translator: Pass the locked filepointer to disas_log hook We have fetched and locked the logfile in translator_loop. Pass the filepointer down to the disas_log hook so that it need not be fetched and locked again. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-13-richard.hender...@linaro.org> Commit: 7ac5c0b7ba0298f1f3b7f0678abab7ba150ee71f https://github.com/qemu/qemu/commit/7ac5c0b7ba0298f1f3b7f0678abab7ba150ee71f Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/exec/log.h Log Message: ----------- exec/log: Remove log_disas and log_target_disas These functions are no longer used. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-14-richard.hender...@linaro.org> Commit: c769fbd7deca8e47b8b0fd508ba2e5e108c5c5c4 https://github.com/qemu/qemu/commit/c769fbd7deca8e47b8b0fd508ba2e5e108c5c5c4 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M accel/tcg/cpu-exec.c Log Message: ----------- accel/tcg: Use cpu_dump_state between qemu_log_trylock/unlock Inside log_cpu_state, we perform qemu_log_trylock/unlock, which need not be done if we have already performed the lock beforehand. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-15-richard.hender...@linaro.org> Commit: 9aee8f2c299c50bcad3af31c6e2bfdbe27338247 https://github.com/qemu/qemu/commit/9aee8f2c299c50bcad3af31c6e2bfdbe27338247 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M target/nios2/cpu.c Log Message: ----------- target/nios2: Remove log_cpu_state from reset This is redundant with the logging done in cpu_common_reset. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-16-richard.hender...@linaro.org> Commit: 095e9855b774b9da9b84c9cf21cbd856ae482670 https://github.com/qemu/qemu/commit/095e9855b774b9da9b84c9cf21cbd856ae482670 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Use qemu_log_trylock/unlock in qemu_log Avoid using QemuLogFile and RCU directly. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-17-richard.hender...@linaro.org> Commit: 3c06a41746fd0399a182839a6a25c79f1c4ee83a https://github.com/qemu/qemu/commit/3c06a41746fd0399a182839a6a25c79f1c4ee83a Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log-for-trace.h M util/log.c Log Message: ----------- util/log: Drop return value from qemu_log The only user of this feature, tcg_dump_ops, has been converted to use fprintf directly. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-18-richard.hender...@linaro.org> Commit: 27ea81337f7f6d1756c8cb22626208b294bbb375 https://github.com/qemu/qemu/commit/27ea81337f7f6d1756c8cb22626208b294bbb375 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log.h Log Message: ----------- util/log: Mark qemu_log_trylock as G_GNUC_WARN_UNUSED_RESULT Now that all uses have been updated, consider a missing test of the result of qemu_log_trylock a bug and Werror. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-19-richard.hender...@linaro.org> Commit: 90f37362d7d2037a47f0c18ab4a26055acbd7b3a https://github.com/qemu/qemu/commit/90f37362d7d2037a47f0c18ab4a26055acbd7b3a Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M accel/tcg/translate-all.c M cpu.c M hw/net/can/can_sja1000.c M hw/xen/xen_pvdev.c M include/qemu/log.h M net/can/can_socketcan.c M tcg/tcg.c M util/log.c Log Message: ----------- util/log: Remove qemu_log_flush All uses flush output immediately before or after qemu_log_unlock. Instead of a separate call, move the flush into qemu_log_unlock. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-20-richard.hender...@linaro.org> Commit: fb6efecf548fc8ef8cc377f076312b1cf4061cac https://github.com/qemu/qemu/commit/fb6efecf548fc8ef8cc377f076312b1cf4061cac Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Drop call to setvbuf Now that the log buffer is flushed after every qemu_log_unlock, which includes every call to qemu_log, we do not need to force line buffering (or unbuffering for windows). Block buffer the entire loggable unit. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-21-richard.hender...@linaro.org> Commit: 43b761618de7bb43bacc1c7c38dfdda878714a4c https://github.com/qemu/qemu/commit/43b761618de7bb43bacc1c7c38dfdda878714a4c Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M bsd-user/main.c Log Message: ----------- bsd-user: Expand log_page_dump inline We have extra stuff to log at the same time. Hoist the qemu_log_trylock/unlock to the caller and use fprintf. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-22-richard.hender...@linaro.org> Commit: 93756fdcf6f3f6482bd9f22d8189b6c4ee09303e https://github.com/qemu/qemu/commit/93756fdcf6f3f6482bd9f22d8189b6c4ee09303e Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/exec/log.h M linux-user/main.c M linux-user/mmap.c Log Message: ----------- 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.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-23-richard.hender...@linaro.org> Commit: 09a65bec3810671068d2533ed49797d2ac070904 https://github.com/qemu/qemu/commit/09a65bec3810671068d2533ed49797d2ac070904 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M tests/unit/test-logging.c Log Message: ----------- tests/unit: Do not reference QemuLogFile directly Use qemu_log_lock/unlock instead of the raw rcu_read. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-24-richard.hender...@linaro.org> Commit: bf619eae2eed3bde9f7c003c09bf29bdcc908b08 https://github.com/qemu/qemu/commit/bf619eae2eed3bde9f7c003c09bf29bdcc908b08 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/exec/log.h Log Message: ----------- include/exec/log: Do not reference QemuLogFile directly Use qemu_log_trylock/unlock instead of the raw rcu_read. Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Message-Id: <20220417183019.755276-25-richard.hender...@linaro.org> Commit: 7fc493f8bd5b5eccf761ec9b1caa13c872e289ec https://github.com/qemu/qemu/commit/7fc493f8bd5b5eccf761ec9b1caa13c872e289ec Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log.h M tests/unit/test-logging.c M util/log.c Log Message: ----------- include/qemu/log: Move entire implementation out-of-line Move QemuLogFile, qemu_logfile, and all inline functions into qemu/log.c. No need to expose these implementation details in the api. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-26-richard.hender...@linaro.org> Commit: 6391c772d7c5928d1b2abd65486330b34c97a42b https://github.com/qemu/qemu/commit/6391c772d7c5928d1b2abd65486330b34c97a42b Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/sysemu/os-win32.h M meson.build Log Message: ----------- sysemu/os-win32: Test for and use _lock_file/_unlock_file The bug referenced in os-win32.h was fixed in mingw-w64 v6. According to repology, version 5 used by ubuntu 18, which is not yet out of support, so provide a meson link test for it. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-27-richard.hender...@linaro.org> Commit: 144539d3605ed7da9b8c1d69f49a282f8c4348b8 https://github.com/qemu/qemu/commit/144539d3605ed7da9b8c1d69f49a282f8c4348b8 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log.h M util/log.c Log Message: ----------- util/log: Introduce qemu_set_log_filename_flags Provide a function to set both filename and flags at the same time. This is the common case at startup. Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-28-richard.hender...@linaro.org> Commit: 905c78fe6066975c096e399d7e180098a618ba61 https://github.com/qemu/qemu/commit/905c78fe6066975c096e399d7e180098a618ba61 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M bsd-user/main.c Log Message: ----------- bsd-user: Use qemu_set_log_filename_flags Perform all logfile setup in one step. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-29-richard.hender...@linaro.org> Commit: b410253f9fcb8d940469a20e732f51f6e43b1265 https://github.com/qemu/qemu/commit/b410253f9fcb8d940469a20e732f51f6e43b1265 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M linux-user/main.c Log Message: ----------- linux-user: Use qemu_set_log_filename_flags Perform all logfile setup in one step. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-30-richard.hender...@linaro.org> Commit: b2528af10abea3d19aa42b33a65060ce3ff505cd https://github.com/qemu/qemu/commit/b2528af10abea3d19aa42b33a65060ce3ff505cd Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M softmmu/vl.c Log Message: ----------- softmmu: Use qemu_set_log_filename_flags Perform all logfile setup at startup in one step. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-31-richard.hender...@linaro.org> Commit: ec0d1849d990ae25017c7b611a4385f4ec2cc874 https://github.com/qemu/qemu/commit/ec0d1849d990ae25017c7b611a4385f4ec2cc874 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M cpu.c M include/qemu/log.h M tests/unit/test-logging.c M util/log.c Log Message: ----------- util/log: Remove qemu_log_close The only real use is in cpu_abort, where we have just flushed the file via qemu_log_unlock, and are just about to force-crash the application via abort. We do not really need to close the FILE before the abort. The two uses in test-logging.c can be handled with qemu_set_log_filename_flags. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-32-richard.hender...@linaro.org> Commit: 422664648129689778ac9c9aa0a49a0f705ea53f https://github.com/qemu/qemu/commit/422664648129689778ac9c9aa0a49a0f705ea53f Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Rename logfilename to global_filename Rename to emphasize this is the file-scope global variable. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-33-richard.hender...@linaro.org> Commit: 8ae58d60096ee1ba1436229b49abdabecc3f5c62 https://github.com/qemu/qemu/commit/8ae58d60096ee1ba1436229b49abdabecc3f5c62 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Rename qemu_logfile to global_file Rename to emphasize this is the file-scope global variable. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-34-richard.hender...@linaro.org> Commit: 702979f736a13aded68b7a14a46a7b33b752cce5 https://github.com/qemu/qemu/commit/702979f736a13aded68b7a14a46a7b33b752cce5 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Rename qemu_logfile_mutex to global_mutex Rename to emphasize this covers the file-scope global variables. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-35-richard.hender...@linaro.org> Commit: beab3447dbb1363654760c34b53226814c64de99 https://github.com/qemu/qemu/commit/beab3447dbb1363654760c34b53226814c64de99 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Hoist the eval of is_daemonized in qemu_set_log_internal Only call is_daemonized once. We require the result on all paths after this point. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-36-richard.hender...@linaro.org> Commit: 92b24cb77f4359da099e52ddbee23880f665edb3 https://github.com/qemu/qemu/commit/92b24cb77f4359da099e52ddbee23880f665edb3 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Combine two logfile closes Merge the close from the changed_name block with the close from the !need_to_open_file block. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-37-richard.hender...@linaro.org> Commit: d5f55fff343a9afccde8cf7c11c2e7440e21ada8 https://github.com/qemu/qemu/commit/d5f55fff343a9afccde8cf7c11c2e7440e21ada8 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Rename QemuLogFile to RCUCloseFILE s/QemuLogFile/RCUCloseFILE/ s/qemu_logfile_free/rcu_close_file/ Emphasize that this is only a carrier for passing a pointer to call_rcu for closing, and not the real logfile. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-38-richard.hender...@linaro.org> Commit: 30f5a73ac3be6a7ade2fc049162dc85c1bed9a9a https://github.com/qemu/qemu/commit/30f5a73ac3be6a7ade2fc049162dc85c1bed9a9a Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M util/log.c Log Message: ----------- util/log: Limit RCUCloseFILE to file closing Use FILE* for global_file. We can perform an rcu_read on that just as easily as RCUCloseFILE*. This simplifies a couple of places, where previously we required taking the rcu_read_lock simply to avoid racing to dereference RCUCloseFile->fd. Only allocate the RCUCloseFile prior to call_rcu. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-39-richard.hender...@linaro.org> Commit: 4e51069d679348d2617512e56e28cdc7bb34c833 https://github.com/qemu/qemu/commit/4e51069d679348d2617512e56e28cdc7bb34c833 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M include/qemu/log.h M util/log.c Log Message: ----------- util/log: Support per-thread log files Add a new log flag, tid, to turn this feature on. Require the log filename to be set, and to contain %d. Do not allow tid to be turned off once it is on, nor let the filename be change thereafter. This avoids the need for signalling each thread to re-open on a name change. Reviewed-by: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Message-Id: <20220417183019.755276-40-richard.hender...@linaro.org> Commit: 27a985159a80430a0a43161797ca14ef946962b8 https://github.com/qemu/qemu/commit/27a985159a80430a0a43161797ca14ef946962b8 Author: Richard Henderson <richard.hender...@linaro.org> Date: 2022-04-20 (Wed, 20 Apr 2022) Changed paths: M accel/tcg/cpu-exec.c M accel/tcg/translate-all.c M accel/tcg/translator.c M bsd-user/main.c M cpu.c M hw/net/can/can_sja1000.c M hw/xen/xen_pvdev.c M include/exec/log.h M include/exec/translator.h M include/qemu/log-for-trace.h M include/qemu/log.h M include/sysemu/os-win32.h M linux-user/main.c M linux-user/mmap.c M meson.build M monitor/misc.c M net/can/can_socketcan.c M os-posix.c M qemu-img.c M qemu-io.c M qemu-nbd.c M scsi/qemu-pr-helper.c M softmmu/vl.c M storage-daemon/qemu-storage-daemon.c M target/alpha/translate.c M target/arm/translate-a64.c M target/arm/translate.c M target/avr/translate.c M target/cris/translate.c M target/hexagon/translate.c M target/hppa/translate.c M target/i386/tcg/translate.c M target/m68k/translate.c M target/microblaze/translate.c M target/mips/tcg/translate.c M target/nios2/cpu.c M target/nios2/translate.c M target/openrisc/translate.c M target/ppc/translate.c M target/riscv/translate.c M target/rx/translate.c M target/s390x/tcg/translate.c M target/sh4/translate.c M target/sparc/translate.c M target/tricore/translate.c M target/xtensa/translate.c M tcg/tcg.c M tests/unit/test-logging.c M util/log.c Log Message: ----------- Merge tag 'pull-log-20220420' of https://gitlab.com/rth7680/qemu into staging Clean up log locking. Use the FILE* from qemu_log_trylock more often. Support per-thread log files with -d tid. # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmJgStUdHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV+c9Af/ZXnKe6bz5yjXy1mS # mNIBJUPKrz1RXFfJxuCfEDWrtNc/gvQyvc3weZG5X0cXpiczeWA5V/9xbE9hu5gV # 4rePiIHWmOrais6GZlqEu2F8P3/XyqdPHtcdBfa1hDneixtpqMHCqnh36nQjHyiU # ogFxEJ/M9tTwhuWZrXe/JSYAiALEDYMK9bk4RUMOP1c4v37rXqUNOAM1IPhfxLL/ # bK9DQMpz5oUNsWWaqBQ2wQWHkNTOpUEkKGQv0xcQF5SdpYwaxakW9B7/h4QSeOUn # oY6MFTmkJ4BPrLnkcubn+3PICc9LW0OFuzNnUdMCbeqVbjAUQrdMDalKpy4uNFv9 # U1VqHg== # =Mt5s # -----END PGP SIGNATURE----- # gpg: Signature made Wed 20 Apr 2022 11:03:01 AM PDT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.hender...@linaro.org" # gpg: Good signature from "Richard Henderson <richard.hender...@linaro.org>" [ultimate] * tag 'pull-log-20220420' of https://gitlab.com/rth7680/qemu: (39 commits) util/log: Support per-thread log files util/log: Limit RCUCloseFILE to file closing util/log: Rename QemuLogFile to RCUCloseFILE util/log: Combine two logfile closes util/log: Hoist the eval of is_daemonized in qemu_set_log_internal util/log: Rename qemu_logfile_mutex to global_mutex util/log: Rename qemu_logfile to global_file util/log: Rename logfilename to global_filename util/log: Remove qemu_log_close softmmu: Use qemu_set_log_filename_flags linux-user: Use qemu_set_log_filename_flags bsd-user: Use qemu_set_log_filename_flags util/log: Introduce qemu_set_log_filename_flags sysemu/os-win32: Test for and use _lock_file/_unlock_file include/qemu/log: Move entire implementation out-of-line include/exec/log: Do not reference QemuLogFile directly tests/unit: Do not reference QemuLogFile directly linux-user: Expand log_page_dump inline bsd-user: Expand log_page_dump inline util/log: Drop call to setvbuf ... Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Compare: https://github.com/qemu/qemu/compare/2d20a57453f6...27a985159a80