log: simple changes
cover log: simple changes
This patchset contains simple uncontroversal changes from the previous patchset.
Signed-off-by Denis V. Lunev <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC Paolo Bonzini <[email protected]>
PATCH 1/2 trace: do not always call exit() in trace_enable_events
The problem is that
virsh qemu-monitor-command --hmp VM log trace:help
forces QEMU to exit even when running VM normally.
Signed-off-by Denis V. Lunev <[email protected]>
CC Stefan Hajnoczi <[email protected]>
Reviewed-by Paolo Bonzini <[email protected]>
--- trace/control.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
trace/control.c +4 -1
@@ -19,6 +19,7 @@#include "qemu/log.h" #endif #include "qemu/error-report.h" +#include "monitor/monitor.h" int trace_events_enabled_count;bool trace_events_dstate[TRACE_EVENT_COUNT ];
@@ -131,7 +132,9 @@ void trace_enable_events(const char *line_buf) {if (is_help_option (line_buf)) {trace_list_events (); -exit (0 ); +if (cur_mon ==NULL ) { +exit (0 ); + } }else {do_trace_enable_events (line_buf); }
Signature · 1 line
2.1.4
PATCH 2/2 log: move qemu_log_close/qemu_log_flush from header to log.c
In reply to Denis V. LunevThere is no particular reason to keep these functions in the header. Suggested by Paolo.
Signed-off-by Denis V. Lunev <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC Paolo Bonzini <[email protected]>
--- include/qemu/log.h | 22 +++++----------------- util/log.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-)
include/qemu/log.h +5 -17
@@ -73,23 +73,6 @@ void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...);/* Maintenance: */ -/* fflush() the log file */ -static inline void qemu_log_flush (void ) -{ -fflush (qemu_logfile); -} - -/* Close the log file */ -static inline void qemu_log_close (void ) -{ -if (qemu_logfile) { -if (qemu_logfile != stderr) { -fclose (qemu_logfile); - } - qemu_logfile =NULL ; - } -} -/* define log items */ typedef struct QEMULogItem { int mask;
@@ -122,4 +105,9 @@ int qemu_str_to_log_mask(const char *str);*/ void qemu_print_log_usage (FILE *f); +/* fflush() the log file */ +void qemu_log_flush (void ); +/* Close the log file */ +void qemu_log_close (void ); +#endif
util/log.c +17 -0
@@ -105,6 +105,23 @@ void qemu_set_log_filename(const char *filename)qemu_set_log (qemu_loglevel); } +/* fflush() the log file */ +void qemu_log_flush (void ) +{ +fflush (qemu_logfile); +} + +/* Close the log file */ +void qemu_log_close (void ) +{ +if (qemu_logfile) { +if (qemu_logfile != stderr) { +fclose (qemu_logfile); + } + qemu_logfile =NULL ; + } +} +const QEMULogItem qemu_log_items[] = { {CPU_LOG_TB_OUT_ASM ,"out_asm" ,"show generated host assembly code for each compiled TB" },
Signature · 1 line
2.1.4
Quoted 7 lines · Denis V. Lunev
This patchset contains simple uncontroversal changes from the previous patchset.
Signed-off-by Denis V. Lunev <[email protected]>CC Stefan Hajnoczi <[email protected]>CC Paolo Bonzini <[email protected]>
Reviewed-by Paolo Bonzini <[email protected]>
Stefan Hajnoczi
AppliedQuoted 7 lines · Denis V. Lunev
This patchset contains simple uncontroversal changes from the previous patchset.
Signed-off-by Denis V. Lunev <[email protected]>CC Stefan Hajnoczi <[email protected]>CC Paolo Bonzini <[email protected]>
Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
Stefan