public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Jonathan Lassoff <jof@thejof.com>, linux-btrfs@vger.kernel.org
Cc: Josef Bacik <josef@toxicpanda.com>, Chris Mason <clm@fb.com>
Subject: Re: [PATCH v0 0/1] Add Btrfs messages to printk index
Date: Thu, 17 Mar 2022 09:20:57 +0200	[thread overview]
Message-ID: <e23301f7-5d5f-0a9c-7ae5-e9b521ef8b2b@suse.com> (raw)
In-Reply-To: <fe7dcb58ac812fb6c37a92a1f74a42890c8c0bc8.1647493897.git.jof@thejof.com>



On 17.03.22 г. 7:13 ч., Jonathan Lassoff wrote:
> In order for end users to quickly react to new issues that come up in
> production, it is proving useful to leverage this printk indexing system. This
> printk index enables kernel developers to use calls to printk() with changable
> ad-hoc format strings, while still enabling end users to detect changes and
> develop a semi-stable interface for detecting and parsing these messages.
> 
> So that detailed Btrfs messages are captured by this printk index, this patch
> wraps btrfs_printk and btrfs_handle_fs_error with macros.
> 
> Signed-off-by: Jonathan Lassoff <jof@thejof.com>
> ---
>   fs/btrfs/ctree.h | 28 ++++++++++++++++++++++++++--
>   fs/btrfs/super.c |  6 +++---
>   2 files changed, 29 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index ebb2d109e8bb..cc768f71d0a5 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -3344,9 +3344,22 @@ void btrfs_no_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
>   }
>   
>   #ifdef CONFIG_PRINTK
> +#define btrfs_printk(fs_info, fmt, args...)                          \
> +do {                                                                 \
> +	printk_index_subsys_emit("%sBTRFS %s (device %s): ", NULL, fmt); \
> +	_btrfs_printk(fs_info, fmt, ##args);                             \
> +} while (0)
>   __printf(2, 3)
>   __cold
> -void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
> +void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
> +#elif defined(CONFIG_PRINTK)

But you already checked for #idef CONFIG_PRINTK ? In case CONFIG_PRINTK 
is not defined we'll call btrfs_no_printk as btrfs_printk would be 
compiled-out. So what's your intention here?

> +#define btrfs_printk(fs_info, fmt, args...)                          \
> +do {                                                                 \
> +	_btrfs_printk(fs_info, fmt, ##args);                             \
> +} while (0)
> +__printf(2, 3)
> +__cold
> +void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
>   #else
>   #define btrfs_printk(fs_info, fmt, args...) \
>   	btrfs_no_printk(fs_info, fmt, ##args)
> @@ -3598,11 +3611,22 @@ do {								\
>   				  __LINE__, (errno));		\
>   } while (0)
>   


<snip>

  parent reply	other threads:[~2022-03-17  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  5:13 [PATCH v0 0/1] Add Btrfs messages to printk index Jonathan Lassoff
2022-03-17  5:13 ` [PATCH v0 1/1] " Jonathan Lassoff
2022-03-17  7:20 ` Nikolay Borisov [this message]
2022-03-17 17:44   ` [PATCH v0 0/1] " Jonathan Lassoff

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=e23301f7-5d5f-0a9c-7ae5-e9b521ef8b2b@suse.com \
    --to=nborisov@suse.com \
    --cc=clm@fb.com \
    --cc=jof@thejof.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.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