Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Oct 2016 04:58:16 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r424671 - in head/sysutils/mcelog: . files
Message-ID:  <201610260458.u9Q4wGR5045224@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Wed Oct 26 04:58:16 2016
New Revision: 424671
URL: https://svnweb.freebsd.org/changeset/ports/424671

Log:
  sysutils/mcelog: update 141 -> 143
  
  - Mark dmi_entry as packed
  - Fix memory leak in sysfs reader for bad fields handling
  - Broadwell: Differentiate regular CE from UC error corrected by
    memory mirror
  - Add support to decode MSCOD values for Denverton server
  
  PR:		213795
  Submitted by:	Ultima1252@gmail.com (maintainer)

Modified:
  head/sysutils/mcelog/Makefile
  head/sysutils/mcelog/distinfo
  head/sysutils/mcelog/files/patch-Makefile
  head/sysutils/mcelog/files/patch-mcelog.c
  head/sysutils/mcelog/files/patch-p4.c

Modified: head/sysutils/mcelog/Makefile
==============================================================================
--- head/sysutils/mcelog/Makefile	Wed Oct 26 04:33:37 2016	(r424670)
+++ head/sysutils/mcelog/Makefile	Wed Oct 26 04:58:16 2016	(r424671)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	mcelog
-PORTVERSION=	141
+PORTVERSION=	143
 DISTVERSIONPREFIX=	v
 CATEGORIES=	sysutils
 

Modified: head/sysutils/mcelog/distinfo
==============================================================================
--- head/sysutils/mcelog/distinfo	Wed Oct 26 04:33:37 2016	(r424670)
+++ head/sysutils/mcelog/distinfo	Wed Oct 26 04:58:16 2016	(r424671)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1473218091
-SHA256 (andikleen-mcelog-v141_GH0.tar.gz) = 30f4e4966ff46a9e32d262295af50b7cb4a865a1231002092b610f2b7306aeec
-SIZE (andikleen-mcelog-v141_GH0.tar.gz) = 295791
+TIMESTAMP = 1476888759
+SHA256 (andikleen-mcelog-v143_GH0.tar.gz) = 721ac477c7b869dd8f056dbb849415690c333434ee38b5c52ebc87c0b08f5ef2
+SIZE (andikleen-mcelog-v143_GH0.tar.gz) = 296859

Modified: head/sysutils/mcelog/files/patch-Makefile
==============================================================================
--- head/sysutils/mcelog/files/patch-Makefile	Wed Oct 26 04:33:37 2016	(r424670)
+++ head/sysutils/mcelog/files/patch-Makefile	Wed Oct 26 04:58:16 2016	(r424671)
@@ -1,4 +1,4 @@
---- Makefile.orig	2016-09-02 21:52:54 UTC
+--- Makefile.orig	2016-10-18 22:32:19 UTC
 +++ Makefile
 @@ -1,5 +1,4 @@
 -CFLAGS := -g -Os
@@ -7,7 +7,7 @@
  etcprefix :=
  MANDIR := ${prefix}/share/man
  # Define appropiately for your distribution
-@@ -27,13 +26,20 @@ all: mcelog
+@@ -27,14 +26,21 @@ all: mcelog
  
  .PHONY: install clean depend FORCE
  
@@ -16,10 +16,11 @@
         nehalem.o dunnington.o tulsa.o config.o memutil.o msg.o   \
 -       eventloop.o leaky-bucket.o memdb.o server.o trigger.o 	 \
 -       client.o cache.o sysfs.o yellow.o page.o rbtree.o 	 \
-+       eventloop.o leaky-bucket.o memdb.o server.o 	 \
-+       client.o cache.o rbtree.o 	 \
++       eventloop.o leaky-bucket.o memdb.o server.o	 	 \
++       client.o cache.o rbtree.o			 	 \
         sandy-bridge.o ivy-bridge.o haswell.o		 	 \
         broadwell_de.o broadwell_epex.o skylake_xeon.o		 \
+        denverton.o						 \
 -       msr.o bus.o unknown.o
 +       msr.o
 +ifndef FREEBSD
@@ -31,7 +32,7 @@
  CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o \
  	version.o version.c version.tmp
  DOC := mce.pdf
-@@ -42,7 +48,7 @@ ADD_DEFINES :=
+@@ -43,7 +49,7 @@ ADD_DEFINES :=
  
  SRC := $(OBJ:.o=.c)
  
@@ -40,7 +41,7 @@
  
  # dbquery intentionally not installed by default
  install: mcelog mcelog.conf mcelog.conf.5 mcelog.triggers.5
-@@ -81,7 +87,7 @@ depend: .depend
+@@ -82,7 +88,7 @@ depend: .depend
  
  version.tmp: FORCE
  	( echo -n "char version[] = \"" ; 	\
@@ -49,7 +50,7 @@
  	if [ -d .git ] ; then 			\
  		git describe --tags HEAD | tr -d '\n'; 	\
  	else 					\
-@@ -97,8 +103,6 @@ version.c: version.tmp
+@@ -98,8 +104,6 @@ version.c: version.tmp
  .depend: ${SRC}
  	${CC} -MM -I. ${SRC} > .depend.X && mv .depend.X .depend
  

Modified: head/sysutils/mcelog/files/patch-mcelog.c
==============================================================================
--- head/sysutils/mcelog/files/patch-mcelog.c	Wed Oct 26 04:33:37 2016	(r424670)
+++ head/sysutils/mcelog/files/patch-mcelog.c	Wed Oct 26 04:58:16 2016	(r424671)
@@ -1,4 +1,4 @@
---- mcelog.c.orig	2016-02-10 18:38:43 UTC
+--- mcelog.c.orig	2016-10-10 22:08:11 UTC
 +++ mcelog.c
 @@ -20,9 +20,22 @@
  #define _GNU_SOURCE 1
@@ -23,7 +23,7 @@
  #include <stdlib.h>
  #include <stdio.h>
  #include <string.h>
-@@ -61,9 +74,25 @@
+@@ -60,9 +73,25 @@
  #include "bus.h"
  #include "unknown.h"
  
@@ -49,7 +49,7 @@
  
  int ignore_nodev;
  int filter_bogus = 1;
-@@ -74,7 +103,9 @@ int ascii_mode;
+@@ -73,7 +102,9 @@ int ascii_mode;
  int dump_raw_ascii;
  int daemon_mode;
  static char *inputfile;
@@ -59,7 +59,7 @@
  static int foreground;
  int filter_memory_errors;
  static struct config_cred runcred = { .uid = -1U, .gid = -1U };
-@@ -83,6 +114,10 @@ static char pidfile_default[] = PID_FILE
+@@ -82,6 +113,10 @@ static char pidfile_default[] = PID_FILE
  static char logfile_default[] = LOG_FILE;
  static char *pidfile = pidfile_default;
  static char *logfile;
@@ -70,7 +70,39 @@
  static int debug_numerrors;
  int imc_log = -1;
  static int check_only = 0;
-@@ -482,6 +517,7 @@ static void dump_mce_raw_ascii(struct mc
+@@ -196,6 +231,7 @@ static void parse_cpuid(u32 cpuid, u32 *
+ 		*model += c.c.ext_model << 4;
+ }
+ 
++#ifdef __Linux__
+ static u32 unparse_cpuid(unsigned family, unsigned model)
+ {
+ 	union { 
+@@ -213,6 +249,7 @@ static u32 unparse_cpuid(unsigned family
+ 		c.c.ext_model = model >> 4;
+ 	return c.v;
+ }
++#endif
+ 
+ static char *cputype_name[] = {
+ 	[CPU_GENERIC] = "generic CPU",
+@@ -325,6 +362,7 @@ static char *vendor[] = {
+ 	[8] = "NSC"
+ };
+ 
++#ifdef __Linux__
+ static unsigned cpuvendor_to_num(char *name)
+ {
+ 	unsigned i;
+@@ -339,6 +377,7 @@ static unsigned cpuvendor_to_num(char *n
+ 			return i;
+ 	return 0;
+ }
++#endif
+ 
+ static char *cpuvendor_name(u32 cpuvendor)
+ {
+@@ -483,6 +522,7 @@ static void dump_mce_raw_ascii(struct mc
  	Wprintf("\n");
  }
  
@@ -78,12 +110,12 @@
  int is_cpu_supported(void)
  { 
  	enum { 
-@@ -552,13 +588,58 @@ int is_cpu_supported(void)
+@@ -553,14 +593,61 @@ int is_cpu_supported(void)
  
  	return 1;
  } 
 +#endif
- 
++
 +#ifdef __FreeBSD__
 +int is_cpu_supported(void)
 +{
@@ -123,9 +155,10 @@
 +	/* Add checks for other CPUs here */
 +		else
 +		return 1;
++	return 0;
 +}
 +#endif
-+
+ 
 +#ifdef __Linux__
  static char *skipspace(char *s)
  {
@@ -135,9 +168,81 @@
  }
 +#endif
  
++#ifdef __Linux__
  static char *skip_syslog(char *s)
  {
-@@ -667,6 +748,7 @@ static int match_patterns(char *s, char 
+ 	char *p;
+@@ -571,7 +658,9 @@ static char *skip_syslog(char *s)
+ 		return p + sizeof("mcelog: ") - 1;
+ 	return s;
+ }
++#endif
+ 	
++#ifdef __Linux__
+ static char *skipgunk(char *s)
+ {
+ 	s = skip_syslog(s);
+@@ -596,12 +685,16 @@ static char *skipgunk(char *s)
+ 
+ 	return skipspace(s);
+ }
++#endif
+ 
++#ifdef __Linux__
+ static inline int urange(unsigned val, unsigned lo, unsigned hi)
+ {
+ 	return val >= lo && val <= hi;
+ }
++#endif
+ 
++#ifdef __Linux__
+ static int is_short(char *name)
+ {
+ 	return strlen(name) == 3 && 
+@@ -609,7 +702,9 @@ static int is_short(char *name)
+ 		islower(name[1]) &&
+ 		islower(name[2]);
+ }
++#endif
+ 
++#ifdef __Linux__
+ static unsigned skip_date(char *s)
+ {
+ 	unsigned day, hour, min, year, sec; 
+@@ -626,6 +721,7 @@ static unsigned skip_date(char *s)
+ 		return 0;
+ 	return next;
+ }
++#endif
+ 
+ static void dump_mce_final(struct mce *m, char *symbol, int missing, int recordlen, 
+ 			   int dseen)
+@@ -646,6 +742,7 @@ static void dump_mce_final(struct mce *m
+ 	flushlog();
+ }
+ 
++#ifdef __Linux__
+ static char *skip_patterns[] = {
+ 	"MCA:*",
+ 	"MCi_MISC register valid*",
+@@ -654,7 +751,9 @@ static char *skip_patterns[] = {
+ 	"Kernel does not support page offline interface",
+ 	NULL
+ };
++#endif
+ 
++#ifdef __Linux__
+ static int match_patterns(char *s, char **pat)
+ {
+ 	for (; *pat; pat++) 
+@@ -662,12 +761,14 @@ static int match_patterns(char *s, char 
+ 			return 0;
+ 	return 1;
+ }
++#endif
+ 
+ #define FIELD(f) \
+ 	if (recordlen < endof_field(struct mce, f)) \
  		recordlen = endof_field(struct mce, f)
  
  /* Decode ASCII input for fatal messages */
@@ -145,7 +250,7 @@
  static void decodefatal(FILE *inf)
  {
  	struct mce m;
-@@ -877,6 +959,227 @@ restart:
+@@ -878,6 +979,227 @@ restart:
  	if (data)
  		dump_mce_final(&m, symbol, missing, recordlen, disclaimer_seen);
  }
@@ -373,7 +478,7 @@
  
  static void remove_pidfile(void)
  {
-@@ -941,6 +1244,10 @@ void usage(void)
+@@ -943,6 +1265,10 @@ void usage(void)
  "  mcelog [options] --ascii < log\n"
  "  mcelog [options] --ascii --file log\n"
  "Decode machine check ASCII output from kernel logs\n"
@@ -384,7 +489,7 @@
  "\n"
  "Options:\n"  
  "--version           Show the version of mcelog and exit\n"
-@@ -1147,6 +1454,14 @@ static int modifier(int opt)
+@@ -1147,6 +1473,14 @@ static int modifier(int opt)
  	case O_IS_CPU_SUPPORTED:
  		check_only = 1;
  		break;
@@ -399,7 +504,7 @@
  	case 0:
  		break;
  	default:
-@@ -1197,10 +1512,12 @@ static int combined_modifier(int opt)
+@@ -1195,10 +1529,12 @@ static int combined_modifier(int opt)
  
  static void general_setup(void)
  {
@@ -412,7 +517,7 @@
  	config_cred("global", "run-credentials", &runcred);
  	if (config_bool("global", "filter-memory-errors") == 1)
  		filter_memory_errors = 1;
-@@ -1223,6 +1540,7 @@ static void drop_cred(void)
+@@ -1221,6 +1557,7 @@ static void drop_cred(void)
  	}
  }
  
@@ -420,7 +525,7 @@
  static void process(int fd, unsigned recordlen, unsigned loglen, char *buf)
  {	
  	int i; 
-@@ -1275,6 +1593,173 @@ static void process(int fd, unsigned rec
+@@ -1273,6 +1610,173 @@ static void process(int fd, unsigned rec
  	if (finish)
  		exit(0);
  }
@@ -594,7 +699,7 @@
  
  static void noargs(int ac, char **av)
  {
-@@ -1333,12 +1818,14 @@ struct mcefd_data {
+@@ -1331,12 +1835,14 @@ struct mcefd_data {
  	char *buf;
  };
  
@@ -609,7 +714,7 @@
  
  static void handle_sigusr1(int sig)
  {
-@@ -1347,13 +1834,18 @@ static void handle_sigusr1(int sig)
+@@ -1345,13 +1851,18 @@ static void handle_sigusr1(int sig)
  
  int main(int ac, char **av) 
  { 
@@ -630,7 +735,7 @@
  		if (opt == '?') {
  			usage(); 
  		} else if (combined_modifier(opt) > 0) {
-@@ -1375,11 +1867,13 @@ int main(int ac, char **av) 
+@@ -1371,11 +1882,13 @@ int main(int ac, char **av) 
  	} 
  
  	/* before doing anything else let's see if the CPUs are supported */
@@ -644,7 +749,7 @@
  	if (check_only)
  		exit(0);
  
-@@ -1398,13 +1892,21 @@ int main(int ac, char **av) 
+@@ -1394,13 +1907,21 @@ int main(int ac, char **av) 
  	}
  
  	modifier_finish();
@@ -666,7 +771,7 @@
  	fd = open(logfn, O_RDONLY); 
  	if (fd < 0) {
  		if (ignore_nodev) 
-@@ -1419,27 +1921,44 @@ int main(int ac, char **av) 
+@@ -1415,27 +1936,44 @@ int main(int ac, char **av) 
  		err("MCE_GET_LOG_LEN");
  
  	d.buf = xalloc(d.recordlen * d.loglen); 

Modified: head/sysutils/mcelog/files/patch-p4.c
==============================================================================
--- head/sysutils/mcelog/files/patch-p4.c	Wed Oct 26 04:33:37 2016	(r424670)
+++ head/sysutils/mcelog/files/patch-p4.c	Wed Oct 26 04:58:16 2016	(r424671)
@@ -1,6 +1,6 @@
---- p4.c.orig	2016-02-10 18:38:43 UTC
+--- p4.c.orig	2016-10-10 22:08:11 UTC
 +++ p4.c
-@@ -175,8 +175,10 @@ static int decode_mca(u64 status, u64 mi
+@@ -176,8 +176,10 @@ static int decode_mca(u64 status, u64 mi
  		levelnum = mca & 3;
  		level = get_LL_str(levelnum);
  		Wprintf("%s Generic cache hierarchy error\n", level);
@@ -11,7 +11,7 @@
  	} else if (test_prefix(4, mca)) {
  		unsigned levelnum, typenum;
  		char *level, *type;
-@@ -185,8 +187,10 @@ static int decode_mca(u64 status, u64 mi
+@@ -186,8 +188,10 @@ static int decode_mca(u64 status, u64 mi
  		levelnum = (mca & TLB_LL_MASK) >> TLB_LL_SHIFT;
  		level = get_LL_str(levelnum);
  		Wprintf("%s TLB %s Error\n", type, level);
@@ -22,7 +22,7 @@
  	} else if (test_prefix(8, mca)) {
  		unsigned typenum = (mca & CACHE_TT_MASK) >> CACHE_TT_SHIFT;
  		unsigned levelnum = (mca & CACHE_LL_MASK) >> CACHE_LL_SHIFT;
-@@ -195,8 +199,10 @@ static int decode_mca(u64 status, u64 mi
+@@ -196,8 +200,10 @@ static int decode_mca(u64 status, u64 mi
  		Wprintf("%s CACHE %s %s Error\n", type, level,
  				get_RRRR_str((mca & CACHE_RRRR_MASK) >> 
  					      CACHE_RRRR_SHIFT));
@@ -33,7 +33,7 @@
  	} else if (test_prefix(10, mca)) {
  		if (mca == 0x400)
  			Wprintf("Internal Timer error\n");
-@@ -215,7 +221,9 @@ static int decode_mca(u64 status, u64 mi
+@@ -216,7 +222,9 @@ static int decode_mca(u64 status, u64 mi
  
  		Wprintf("BUS error: %d %d %s %s %s %s %s\n", socket, cpu,
  			level, pp, rrrr, ii, timeout);
@@ -43,7 +43,7 @@
  		/* IO MCA - reported as bus/interconnect with specific PP,T,RRRR,II,LL values
  		 * and MISCV set. MISC register points to root port that reported the error
  		 * need to cross check with AER logs for more details.
-@@ -231,7 +239,9 @@ static int decode_mca(u64 status, u64 mi
+@@ -232,7 +240,9 @@ static int decode_mca(u64 status, u64 mi
  			fn = EXTRACT(misc, 16, 18);
  			Wprintf("IO MCA reported by root port %x:%02x:%02x.%x\n",
  				seg, bus, dev, fn);
@@ -53,7 +53,14 @@
  		}
  	} else if (test_prefix(7, mca)) {
  		decode_memory_controller(mca, bank);
-@@ -365,14 +375,18 @@ void decode_intel_mc(struct mce *log, in
+@@ -382,19 +392,25 @@ static void decode_thermal(struct mce *l
+ 
+ void decode_intel_mc(struct mce *log, int cputype, int *ismemerr, unsigned size)
+ {
++#ifdef __Linux__
+ 	int socket = size > offsetof(struct mce, socketid) ? (int)log->socketid : -1;
++#endif
+ 	int cpu = log->extcpu ? log->extcpu : log->cpu;
  
  	if (log->bank == MCE_THERMAL_BANK) { 
  		decode_thermal(log, cpu);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610260458.u9Q4wGR5045224>