rpms/mcelog/F-11 mcelog-0.7-record-length.patch, 1.1, 1.2 mcelog.spec, 1.26, 1.27

Jon Masters jcm at fedoraproject.org
Sun Mar 21 05:16:47 UTC 2010


Author: jcm

Update of /cvs/pkgs/rpms/mcelog/F-11
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv15934

Modified Files:
	mcelog-0.7-record-length.patch mcelog.spec 
Log Message:
Foolishly, I pushed an mcelog update based on being told 2.6.32 had gone out
before it had. And anyway, now we have two incompatible kernel mce record
formats in F-11 (a nice side effect of rebasing kernels on old releases).
So this update includes a hack to deal with the two different formats.


mcelog-0.7-record-length.patch:
 mcelog.c |   25 +++++++++++++++++++------
 mcelog.h |   28 ++++++++++++++++++++--------
 2 files changed, 39 insertions(+), 14 deletions(-)

Index: mcelog-0.7-record-length.patch
===================================================================
RCS file: /cvs/pkgs/rpms/mcelog/F-11/mcelog-0.7-record-length.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- mcelog-0.7-record-length.patch	16 Mar 2010 10:29:06 -0000	1.1
+++ mcelog-0.7-record-length.patch	21 Mar 2010 05:16:45 -0000	1.2
@@ -1,7 +1,27 @@
 diff -urNp mcelog-0.7_orig/mcelog.c mcelog-0.7/mcelog.c
 --- mcelog-0.7_orig/mcelog.c	2006-05-03 02:55:54.000000000 -0400
-+++ mcelog-0.7/mcelog.c	2010-03-16 06:16:24.247644825 -0400
-@@ -120,15 +120,15 @@ void dump_mce(struct mce *m) 
++++ mcelog-0.7/mcelog.c	2010-03-21 00:51:18.392518262 -0400
+@@ -27,6 +27,7 @@
+ #include <syslog.h>
+ #include <stdarg.h>
+ #include <ctype.h>
++#include <stddef.h>
+ #include "mcelog.h"
+ #include "k8.h"
+ #include "p4.h"
+@@ -45,6 +46,11 @@ int do_dmi;
+ int ignore_nodev;
+ int filter_bogus;
+ 
++enum {
++	RECORD_FORMAT_OLD,
++	RECORD_FORMAT_NEW
++} record_format = RECORD_FORMAT_NEW;
++
+ void Wprintf(char *fmt, ...)
+ {
+ 	va_list ap;
+@@ -120,15 +126,15 @@ void dump_mce(struct mce *m) 
  			m->tsc, 
  			(m->mcgstatus & MCI_STATUS_UC) ? 
  			"(upper bound, found by polled driver)" : "");
@@ -21,7 +41,7 @@ diff -urNp mcelog-0.7_orig/mcelog.c mcel
  		Wprintf("\n");
  	switch (cpu) { 
  	case CPU_K8:
-@@ -265,7 +265,7 @@ void decodefatal(FILE *inf)
+@@ -265,7 +271,7 @@ void decodefatal(FILE *inf)
  
  			n = sscanf(s, "%02x:<%016Lx> {%100s}",
  				   &cs,
@@ -30,11 +50,34 @@ diff -urNp mcelog-0.7_orig/mcelog.c mcel
  				   symbol); 
  			m.cs = cs;
  			if (n < 2) 
+@@ -374,6 +380,12 @@ int main(int ac, char **av) 
+ 	if (ioctl(fd, MCE_GET_LOG_LEN, &loglen) < 0)
+ 		err("MCE_GET_LOG_LEN");
+ 
++	/* Upstream doesn't handle compatibility */
++	if (recordlen == MCE_RECORD_SIZE_OLD)
++		record_format = RECORD_FORMAT_OLD;
++	if (recordlen == MCE_RECORD_SIZE_NEW)
++		record_format = RECORD_FORMAT_NEW;
++
+ 	if (recordlen > sizeof(struct mce))
+ 		fprintf(stderr, 
+     "mcelog: warning: record length longer than expected. Consider update.\n");
+@@ -395,7 +407,8 @@ int main(int ac, char **av) 
+ 		dump_mce(mce); 
+ 	}
+ 
+-	if (recordlen < sizeof(struct mce))  {
++	if ((record_format != RECORD_FORMAT_OLD)
++	    && (recordlen < sizeof(struct mce)))  {
+ 		fprintf(stderr, 
+ 			"mcelog: warning: %lu bytes ignored in each record\n",
+ 				(unsigned long)recordlen - sizeof(struct mce)); 
 diff -urNp mcelog-0.7_orig/mcelog.h mcelog-0.7/mcelog.h
 --- mcelog-0.7_orig/mcelog.h	2006-05-03 02:55:54.000000000 -0400
-+++ mcelog-0.7/mcelog.h	2010-03-16 06:21:03.310643656 -0400
-@@ -1,10 +1,12 @@
- 
++++ mcelog-0.7/mcelog.h	2010-03-21 01:04:25.421517360 -0400
+@@ -1,10 +1,11 @@
+-
  typedef unsigned long long u64;
  typedef unsigned int u32;
 +typedef unsigned short u16;
@@ -46,7 +89,7 @@ diff -urNp mcelog-0.7_orig/mcelog.h mcel
  #define __u8  u8
  
  /* kernel structure: */
-@@ -15,15 +17,21 @@ struct mce {
+@@ -15,17 +16,28 @@ struct mce {
  	__u64 misc;
  	__u64 addr;
  	__u64 mcgstatus;
@@ -69,10 +112,16 @@ diff -urNp mcelog-0.7_orig/mcelog.h mcel
 +	__u8  cpu;	/* cpu number; obsolete; use extcpu now */
 +	__u8  finished;	/* entry is valid */
 +	__u32 extcpu;	/* linux cpu number that detected the error */
++
++	/* extension in recent kernels */
 +	__u32 socketid;	/* CPU socket ID */
 +	__u32 apicid;	/* CPU initial apic ID */
 +	__u64 mcgcap;	/* MCGCAP MSR: machine check capabilities of CPU */
  };
  
++#define MCE_RECORD_SIZE_OLD	offsetof(struct mce, socketid)
++#define MCE_RECORD_SIZE_NEW	sizeof(struct mce)
++
  #define MCE_OVERFLOW 0		/* bit 0 in flags means overflow */
-Binary files mcelog-0.7_orig/.mcelog.h.swp and mcelog-0.7/.mcelog.h.swp differ
+ 
+ #define MCE_GET_RECORD_LEN   _IOR('M', 1, int)


Index: mcelog.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mcelog/F-11/mcelog.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- mcelog.spec	16 Mar 2010 10:29:06 -0000	1.26
+++ mcelog.spec	21 Mar 2010 05:16:45 -0000	1.27
@@ -1,7 +1,7 @@
 Summary:        Tool to translate x86-64 CPU Machine Check Exception data.
 Name:           mcelog
 Version:        0.7
-Release: 	4%{?dist}
+Release: 	5%{?dist}
 Epoch:		1
 Group:          System Environment/Base
 License:        GPLv2
@@ -47,6 +47,10 @@ rm -rf %{buildroot}
 %attr(0644,root,root) %{_mandir}/*/*
 
 %changelog
+* Sun Mar 21 2010 Jon Masters <jcm at jonmasters.org> - 1:0.7-5
+- There are test 2.6.32 kernels in F11 now with a newer mce record format.
+- Handle backward compatibility because upstream mcelog does not do that.
+
 * Tue Mar 16 2010 Jon Masters <jcm at jonmasters.org> - 1:0.7-4
 - Add a patch to correct problems with kernel provided mce record length.
 



More information about the scm-commits mailing list