From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>, dev@dpdk.org
Cc: chenbo.xia@intel.com
Subject: Re: [PATCH 4/4] vhost: prefix logs with context
Date: Thu, 30 Jun 2022 18:13:05 +0200 [thread overview]
Message-ID: <9bf2e67e-4234-9f5c-5eaf-03be6c2a93e0@redhat.com> (raw)
In-Reply-To: <20220627092728.78214-5-david.marchand@redhat.com>
Hi David,
On 6/27/22 11:27, David Marchand wrote:
> We recently improved the log messages in the vhost library, adding some
> context that helps filtering for a given vhost-user device.
> However, some parts of the code were missed, and some later code changes
> broke this new convention (fixes were sent previous to this patch).
>
> Change the VHOST_LOG_CONFIG/DATA helpers and always ask for a string
> used as context. This should help limit regressions on this topic.
>
> Most of the time, the context is the vhost-user device socket path.
> For the rest when a vhost-user device can not be related, generic
> names were chosen:
> - "dma", for vhost-user async DMA operations,
> - "device", for vhost-user device creation and lookup,
> - "thread", for threads management,
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> lib/vhost/iotlb.c | 30 +-
> lib/vhost/socket.c | 129 ++++-----
> lib/vhost/vdpa.c | 4 +-
> lib/vhost/vhost.c | 144 ++++-----
> lib/vhost/vhost.h | 20 +-
> lib/vhost/vhost_user.c | 642 +++++++++++++++++++++--------------------
> lib/vhost/virtio_net.c | 258 +++++++++--------
> 7 files changed, 634 insertions(+), 593 deletions(-)
>
> diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
> index 810bc71c9d..310aaf88ff 100644
> --- a/lib/vhost/vhost.h
> +++ b/lib/vhost/vhost.h
> @@ -625,14 +625,14 @@ vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq,
> extern int vhost_config_log_level;
> extern int vhost_data_log_level;
>
> -#define VHOST_LOG_CONFIG(level, fmt, args...) \
> +#define VHOST_LOG_CONFIG(prefix, level, fmt, args...) \
> rte_log(RTE_LOG_ ## level, vhost_config_log_level, \
> - "VHOST_CONFIG: " fmt, ##args)
> + "VHOST_CONFIG: (%s): " fmt, prefix, ##args)
>
> -#define VHOST_LOG_DATA(level, fmt, args...) \
> +#define VHOST_LOG_DATA(prefix, level, fmt, args...) \
> (void)((RTE_LOG_ ## level <= RTE_LOG_DP_LEVEL) ? \
> rte_log(RTE_LOG_ ## level, vhost_data_log_level, \
> - "VHOST_DATA : " fmt, ##args) : \
> + "VHOST_DATA: (%s):" fmt, prefix, ##args) : \
> 0)
As discussed off-list, adding the function will break OVS tests once
again. I propose to pick the first 3 patches for now.
Thanks,
Maxime
next prev parent reply other threads:[~2022-06-30 16:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 9:27 [PATCH 0/4] Vhost logs fixes and improvement David Marchand
2022-06-27 9:27 ` [PATCH 1/4] vhost: add some trailing newline in log messages David Marchand
2022-06-29 13:28 ` Xia, Chenbo
2022-06-27 9:27 ` [PATCH 2/4] vhost: restore device information " David Marchand
2022-06-29 13:34 ` Xia, Chenbo
2022-06-29 13:45 ` David Marchand
2022-06-29 13:49 ` Xia, Chenbo
2022-06-27 9:27 ` [PATCH 3/4] vhost: improve some datapath " David Marchand
2022-06-30 16:07 ` Maxime Coquelin
2022-06-27 9:27 ` [PATCH 4/4] vhost: prefix logs with context David Marchand
2022-06-30 16:13 ` Maxime Coquelin [this message]
2022-07-01 7:13 ` David Marchand
2022-07-01 7:56 ` Maxime Coquelin
2022-07-01 7:55 ` [PATCH v2 0/4] Vhost logs fixes and improvement David Marchand
2022-07-01 7:55 ` [PATCH v2 1/4] vhost: add some trailing newline in log messages David Marchand
2022-07-01 7:55 ` [PATCH v2 2/4] vhost: restore device information " David Marchand
2022-07-01 7:55 ` [PATCH v2 3/4] vhost: improve some datapath " David Marchand
2022-07-01 7:55 ` [PATCH v2 4/4] vhost: prefix logs with context David Marchand
2022-07-01 8:00 ` Maxime Coquelin
2022-07-01 13:20 ` [PATCH v3] " David Marchand
2022-07-01 14:00 ` Maxime Coquelin
2022-07-01 14:00 ` [PATCH v2 0/4] Vhost logs fixes and improvement Maxime Coquelin
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=9bf2e67e-4234-9f5c-5eaf-03be6c2a93e0@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=chenbo.xia@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).