All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dangyi Liu <dliu@redhat.com>
To: Simon Horman <horms@verge.net.au>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars
Date: Wed, 18 Nov 2015 13:24:40 +0800	[thread overview]
Message-ID: <1447824280.2500.1.camel@redhat.com> (raw)
In-Reply-To: <1446023724-12445-1-git-send-email-dliu@redhat.com>

Simon,

Could you help to review this patch?

Thanks,
Dangyi Liu

On Wed, 2015-10-28 at 17:15 +0800, Dangyi Liu wrote:
> logged_chars would be set to 0 by `dmesg -c`, but full dmesg is
> useful
> for debugging. So instead of using logged_chars directly, we
> calculate
> it by ourselves.
> 
> Now logged_chars is set to the minimum of log_end and log_buf_len, as
> the same logic as crash utility is using.
> 
> Signed-off-by: Dangyi Liu <dliu@redhat.com>
> Cc: Dave Young <dyoung@redhat.com>
> ---
> Changes:
>   v1->v2: Update comment and commit message.
>   v2->v3: Adjust maximum line length
> 
>  vmcore-dmesg/vmcore-dmesg.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-
> dmesg.c
> index f47ee11..0364636 100644
> --- a/vmcore-dmesg/vmcore-dmesg.c
> +++ b/vmcore-dmesg/vmcore-dmesg.c
> @@ -540,6 +540,12 @@ static void dump_dmesg_legacy(int fd)
>  		exit(53);
>  	}
>  
> +	/*
> +	 * To collect full dmesg including the part before `dmesg
> -c` is useful
> +	 * for later debugging. Use same logic as what crash utility
> is using.
> +	 */
> +	logged_chars = log_end < log_buf_len ? log_end :
> log_buf_len;
> +
>  	write_to_stdout(buf + (log_buf_len -  logged_chars),
> logged_chars);
>  }
>  

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  parent reply	other threads:[~2015-11-18  5:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  9:15 [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars Dangyi Liu
2015-11-09  2:26 ` Dave Young
2015-11-18  5:24 ` Dangyi Liu [this message]
2015-12-08  3:36   ` Dave Young
2015-12-08  6:04     ` Simon Horman
2015-12-09  2:28       ` Dave Young
2015-12-09  4:01         ` Simon Horman

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=1447824280.2500.1.camel@redhat.com \
    --to=dliu@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.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 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.