summaryrefslogtreecommitdiffstats
path: root/util/log.c
diff options
context:
space:
mode:
authorPeter Maydell2016-08-08 11:39:18 +0200
committerPeter Maydell2016-08-08 11:39:18 +0200
commitcf5198d58088e3b416fe517b3946e5120b342761 (patch)
tree9d90c54eca81527f3f423e2daf7b29eccc32a35e /util/log.c
parenttests: Rename qtests which have names ending "error" (diff)
parenttcg: Lower indirect registers in a separate pass (diff)
downloadqemu-cf5198d58088e3b416fe517b3946e5120b342761.tar.gz
qemu-cf5198d58088e3b416fe517b3946e5120b342761.tar.xz
qemu-cf5198d58088e3b416fe517b3946e5120b342761.zip
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20160805' into staging
indirect register lowering # gpg: Signature made Fri 05 Aug 2016 17:34:53 BST # gpg: using RSA key 0xAD1270CC4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@redhat.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" # Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC 16A4 AD12 70CC 4DD0 279B * remotes/rth/tags/pull-tcg-20160805: tcg: Lower indirect registers in a separate pass tcg: Require liveness analysis tcg: Include liveness info in the dumps tcg: Compress dead_temps and mem_temps into a single array tcg: Fold life data into TCGOp tcg: Reorg TCGOp chaining tcg: Compress liveness data to 16 bits Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/log.c')
-rw-r--r--util/log.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/util/log.c b/util/log.c
index b6c75b1102..54b54e868a 100644
--- a/util/log.c
+++ b/util/log.c
@@ -32,15 +32,22 @@ int qemu_loglevel;
static int log_append = 0;
static GArray *debug_regions;
-void qemu_log(const char *fmt, ...)
+/* Return the number of characters emitted. */
+int qemu_log(const char *fmt, ...)
{
- va_list ap;
-
- va_start(ap, fmt);
+ int ret = 0;
if (qemu_logfile) {
- vfprintf(qemu_logfile, fmt, ap);
+ va_list ap;
+ va_start(ap, fmt);
+ ret = vfprintf(qemu_logfile, fmt, ap);
+ va_end(ap);
+
+ /* Don't pass back error results. */
+ if (ret < 0) {
+ ret = 0;
+ }
}
- va_end(ap);
+ return ret;
}
static bool log_uses_own_buffers;
@@ -240,8 +247,9 @@ const QEMULogItem qemu_log_items[] = {
{ CPU_LOG_TB_OP, "op",
"show micro ops for each compiled TB" },
{ CPU_LOG_TB_OP_OPT, "op_opt",
- "show micro ops (x86 only: before eflags optimization) and\n"
- "after liveness analysis" },
+ "show micro ops after optimization" },
+ { CPU_LOG_TB_OP_IND, "op_ind",
+ "show micro ops before indirect lowering" },
{ CPU_LOG_INT, "int",
"show interrupts/exceptions in short format" },
{ CPU_LOG_EXEC, "exec",