* [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars @ 2015-10-28 9:15 Dangyi Liu 2015-11-09 2:26 ` Dave Young 2015-11-18 5:24 ` Dangyi Liu 0 siblings, 2 replies; 7+ messages in thread From: Dangyi Liu @ 2015-10-28 9:15 UTC (permalink / raw) To: kexec; +Cc: Dave Young, Dangyi Liu 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); } -- 2.4.3 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars 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 1 sibling, 0 replies; 7+ messages in thread From: Dave Young @ 2015-11-09 2:26 UTC (permalink / raw) To: Dangyi Liu; +Cc: kexec On 10/28/15 at 05:15pm, 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); > } > > -- > 2.4.3 > > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec Acked-by: Dave Young <dyoung@redhat.com> Thanks Dave _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars 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 2015-12-08 3:36 ` Dave Young 1 sibling, 1 reply; 7+ messages in thread From: Dangyi Liu @ 2015-11-18 5:24 UTC (permalink / raw) To: Simon Horman; +Cc: kexec 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars 2015-11-18 5:24 ` Dangyi Liu @ 2015-12-08 3:36 ` Dave Young 2015-12-08 6:04 ` Simon Horman 0 siblings, 1 reply; 7+ messages in thread From: Dave Young @ 2015-12-08 3:36 UTC (permalink / raw) To: Simon Horman; +Cc: kexec, dliu On 11/18/15 at 01:24pm, Dangyi Liu wrote: > 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); > > } > > > Simon, What's your opinion about this patch? It is a rh internal report. Current code make sense, adding the patch will be slight better though for kdump case. But if you do not like it we can ignore it and close the bug. Thanks Dave _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars 2015-12-08 3:36 ` Dave Young @ 2015-12-08 6:04 ` Simon Horman 2015-12-09 2:28 ` Dave Young 0 siblings, 1 reply; 7+ messages in thread From: Simon Horman @ 2015-12-08 6:04 UTC (permalink / raw) To: Dave Young; +Cc: kexec, dliu On Tue, Dec 08, 2015 at 11:36:04AM +0800, Dave Young wrote: > On 11/18/15 at 01:24pm, Dangyi Liu wrote: > > 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); > > > } > > > > > > > Simon, > > What's your opinion about this patch? It is a rh internal report. > Current code make sense, adding the patch will be slight better though > for kdump case. But if you do not like it we can ignore it and close > the bug. This seems reasonable to me, but perhaps the logic should only kick in if logged_chars is 0? _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars 2015-12-08 6:04 ` Simon Horman @ 2015-12-09 2:28 ` Dave Young 2015-12-09 4:01 ` Simon Horman 0 siblings, 1 reply; 7+ messages in thread From: Dave Young @ 2015-12-09 2:28 UTC (permalink / raw) To: Simon Horman; +Cc: dliu, kexec On 12/08/15 at 03:04pm, Simon Horman wrote: > On Tue, Dec 08, 2015 at 11:36:04AM +0800, Dave Young wrote: > > On 11/18/15 at 01:24pm, Dangyi Liu wrote: > > > 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); > > > > } > > > > > > > > > > > Simon, > > > > What's your opinion about this patch? It is a rh internal report. > > Current code make sense, adding the patch will be slight better though > > for kdump case. But if you do not like it we can ignore it and close > > the bug. > > This seems reasonable to me, but perhaps the logic should only kick > in if logged_chars is 0? > It will contain at least panic messages to it is unlikely logged_chars = 0? Thanks Dave _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3] vmcore-dmesg: Collect full dmesg regardless of logged_chars 2015-12-09 2:28 ` Dave Young @ 2015-12-09 4:01 ` Simon Horman 0 siblings, 0 replies; 7+ messages in thread From: Simon Horman @ 2015-12-09 4:01 UTC (permalink / raw) To: Dave Young; +Cc: dliu, kexec On Wed, Dec 09, 2015 at 10:28:03AM +0800, Dave Young wrote: > On 12/08/15 at 03:04pm, Simon Horman wrote: > > On Tue, Dec 08, 2015 at 11:36:04AM +0800, Dave Young wrote: > > > On 11/18/15 at 01:24pm, Dangyi Liu wrote: > > > > 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); > > > > > } > > > > > > > > > > > > > > > Simon, > > > > > > What's your opinion about this patch? It is a rh internal report. > > > Current code make sense, adding the patch will be slight better though > > > for kdump case. But if you do not like it we can ignore it and close > > > the bug. > > > > This seems reasonable to me, but perhaps the logic should only kick > > in if logged_chars is 0? > > > > It will contain at least panic messages to it is unlikely logged_chars = 0? Understood. I have applied the patch. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-12-09 4:02 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox