* Updated to 154

Changes: https://github.com/andikleen/mcelog/releases/tag/v154
This commit is contained in:
Richard Gallamore 2017-10-14 01:30:49 +00:00
parent ba7c70c331
commit 1f7697c7d6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=452039
3 changed files with 44 additions and 40 deletions

View file

@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= mcelog
PORTVERSION= 153
PORTVERSION= 154
DISTVERSIONPREFIX= v
CATEGORIES= sysutils

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1497297738
SHA256 (andikleen-mcelog-v153_GH0.tar.gz) = 9b827f708855804b6952de6f6cbf2f6523fa1203c621e6050064388f459646f1
SIZE (andikleen-mcelog-v153_GH0.tar.gz) = 297099
TIMESTAMP = 1507943280
SHA256 (andikleen-mcelog-v154_GH0.tar.gz) = dde7aa13c5cc4916a168c2a1f68435a41f2236cf222266425942dfbcb735593f
SIZE (andikleen-mcelog-v154_GH0.tar.gz) = 297148

View file

@ -1,4 +1,4 @@
--- mcelog.c.orig 2016-10-10 22:08:11 UTC
--- mcelog.c.orig 2017-10-12 20:42:20 UTC
+++ mcelog.c
@@ -20,9 +20,22 @@
#define _GNU_SOURCE 1
@ -59,7 +59,7 @@
static int foreground;
int filter_memory_errors;
static struct config_cred runcred = { .uid = -1U, .gid = -1U };
@@ -82,6 +113,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,7 @@
static int debug_numerrors;
int imc_log = -1;
static int check_only = 0;
@@ -196,6 +231,7 @@ static void parse_cpuid(u32 cpuid, u32 *
@@ -196,6 +231,7 @@ static void parse_cpuid(u32 cpuid, u32 *family, u32 *m
*model += c.c.ext_model << 4;
}
@ -78,7 +78,7 @@
static u32 unparse_cpuid(unsigned family, unsigned model)
{
union {
@@ -213,6 +249,7 @@ static u32 unparse_cpuid(unsigned family
@@ -213,6 +249,7 @@ static u32 unparse_cpuid(unsigned family, unsigned mod
c.c.ext_model = model >> 4;
return c.v;
}
@ -86,7 +86,7 @@
static char *cputype_name[] = {
[CPU_GENERIC] = "generic CPU",
@@ -325,6 +362,7 @@ static char *vendor[] = {
@@ -329,6 +366,7 @@ static char *vendor[] = {
[8] = "NSC"
};
@ -94,7 +94,7 @@
static unsigned cpuvendor_to_num(char *name)
{
unsigned i;
@@ -339,6 +377,7 @@ static unsigned cpuvendor_to_num(char *n
@@ -343,6 +381,7 @@ static unsigned cpuvendor_to_num(char *name)
return i;
return 0;
}
@ -102,7 +102,7 @@
static char *cpuvendor_name(u32 cpuvendor)
{
@@ -483,6 +522,7 @@ static void dump_mce_raw_ascii(struct mc
@@ -491,6 +530,7 @@ static void dump_mce_raw_ascii(struct mce *m, unsigned
Wprintf("\n");
}
@ -110,12 +110,12 @@
int is_cpu_supported(void)
{
enum {
@@ -553,14 +593,61 @@ int is_cpu_supported(void)
@@ -561,14 +601,61 @@ int is_cpu_supported(void)
return 1;
}
+#endif
+
+#ifdef __FreeBSD__
+int is_cpu_supported(void)
+{
@ -158,7 +158,7 @@
+ return 0;
+}
+#endif
+
+#ifdef __Linux__
static char *skipspace(char *s)
{
@ -172,7 +172,7 @@
static char *skip_syslog(char *s)
{
char *p;
@@ -571,7 +658,9 @@ static char *skip_syslog(char *s)
@@ -579,7 +666,9 @@ static char *skip_syslog(char *s)
return p + sizeof("mcelog: ") - 1;
return s;
}
@ -182,7 +182,7 @@
static char *skipgunk(char *s)
{
s = skip_syslog(s);
@@ -596,12 +685,16 @@ static char *skipgunk(char *s)
@@ -604,12 +693,16 @@ static char *skipgunk(char *s)
return skipspace(s);
}
@ -199,7 +199,7 @@
static int is_short(char *name)
{
return strlen(name) == 3 &&
@@ -609,7 +702,9 @@ static int is_short(char *name)
@@ -617,7 +710,9 @@ static int is_short(char *name)
islower(name[1]) &&
islower(name[2]);
}
@ -209,7 +209,7 @@
static unsigned skip_date(char *s)
{
unsigned day, hour, min, year, sec;
@@ -626,6 +721,7 @@ static unsigned skip_date(char *s)
@@ -634,6 +729,7 @@ static unsigned skip_date(char *s)
return 0;
return next;
}
@ -217,7 +217,7 @@
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
@@ -654,6 +750,7 @@ static void dump_mce_final(struct mce *m, char *symbol
flushlog();
}
@ -225,7 +225,7 @@
static char *skip_patterns[] = {
"MCA:*",
"MCi_MISC register valid*",
@@ -654,7 +751,9 @@ static char *skip_patterns[] = {
@@ -662,7 +759,9 @@ static char *skip_patterns[] = {
"Kernel does not support page offline interface",
NULL
};
@ -235,7 +235,7 @@
static int match_patterns(char *s, char **pat)
{
for (; *pat; pat++)
@@ -662,12 +761,14 @@ static int match_patterns(char *s, char
@@ -670,12 +769,14 @@ static int match_patterns(char *s, char **pat)
return 0;
return 1;
}
@ -250,12 +250,12 @@
static void decodefatal(FILE *inf)
{
struct mce m;
@@ -878,6 +979,227 @@ restart:
@@ -886,7 +987,228 @@ restart:
if (data)
dump_mce_final(&m, symbol, missing, recordlen, disclaimer_seen);
}
+#endif
+
+#ifdef __FreeBSD__
+/*
+ * Table used to map cpuid vendor strings and FreeBSD CPU vendor IDs
@ -475,10 +475,11 @@
+ }
+}
+#endif
+
static void remove_pidfile(void)
{
@@ -943,6 +1265,10 @@ void usage(void)
unlink(pidfile);
@@ -951,6 +1273,10 @@ void usage(void)
" mcelog [options] --ascii < log\n"
" mcelog [options] --ascii --file log\n"
"Decode machine check ASCII output from kernel logs\n"
@ -489,9 +490,9 @@
"\n"
"Options:\n"
"--version Show the version of mcelog and exit\n"
@@ -1147,6 +1473,14 @@ static int modifier(int opt)
case O_IS_CPU_SUPPORTED:
check_only = 1;
@@ -1168,6 +1494,14 @@ static int modifier(int opt)
usage();
exit(0);
break;
+#ifdef __FreeBSD__
+ case 'M':
@ -504,7 +505,7 @@
case 0:
break;
default:
@@ -1195,10 +1529,12 @@ static int combined_modifier(int opt)
@@ -1218,10 +1552,12 @@ static int combined_modifier(int opt)
static void general_setup(void)
{
@ -517,7 +518,7 @@
config_cred("global", "run-credentials", &runcred);
if (config_bool("global", "filter-memory-errors") == 1)
filter_memory_errors = 1;
@@ -1221,6 +1557,7 @@ static void drop_cred(void)
@@ -1244,6 +1580,7 @@ static void drop_cred(void)
}
}
@ -525,12 +526,12 @@
static void process(int fd, unsigned recordlen, unsigned loglen, char *buf)
{
int i;
@@ -1273,6 +1610,173 @@ static void process(int fd, unsigned rec
@@ -1296,7 +1633,174 @@ static void process(int fd, unsigned recordlen, unsign
if (finish)
exit(0);
}
+#endif
+
+#ifdef __FreeBSD__
+#ifdef LOCAL_HACK
+struct mca_record_old {
@ -696,10 +697,11 @@
+ exit(0);
+}
+#endif
+
static void noargs(int ac, char **av)
{
@@ -1331,12 +1835,14 @@ struct mcefd_data {
if (getopt_long(ac, av, "", options, NULL) != -1) {
@@ -1358,12 +1862,14 @@ struct mcefd_data {
char *buf;
};
@ -714,7 +716,7 @@
static void handle_sigusr1(int sig)
{
@@ -1345,13 +1851,18 @@ static void handle_sigusr1(int sig)
@@ -1372,13 +1878,18 @@ static void handle_sigusr1(int sig)
int main(int ac, char **av)
{
@ -734,8 +736,8 @@
+#endif
if (opt == '?') {
usage();
} else if (combined_modifier(opt) > 0) {
@@ -1371,11 +1882,13 @@ int main(int ac, char **av)
exit(1);
@@ -1399,11 +1910,13 @@ int main(int ac, char **av)
}
/* before doing anything else let's see if the CPUs are supported */
@ -749,7 +751,7 @@
if (check_only)
exit(0);
@@ -1394,13 +1907,21 @@ int main(int ac, char **av)
@@ -1422,15 +1935,23 @@ int main(int ac, char **av)
}
modifier_finish();
@ -757,13 +759,15 @@
if (av[optind])
logfn = av[optind++];
+#endif
if (av[optind])
if (av[optind]) {
usage();
+#ifdef __FreeBSD__
+ if ((corefile != NULL) ^ (execfile != NULL) ||
+ (corefile != NULL && daemon_mode))
+ usage();
+#endif
exit(1);
}
checkdmi();
general_setup();
@ -771,7 +775,7 @@
fd = open(logfn, O_RDONLY);
if (fd < 0) {
if (ignore_nodev)
@@ -1415,27 +1936,44 @@ int main(int ac, char **av)
@@ -1445,27 +1966,44 @@ int main(int ac, char **av)
err("MCE_GET_LOG_LEN");
d.buf = xalloc(d.recordlen * d.loglen);