All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Josh Kunz <jkz@google.com>, qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi, alex.bennee@linaro.org, armbru@redhat.com,
	imp@bsdimp.com
Subject: Re: [PATCH v2 2/4] linux-user: Use `qemu_log' for strace
Date: Tue, 28 Jan 2020 16:07:28 +0100	[thread overview]
Message-ID: <ab5d3c15-9060-47be-fdb6-70ab76dfcc06@vivier.eu> (raw)
In-Reply-To: <20200117192808.129398-3-jkz@google.com>

Le 17/01/2020 à 20:28, Josh Kunz a écrit :
> 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.
> 
> Signed-off-by: Josh Kunz <jkz@google.com>
> ---
>  include/qemu/log.h   |   2 +
>  linux-user/main.c    |  30 ++-
>  linux-user/qemu.h    |   1 -
>  linux-user/signal.c  |   2 +-
>  linux-user/strace.c  | 479 ++++++++++++++++++++++---------------------
>  linux-user/syscall.c |  13 +-
>  util/log.c           |   2 +
>  7 files changed, 278 insertions(+), 251 deletions(-)
> 
...
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 629f3a21b5..54e60f3807 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -12098,14 +12098,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);

In term of performance perhaps it sould be better to only test once for
the mask as it is done before?

For the other parts:

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Thanks,
Laurent


  reply	other threads:[~2020-01-28 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 19:28 [PATCH v2 0/4] migration: Replace gemu_log with qemu_log Josh Kunz
2020-01-17 19:28 ` [PATCH v2 1/4] linux-user: Use `qemu_log' for non-strace logging Josh Kunz
2020-01-28 14:51   ` Laurent Vivier
2020-01-28 16:53     ` Alex Bennée
2020-01-28 17:07       ` Laurent Vivier
2020-02-04  2:55         ` Josh Kunz
2020-01-17 19:28 ` [PATCH v2 2/4] linux-user: Use `qemu_log' for strace Josh Kunz
2020-01-28 15:07   ` Laurent Vivier [this message]
2020-02-04  2:55     ` Josh Kunz
2020-02-04 10:11       ` Laurent Vivier
2020-01-17 19:28 ` [PATCH v2 3/4] linux-user: remove gemu_log from the linux-user tree Josh Kunz
2020-01-28 15:07   ` Laurent Vivier
2020-01-17 19:28 ` [PATCH v2 4/4] bsd-user: Replace gemu_log with qemu_log Josh Kunz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab5d3c15-9060-47be-fdb6-70ab76dfcc06@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=jkz@google.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.