All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Kunz <jkz@google.com>
To: qemu-devel@nongnu.org
Cc: riku.voipio@iki.fi, laurent@vivier.eu, alex.bennee@linaro.org,
	 armbru@redhat.com, imp@bsdimp.com, Josh Kunz <jkz@google.com>
Subject: [PATCH v2 0/4] migration: Replace gemu_log with qemu_log
Date: Fri, 17 Jan 2020 11:28:04 -0800	[thread overview]
Message-ID: <20200117192808.129398-1-jkz@google.com> (raw)

Summary of v2 changes:
  * Removed backwards-compatibility code for non-strace log statements.
  * Removed new qemu_log interface for adding or removing fields from
    the log mask.
  * Removed LOG_USER and converted all uses (except one) to LOG_UNIMP.
    * One gemu_log statement was converted to an assert.
  * Some style cleanup.

The linux-user and bsd-user trees both widely use a function called
`gemu_log` (notice the 'g') for miscellaneous and strace logging. This
function predates the newer `qemu_log` function, and has a few drawbacks
compared to `qemu_log`:

  1. Always logs to `stderr`, no logging redirection.
  2. "Miscellaneous" logging cannot be disabled, so it may mix with guest
     logging.
  3. Inconsistency with other parts of the QEMU codebase, and a
     confusing name.

The second issue is especially troubling because it can interfere with
programs that expect to communicate via stderr.

This change introduces one new logging masks to the `qemu_log` subsystem
to support its use for user-mode logging: the `LOG_STRACE` mask for
strace-specific logging. Further, it replaces all existing uses of
`gemu_log` with the appropriate `qemu_log_mask(LOG_{UNIMP,STRACE}, ...)`
based on the log message.

Backwards incompatibility:
  * Log messages for unimplemented user-mode features are no longer
    logged by default. They have to be enabled by setting the LOG_UNIMP
    mask.
  * Log messages for strace/unimplemented user-mode features may be
    redirected based on `-D`, instead of always logging to stderr.

Tested:
  * Built with clang 9 and g++ 8.3
  * `make check` run with clang 9 build 
  * Verified:
    * QEMU_STRACE/-strace still works for linux-user
  * `make vm-build-netbsd EXTRA_CONFIGURE_OPTS="--disable-system"`
    passed.

Not tested:
  * Build/logging with bsd-user. I do not have easy access to a BSD system.

Josh Kunz (4):
  linux-user: Use `qemu_log' for non-strace logging
  linux-user: Use `qemu_log' for strace
  linux-user: remove gemu_log from the linux-user tree
  bsd-user: Replace gemu_log with qemu_log

 bsd-user/main.c           |  13 +-
 bsd-user/qemu.h           |   2 -
 bsd-user/strace.c         |  32 ++-
 bsd-user/syscall.c        |  31 ++-
 include/qemu/log.h        |   2 +
 linux-user/arm/cpu_loop.c |   5 +-
 linux-user/fd-trans.c     |  55 +++--
 linux-user/main.c         |  39 ++--
 linux-user/qemu.h         |   2 -
 linux-user/signal.c       |   2 +-
 linux-user/strace.c       | 479 +++++++++++++++++++-------------------
 linux-user/syscall.c      |  68 +++---
 linux-user/vm86.c         |   3 +-
 util/log.c                |   2 +
 14 files changed, 383 insertions(+), 352 deletions(-)

-- 
2.25.0.341.g760bfbb309-goog



             reply	other threads:[~2020-01-17 19:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 19:28 Josh Kunz [this message]
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
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=20200117192808.129398-1-jkz@google.com \
    --to=jkz@google.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=laurent@vivier.eu \
    --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.