summaryrefslogtreecommitdiffstats
path: root/util/log.c
Commit message (Collapse)AuthorAgeFilesLines
* log: move qemu_log_close/qemu_log_flush from header to log.cDenis V. Lunev2019-11-291-0/+17
| | | | | | | | | | | | There is no particular reason to keep these functions in the header. Suggested by Paolo. Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1458128212-4197-3-git-send-email-den@openvz.org CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-log: support simple pid substitution for logsAlex Bennée2019-11-291-2/+19
| | | | | | | | | | | | | | | | | | When debugging stuff that occurs over several forks it would be useful not to keep overwriting the one logfile you've set-up. This allows a simple %d to be included once in the logfile parameter which is substituted with getpid(). As the test cases involve checking user output they need g_test_trap_subprocess() support. As a result they are currently skipped on Travis builds due to the older glib involved. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Leandro Dorileo <l@dorileo.org> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-Id: <1458052224-9316-10-git-send-email-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-log: new option -dfilter to limit outputAlex Bennée2019-11-291-0/+87
| | | | | | | | | | | | | | | | When debugging big programs or system emulation sometimes you want both the verbosity of cpu,exec et all but don't want to generate lots of logs for unneeded stuff. This patch adds a new option -dfilter which allows you to specify interesting address ranges in the form: -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,... Then logging code can use the new qemu_log_in_addr_range() function to decide if it will output logging information for the given range. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <1458052224-9316-7-git-send-email-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-log: Avoid function call for disabled qemu_log_mask loggingPeter Maydell2019-11-291-11/+0
| | | | | | | | | | | Make qemu_log_mask() a macro which only calls the function to do the actual work if the logging is enabled. This avoids making a function call in possible fast paths where logging is disabled. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-log: correct help text for -d cpuAlex Bennée2019-11-291-1/+1
| | | | | | | | | | | This doesn't just dump CPU state on translation but on every block entrance. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-Id: <1458052224-9316-4-git-send-email-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* log: do not log if QEMU is daemonized but without -DPaolo Bonzini2019-11-291-2/+5
| | | | | | | | | | | | | | | Commit 96c33a4 ("log: Redirect stderr to logfile if deamonized", 2016-02-22) wanted to move stderr of a daemonized QEMU to the file specified with -D. However, if -D was not passed, the patch had the side effect of not redirecting stderr to /dev/null. This happened because qemu_logfile was set to stderr rather than the expected value of NULL. The fix is simply in the "if" condition of do_qemu_set_log; the "if" for closing the file is also changed to match. Reported-by: Jan Tomko <jtomko@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* log: Redirect stderr to logfile if deamonizedDimitris Aragiorgis2019-11-291-2/+9
| | | | | | | | | | | In case of daemonize, use the logfile passed with the -D option in order to redirect stderr to it instead of /dev/null. Also remove some unused code in log.h. Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com> Message-Id: <1455795518-19205-1-git-send-email-dimara@arrikto.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* all: Clean up includesPeter Maydell2019-11-291-0/+1
| | | | | | | | | | Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
* log: add "-d trace:PATTERN"Paolo Bonzini2019-11-291-3/+13
| | | | | | | | | | | | This is a bit easier to use than "-trace" if you are also enabling other kinds of logging. It is also more discoverable for experienced QEMU users, and accessible from user-mode emulators. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-12-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: convert stderr backend to logPaolo Bonzini2019-11-291-0/+3
| | | | | | | | | | | [Also update .travis.yml --enable-trace-backends=stderr --Stefan] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-10-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* log: move qemu-log.c into util/ directoryDenis V. Lunev2019-11-291-0/+179
log will become common facility with tracepoints support in next step. Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1452174932-28657-9-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
OpenPOWER on IntegriCloud