summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorJosh Kunz <jkz@google.com>2020-02-03 18:54:14 -0800
committerLaurent Vivier <laurent@vivier.eu>2020-02-19 11:17:40 +0100
commit4b25a50674de41e72f6b3003e3c8c74ca95503d3 (patch)
tree1eaf91a8753f29fab83f0e7f7d29405f2b1a0cb9 /linux-user/syscall.c
parent39be535008f120452d3bda2a50798774a5f1f963 (diff)
downloadfocaccia-qemu-4b25a50674de41e72f6b3003e3c8c74ca95503d3.tar.gz
focaccia-qemu-4b25a50674de41e72f6b3003e3c8c74ca95503d3.zip
linux-user: Use `qemu_log' for strace
This change switches linux-user strace logging to use the newer `qemu_log`
logging subsystem rather than the older `gemu_log` (notice the "g")
logger. `qemu_log` has several advantages, namely that it allows logging
to a file, and provides a more unified interface for configuration
of logging (via the QEMU_LOG environment variable or options).

This change introduces a new log mask: `LOG_STRACE` which is used for
logging of user-mode strace messages.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Josh Kunz <jkz@google.com>
Message-Id: <20200204025416.111409-3-jkz@google.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 16d98c1ff5..274e10e0ee 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -12171,14 +12171,15 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     record_syscall_start(cpu, num, arg1,
                          arg2, arg3, arg4, arg5, arg6, arg7, arg8);
 
-    if (unlikely(do_strace)) {
+    if (unlikely(qemu_loglevel_mask(LOG_STRACE))) {
         print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
-        ret = do_syscall1(cpu_env, num, arg1, arg2, arg3, arg4,
-                          arg5, arg6, arg7, arg8);
+    }
+
+    ret = do_syscall1(cpu_env, num, arg1, arg2, arg3, arg4,
+                      arg5, arg6, arg7, arg8);
+
+    if (unlikely(qemu_loglevel_mask(LOG_STRACE))) {
         print_syscall_ret(num, ret);
-    } else {
-        ret = do_syscall1(cpu_env, num, arg1, arg2, arg3, arg4,
-                          arg5, arg6, arg7, arg8);
     }
 
     record_syscall_return(cpu, num, ret);