public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] vmcore-dmesg: Handle struct log to struct printk_log renaming
@ 2014-05-22 14:43 Vivek Goyal
  2014-05-26  6:54 ` Simon Horman
  0 siblings, 1 reply; 5+ messages in thread
From: Vivek Goyal @ 2014-05-22 14:43 UTC (permalink / raw)
  To: Simon Horman, Kexec Mailing List
  Cc: Taras Kondratiuk, WANG Chao, Lubomir Rintel

vmcore-dmesg has been failing for me for quite some time as struct log
was renamed to struct printk_log.

62e32ac printk: rename struct log to struct printk_log

This patch has been sitting in mailing list for quite some time. It
is time to repost the patch.

I took original patch of Lubomir and modified a bit to take care of
concern of hardcoded string length.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---

Changes for v2:
  * Clarified printk_log vs. log in some comments.

 vmcore-dmesg/vmcore-dmesg.c |   53 +++++++++++++++++++++++++++++++-------------
 1 file changed, 38 insertions(+), 15 deletions(-)

Index: kexec-tools/vmcore-dmesg/vmcore-dmesg.c
===================================================================
--- kexec-tools.orig/vmcore-dmesg/vmcore-dmesg.c	2014-05-22 10:38:50.792356739 -0400
+++ kexec-tools/vmcore-dmesg/vmcore-dmesg.c	2014-05-22 10:39:12.463355316 -0400
@@ -35,10 +35,10 @@ static loff_t logged_chars_vaddr;
 static loff_t log_first_idx_vaddr;
 static loff_t log_next_idx_vaddr;
 
-/* struct log size */
+/* struct printk_log (or older log) size */
 static uint64_t log_sz;
 
-/* struct log field offsets */
+/* struct printk_log (or older log) field offsets */
 static uint64_t log_offset_ts_nsec = UINT64_MAX;
 static uint16_t log_offset_len = UINT16_MAX;
 static uint16_t log_offset_text_len = UINT16_MAX;
@@ -255,6 +255,7 @@ static void scan_vmcoreinfo(char *start,
 	char *pos, *eol;
 	char temp_buf[1024];
 	bool last_line = false;
+	char *str;
 
 #define SYMBOL(sym) {					\
 	.str = "SYMBOL(" #sym  ")=",			\
@@ -325,19 +326,41 @@ static void scan_vmcoreinfo(char *start,
 			*symbol[i].vaddr = vaddr;
 		}
 
-		/* Check for "SIZE(log)=" */
-		if (memcmp("SIZE(log)=", pos, 10) == 0)
-			log_sz = strtoull(pos + 10, NULL, 10);
-
-		/* Check for struct log field offsets */
-		if (memcmp("OFFSET(log.ts_nsec)=", pos, 20) == 0)
-			log_offset_ts_nsec = strtoull(pos + 20, NULL, 10);
-
-		if (memcmp("OFFSET(log.len)=", pos, 16) == 0)
-			log_offset_len = strtoul(pos + 16, NULL, 10);
-
-		if (memcmp("OFFSET(log.text_len)=", pos, 21) == 0)
-			log_offset_text_len = strtoul(pos + 21, NULL, 10);
+		/* Check for "SIZE(printk_log)" or older "SIZE(log)=" */
+		str = "SIZE(log)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_sz = strtoull(pos + strlen(str), NULL, 10);
+
+		str = "SIZE(printk_log)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_sz = strtoull(pos + strlen(str), NULL, 10);
+
+		/* Check for struct printk_log (or older log) field offsets */
+		str = "OFFSET(log.ts_nsec)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_offset_ts_nsec = strtoull(pos + strlen(str), NULL,
+							10);
+		str = "OFFSET(printk_log.ts_nsec)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_offset_ts_nsec = strtoull(pos + strlen(str), NULL,
+							10);
+
+		str = "OFFSET(log.len)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_offset_len = strtoul(pos + strlen(str), NULL, 10);
+
+		str = "OFFSET(printk_log.len)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_offset_len = strtoul(pos + strlen(str), NULL, 10);
+
+		str = "OFFSET(log.text_len)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_offset_text_len = strtoul(pos + strlen(str), NULL,
+							10);
+		str = "OFFSET(printk_log.text_len)=";
+		if (memcmp(str, pos, strlen(str)) == 0)
+			log_offset_text_len = strtoul(pos + strlen(str), NULL,
+							10);
 
 		if (last_line)
 			break;

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmcore-dmesg: Handle struct log to struct printk_log renaming
  2014-05-22 14:43 [PATCH] vmcore-dmesg: Handle struct log to struct printk_log renaming Vivek Goyal
@ 2014-05-26  6:54 ` Simon Horman
  2014-05-27 13:13   ` Vivek Goyal
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Horman @ 2014-05-26  6:54 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Taras Kondratiuk, Kexec Mailing List, WANG Chao, Lubomir Rintel

On Thu, May 22, 2014 at 10:43:14AM -0400, Vivek Goyal wrote:
> vmcore-dmesg has been failing for me for quite some time as struct log
> was renamed to struct printk_log.
> 
> 62e32ac printk: rename struct log to struct printk_log
> 
> This patch has been sitting in mailing list for quite some time. It
> is time to repost the patch.
> 
> I took original patch of Lubomir and modified a bit to take care of
> concern of hardcoded string length.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
> 
> Changes for v2:
>   * Clarified printk_log vs. log in some comments.

Thanks, applied.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmcore-dmesg: Handle struct log to struct printk_log renaming
  2014-05-26  6:54 ` Simon Horman
@ 2014-05-27 13:13   ` Vivek Goyal
  2014-05-27 23:45     ` Simon Horman
  0 siblings, 1 reply; 5+ messages in thread
From: Vivek Goyal @ 2014-05-27 13:13 UTC (permalink / raw)
  To: Simon Horman
  Cc: Taras Kondratiuk, Kexec Mailing List, WANG Chao, Lubomir Rintel

On Mon, May 26, 2014 at 03:54:22PM +0900, Simon Horman wrote:
> On Thu, May 22, 2014 at 10:43:14AM -0400, Vivek Goyal wrote:
> > vmcore-dmesg has been failing for me for quite some time as struct log
> > was renamed to struct printk_log.
> > 
> > 62e32ac printk: rename struct log to struct printk_log
> > 
> > This patch has been sitting in mailing list for quite some time. It
> > is time to repost the patch.
> > 
> > I took original patch of Lubomir and modified a bit to take care of
> > concern of hardcoded string length.
> > 
> > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> > ---
> > 
> > Changes for v2:
> >   * Clarified printk_log vs. log in some comments.
> 
> Thanks, applied.

Thanks Simon. "git pull" did not result in anything. Have you pushed it
out yet?

Thanks
Vivek


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmcore-dmesg: Handle struct log to struct printk_log renaming
  2014-05-27 13:13   ` Vivek Goyal
@ 2014-05-27 23:45     ` Simon Horman
  2014-05-28 12:27       ` Vivek Goyal
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Horman @ 2014-05-27 23:45 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Taras Kondratiuk, Kexec Mailing List, WANG Chao, Lubomir Rintel

On Tue, May 27, 2014 at 09:13:42AM -0400, Vivek Goyal wrote:
> On Mon, May 26, 2014 at 03:54:22PM +0900, Simon Horman wrote:
> > On Thu, May 22, 2014 at 10:43:14AM -0400, Vivek Goyal wrote:
> > > vmcore-dmesg has been failing for me for quite some time as struct log
> > > was renamed to struct printk_log.
> > > 
> > > 62e32ac printk: rename struct log to struct printk_log
> > > 
> > > This patch has been sitting in mailing list for quite some time. It
> > > is time to repost the patch.
> > > 
> > > I took original patch of Lubomir and modified a bit to take care of
> > > concern of hardcoded string length.
> > > 
> > > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > > Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> > > ---
> > > 
> > > Changes for v2:
> > >   * Clarified printk_log vs. log in some comments.
> > 
> > Thanks, applied.
> 
> Thanks Simon. "git pull" did not result in anything. Have you pushed it
> out yet?

Sorry about that, I have pushed it now.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vmcore-dmesg: Handle struct log to struct printk_log renaming
  2014-05-27 23:45     ` Simon Horman
@ 2014-05-28 12:27       ` Vivek Goyal
  0 siblings, 0 replies; 5+ messages in thread
From: Vivek Goyal @ 2014-05-28 12:27 UTC (permalink / raw)
  To: Simon Horman
  Cc: Taras Kondratiuk, Kexec Mailing List, WANG Chao, Lubomir Rintel

On Wed, May 28, 2014 at 08:45:53AM +0900, Simon Horman wrote:
> On Tue, May 27, 2014 at 09:13:42AM -0400, Vivek Goyal wrote:
> > On Mon, May 26, 2014 at 03:54:22PM +0900, Simon Horman wrote:
> > > On Thu, May 22, 2014 at 10:43:14AM -0400, Vivek Goyal wrote:
> > > > vmcore-dmesg has been failing for me for quite some time as struct log
> > > > was renamed to struct printk_log.
> > > > 
> > > > 62e32ac printk: rename struct log to struct printk_log
> > > > 
> > > > This patch has been sitting in mailing list for quite some time. It
> > > > is time to repost the patch.
> > > > 
> > > > I took original patch of Lubomir and modified a bit to take care of
> > > > concern of hardcoded string length.
> > > > 
> > > > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > > > Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> > > > ---
> > > > 
> > > > Changes for v2:
> > > >   * Clarified printk_log vs. log in some comments.
> > > 
> > > Thanks, applied.
> > 
> > Thanks Simon. "git pull" did not result in anything. Have you pushed it
> > out yet?
> 
> Sorry about that, I have pushed it now.

Thanks Simon. It works now.

Vivek


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-28 12:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 14:43 [PATCH] vmcore-dmesg: Handle struct log to struct printk_log renaming Vivek Goyal
2014-05-26  6:54 ` Simon Horman
2014-05-27 13:13   ` Vivek Goyal
2014-05-27 23:45     ` Simon Horman
2014-05-28 12:27       ` Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox