SHA256
1
0
forked from pool/mcelog

Accepting request 357396 from home:trenn:branches:Base:System

- Update to latest version 1.29.
  Mostly little bug fixes.

- Update to version v124. Adds skylake CPU support and some bug fixes.

OBS-URL: https://build.opensuse.org/request/show/357396
OBS-URL: https://build.opensuse.org/package/show/Base:System/mcelog?expand=0&rev=53
This commit is contained in:
Thomas Renninger 2016-02-02 17:14:08 +00:00 committed by Git OBS Bridge
parent 49d6db02db
commit 0959987313
8 changed files with 111 additions and 108 deletions

View File

@ -16,22 +16,22 @@ Signed-off-by: Borislav Petkov <bp@suse.de>
rename k8.c => amd.c (97%)
rename k8.h => amd.h (79%)
Index: mcelog-1.20/Makefile
Index: mcelog-1.29/Makefile
===================================================================
--- mcelog-1.20.orig/Makefile 2015-06-15 15:15:14.281052761 +0200
+++ mcelog-1.20/Makefile 2015-06-15 15:15:52.523239254 +0200
@@ -33,7 +33,7 @@
--- mcelog-1.29.orig/Makefile 2016-01-28 15:33:45.402475555 +0100
+++ mcelog-1.29/Makefile 2016-01-28 15:33:51.646831409 +0100
@@ -33,7 +33,7 @@ all: mcelog
.PHONY: install clean depend
.PHONY: install clean depend FORCE
-OBJ := p4.o k8.o mcelog.o dmi.o tsc.o core2.o bitfield.o intel.o \
+OBJ := p4.o amd.o mcelog.o dmi.o tsc.o core2.o bitfield.o intel.o \
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 \
Index: mcelog-1.20/k8.c
Index: mcelog-1.29/k8.c
===================================================================
--- mcelog-1.20.orig/k8.c 2015-06-15 14:25:23.000000000 +0200
--- mcelog-1.29.orig/k8.c 2016-01-20 18:33:20.000000000 +0100
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,281 +0,0 @@
-/* Based on K8 decoding code written for the 2.4 kernel by Andi Kleen and
@ -315,10 +315,10 @@ Index: mcelog-1.20/k8.c
- }
- return 1;
-}
Index: mcelog-1.20/amd.c
Index: mcelog-1.29/amd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ mcelog-1.20/amd.c 2015-06-15 15:15:52.531239713 +0200
+++ mcelog-1.29/amd.c 2016-01-28 15:33:51.646831409 +0100
@@ -0,0 +1,282 @@
+/* Based on K8 decoding code written for the 2.4 kernel by Andi Kleen and
+ * Eric Morton. Hacked and extended for mcelog by AK.
@ -602,9 +602,9 @@ Index: mcelog-1.20/amd.c
+ }
+ return 1;
+}
Index: mcelog-1.20/k8.h
Index: mcelog-1.29/k8.h
===================================================================
--- mcelog-1.20.orig/k8.h 2015-06-15 14:25:23.000000000 +0200
--- mcelog-1.29.orig/k8.h 2016-01-20 18:33:20.000000000 +0100
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
-char *k8_bank_name(unsigned num);
@ -618,10 +618,10 @@ Index: mcelog-1.20/k8.h
-#define K8_MCELOG_THRESHOLD_LINK (4 * 9 + 1)
-#define K8_MCELOG_THRESHOLD_L3_CACHE (4 * 9 + 2)
-#define K8_MCELOG_THRESHOLD_FBDIMM (4 * 9 + 3)
Index: mcelog-1.20/amd.h
Index: mcelog-1.29/amd.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ mcelog-1.20/amd.h 2015-06-15 15:15:52.539240159 +0200
+++ mcelog-1.29/amd.h 2016-01-28 15:33:51.650831636 +0100
@@ -0,0 +1,14 @@
+char *k8_bank_name(unsigned num);
+void decode_amd_mc(enum cputype, struct mce *mce, int *ismemerr);
@ -637,10 +637,10 @@ Index: mcelog-1.20/amd.h
+
+#define CASE_AMD_CPUS \
+ case CPU_K8
Index: mcelog-1.20/mcelog.c
Index: mcelog-1.29/mcelog.c
===================================================================
--- mcelog-1.20.orig/mcelog.c 2015-06-15 15:15:14.293053554 +0200
+++ mcelog-1.20/mcelog.c 2015-06-15 15:15:52.543240384 +0200
--- mcelog-1.29.orig/mcelog.c 2016-01-28 15:33:45.406475783 +0100
+++ mcelog-1.29/mcelog.c 2016-01-28 15:33:51.650831636 +0100
@@ -41,7 +41,7 @@
#include <fnmatch.h>
#include "mcelog.h"
@ -650,7 +650,7 @@ Index: mcelog-1.20/mcelog.c
#include "intel.h"
#include "p4.h"
#include "dmi.h"
@@ -410,9 +410,9 @@
@@ -419,9 +419,9 @@ static void dump_mce(struct mce *m, unsi
time_t t = m->time;
Wprintf("TIME %llu %s", m->time, ctime(&t));
}

View File

@ -7,26 +7,27 @@
msg.c | 8 ++
6 files changed, 343 insertions(+), 2 deletions(-)
Index: mcelog-1.20/Makefile
Index: mcelog-1.29/Makefile
===================================================================
--- mcelog-1.20.orig/Makefile 2015-06-15 14:25:23.000000000 +0200
+++ mcelog-1.20/Makefile 2015-06-15 15:15:14.281052761 +0200
--- mcelog-1.29.orig/Makefile 2016-01-20 18:33:20.000000000 +0100
+++ mcelog-1.29/Makefile 2016-02-01 17:35:54.959649090 +0100
@@ -1,3 +1,4 @@
+CONFIG_EMAIL := 1
CFLAGS := -g -Os
prefix := /usr
etcprefix :=
@@ -38,7 +39,8 @@
client.o cache.o sysfs.o yellow.o page.o rbtree.o \
xeon75xx.o sandy-bridge.o ivy-bridge.o haswell.o msr.o bus.o unknown.o
@@ -40,8 +41,9 @@ OBJ := p4.o k8.o mcelog.o dmi.o tsc.o co
broadwell_de.o broadwell_epex.o msr.o bus.o \
unknown.o
DISKDB_OBJ := diskdb.o dimm.o db.o
-CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ}
+EMAIL_OBJ := email.o
+CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ} ${EMAIL_OBJ}
CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ} \
- version.o version.c version.tmp
+ ${EMAIL_OBJ} version.o version.c version.tmp
DOC := mce.pdf
ADD_DEFINES :=
@@ -50,6 +52,12 @@
@@ -53,6 +55,12 @@ OBJ += ${DISKDB_OBJ}
all: dbquery
endif
@ -38,12 +39,12 @@ Index: mcelog-1.20/Makefile
+
SRC := $(OBJ:.o=.c)
mcelog: ${OBJ}
Index: mcelog-1.20/email.c
mcelog: ${OBJ} version.o
Index: mcelog-1.29/email.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ mcelog-1.20/email.c 2015-06-15 15:15:14.285053019 +0200
@@ -0,0 +1,199 @@
+++ mcelog-1.29/email.c 2016-02-01 17:33:02.709891934 +0100
@@ -0,0 +1,200 @@
+#include <unistd.h>
+#include <signal.h>
+#include <ctype.h>
@ -107,7 +108,8 @@ Index: mcelog-1.20/email.c
+ debug=0;
+
+ email_env = getenv("MCELOG_ADMIN_EMAIL");
+ if (email_env) {
+ /* No email validation, but at least check for not being empty... */
+ if (email_env && strlen(email_env) > 1) {
+ strncpy(c_recipient, email_env, MAX_STRING_LEN - 1);
+ return 1;
+ }
@ -243,10 +245,10 @@ Index: mcelog-1.20/email.c
+ smtp_destroy_session (session);
+ return 0;
+}
Index: mcelog-1.20/email.h
Index: mcelog-1.29/email.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ mcelog-1.20/email.h 2015-06-15 15:15:14.289053315 +0200
+++ mcelog-1.29/email.h 2016-02-01 17:33:02.709891934 +0100
@@ -0,0 +1,34 @@
+#ifndef _MCELOG_EMAIL_H_
+#define _MCELOG_EMAIL_H_
@ -282,10 +284,10 @@ Index: mcelog-1.20/email.h
+#endif
+
+#endif
Index: mcelog-1.20/mcelog.c
Index: mcelog-1.29/mcelog.c
===================================================================
--- mcelog-1.20.orig/mcelog.c 2015-06-15 14:25:23.000000000 +0200
+++ mcelog-1.20/mcelog.c 2015-06-15 15:15:14.293053554 +0200
--- mcelog-1.29.orig/mcelog.c 2016-01-20 18:33:20.000000000 +0100
+++ mcelog-1.29/mcelog.c 2016-02-01 17:35:10.417125475 +0100
@@ -37,6 +37,7 @@
#include <assert.h>
#include <signal.h>
@ -304,7 +306,7 @@ Index: mcelog-1.20/mcelog.c
enum cputype cputype = CPU_GENERIC;
char *logfn = LOG_DEV_FILENAME;
@@ -72,7 +76,7 @@
@@ -72,7 +76,7 @@ static double cpumhz;
static int cpumhz_forced;
int ascii_mode;
int dump_raw_ascii;
@ -313,23 +315,23 @@ Index: mcelog-1.20/mcelog.c
static char *inputfile;
char *processor_flags;
static int foreground;
@@ -949,6 +953,7 @@
"--pidfile file Write pid of daemon into file\n"
@@ -973,6 +977,7 @@ void usage(void)
"--no-imc-log Disable extended iMC logging\n"
"--is-cpu-supported Exit with return code indicating whether the CPU is supported\n"
);
+ email_usage();
diskdb_usage();
printf("\n");
print_cputypes();
exit(1);
@@ -1016,6 +1021,7 @@
{ "debug-numerrors", 0, NULL, O_DEBUG_NUMERRORS }, /* undocumented: for testing */
@@ -1043,6 +1048,7 @@ static struct option options[] = {
{ "no-imc-log", 0, NULL, O_NO_IMC_LOG },
{ "is-cpu-supported", 0, NULL, O_IS_CPU_SUPPORTED },
DISKDB_OPTIONS
+ EMAIL_OPTIONS
{}
};
@@ -1193,11 +1199,86 @@
@@ -1223,11 +1229,86 @@ static void drop_cred(void)
}
}
@ -416,7 +418,7 @@ Index: mcelog-1.20/mcelog.c
if (recordlen == 0) {
Wprintf("no data in mce record\n");
@@ -1224,12 +1305,16 @@
@@ -1254,12 +1335,16 @@ static void process(int fd, unsigned rec
finish = 1;
if (!mce_filter(mce, recordlen))
continue;
@ -433,7 +435,7 @@ Index: mcelog-1.20/mcelog.c
flushlog();
}
@@ -1340,6 +1425,8 @@
@@ -1370,6 +1455,8 @@ int main(int ac, char **av)
exit(0);
} else if (diskdb_cmd(opt, ac, av)) {
exit(0);
@ -442,7 +444,7 @@ Index: mcelog-1.20/mcelog.c
} else if (opt == 0)
break;
}
@@ -1368,6 +1455,10 @@
@@ -1402,6 +1489,10 @@ int main(int ac, char **av)
logfn = av[optind++];
if (av[optind])
usage();
@ -453,11 +455,11 @@ Index: mcelog-1.20/mcelog.c
checkdmi();
general_setup();
Index: mcelog-1.20/mcelog.h
Index: mcelog-1.29/mcelog.h
===================================================================
--- mcelog-1.20.orig/mcelog.h 2015-06-15 14:25:23.000000000 +0200
+++ mcelog-1.20/mcelog.h 2015-06-15 15:15:14.297053784 +0200
@@ -131,6 +131,7 @@
--- mcelog-1.29.orig/mcelog.h 2016-01-20 18:33:20.000000000 +0100
+++ mcelog-1.29/mcelog.h 2016-02-01 17:35:07.072936045 +0100
@@ -134,6 +134,7 @@ enum cputype {
enum option_ranges {
O_COMMON = 500,
O_DISKDB = 1000,
@ -465,10 +467,10 @@ Index: mcelog-1.20/mcelog.h
};
enum syslog_opt {
Index: mcelog-1.20/msg.c
Index: mcelog-1.29/msg.c
===================================================================
--- mcelog-1.20.orig/msg.c 2015-06-15 14:25:23.000000000 +0200
+++ mcelog-1.20/msg.c 2015-06-15 15:15:14.301053996 +0200
--- mcelog-1.29.orig/msg.c 2016-01-20 18:33:20.000000000 +0100
+++ mcelog-1.29/msg.c 2016-02-01 17:33:02.713892160 +0100
@@ -8,10 +8,13 @@
#include "mcelog.h"
#include "msg.h"
@ -483,7 +485,7 @@ Index: mcelog-1.20/msg.c
static char *output_fn;
int need_stdout(void)
@@ -135,6 +138,11 @@
@@ -135,6 +138,11 @@ int Wprintf(char *fmt, ...)
n = vfprintf(output_fh ? output_fh : stdout, fmt, ap);
va_end(ap);
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1dc7df5d971acab054646289cf2c42d220b890f07f428bb09ad814e86cd688d8
size 281226

3
mcelog-1.29.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b4eca584cecb1a54f49cc9accf7f8ca98716a953a3025884171b591284e9126c
size 282689

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Thu Jan 28 14:25:26 UTC 2016 - trenn@suse.de
- Update to latest version 1.29.
Mostly little bug fixes.
-------------------------------------------------------------------
Mon Sep 28 13:26:21 UTC 2015 - trenn@suse.de
- Update to version v124. Adds skylake CPU support and some bug fixes.
-------------------------------------------------------------------
Mon Jun 15 16:18:55 UTC 2015 - trenn@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package mcelog
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,16 +17,12 @@
Name: mcelog
Version: 1.29
Release: 0
Summary: Log Machine Check Events
License: GPL-2.0
Group: System/Monitoring
Version: 1.20
Release: 0
ExclusiveArch: %{ix86} x86_64
BuildRequires: libesmtp-devel
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
Requires: logrotate
Url: https://git.kernel.org/cgit/utils/cpu/mce/mcelog.git
Source: mcelog-%{version}.tar.bz2
Source2: mcelog.sysconfig
Source3: mcelog.systemd
@ -45,17 +41,20 @@ Patch9: patches/add-f15h-support.patch
Patch10: patches/add-f16h-support.patch
Patch11: mcelog-socket-path.patch
Patch12: fix_setgroups_missing_call.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %fillup_prereq
Url: https://git.kernel.org/cgit/utils/cpu/mce/mcelog.git
BuildRequires: libesmtp-devel
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
Requires: logrotate
Requires(pre): %fillup_prereq
# Previously version was wrong, mainline decided to go for 1.0.1. not 1.1
Obsoletes: mcelog = 1.1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64
%{?systemd_requires}
%description
mcelog retrieves machine check events from an x86-64 kernel in a cron
job, decodes them, and logs them to /var/log/mcelog.
job, decodes them, and logs them to %{_localstatedir}/log/mcelog.
A machine check event is a hardware error detected by the CPU.
@ -63,12 +62,6 @@ It should run on any x86-64 system.
In addition, it allows decoding machine check kernel panic messages.
Authors:
--------
Andi Kleen <andi@firstfloor.org>
%prep
%setup -q
%patch1 -p1
@ -86,38 +79,34 @@ Authors:
%build
export SUSE_ASNEEDED=0
make CFLAGS="$RPM_OPT_FLAGS"
make %{?_smp_mflags} CFLAGS="%{optflags}"
%install
export prefix=$RPM_BUILD_ROOT/usr
export etcprefix=$RPM_BUILD_ROOT
%install
export prefix=%{buildroot}%{_prefix}
export etcprefix=%{buildroot}
make -e install
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/
install -m644 mcelog.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/mcelog
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/
install -m644 mcelog.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/mcelog
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 %SOURCE2 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mcelog
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
install -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.mcelog
mkdir -p $RPM_BUILD_ROOT/%_docdir/%name
install -m 644 %SOURCE6 $RPM_BUILD_ROOT/%_docdir/%name/README.email_setup
install -m 644 lk10-mcelog.pdf $RPM_BUILD_ROOT/%_docdir/%name/lk10-mcelog.pdf
install -D -m 0644 %SOURCE3 %{buildroot}%{_unitdir}/mcelog.service
install -D -m 0644 %SOURCE4 %{buildroot}%{_udevrulesdir}/90-mcelog.rules
install -D -m 0644 %SOURCE5 %{buildroot}%{_tmpfilesdir}/mcelog.conf
ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcmcelog
%clean
rm -rf $RPM_BUILD_ROOT
mkdir -p %{buildroot}/%{_docdir}/%{name}
install -m 644 %{SOURCE6} %{buildroot}/%{_docdir}/%{name}/README.email_setup
install -m 644 lk10-mcelog.pdf %{buildroot}/%{_docdir}/%{name}/lk10-mcelog.pdf
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/mcelog.service
install -D -m 0644 %{SOURCE4} %{buildroot}%{_udevrulesdir}/90-mcelog.rules
install -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/mcelog.conf
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcmcelog
%pre
%service_add_pre %{name}.service
%post
%fillup_only
%{?tmpfiles_create:%tmpfiles_create %{_tmpfilesdir}/mcelog.conf}
%udev_rules_update
%service_add_post %{name}.service
%{?tmpfiles_create:%tmpfiles_create %{_tmpfilesdir}/mcelog.conf}
%preun
%service_del_preun %{name}.service
@ -129,17 +118,17 @@ rm -rf $RPM_BUILD_ROOT
%defattr (-,root,root,755)
%{_mandir}/man8/*
%{_mandir}/man5/*
/usr/sbin/mcelog
%config /etc/logrotate.d/mcelog
%dir /etc/mcelog
%config /etc/mcelog/mcelog.conf
/var/adm/fillup-templates/sysconfig.mcelog
/etc/mcelog/*trigger
%{_sbindir}/mcelog
%config %{_sysconfdir}/logrotate.d/mcelog
%dir %{_sysconfdir}/mcelog
%config %{_sysconfdir}/mcelog/mcelog.conf
%{_localstatedir}/adm/fillup-templates/sysconfig.mcelog
%{_sysconfdir}/mcelog/*trigger
%{_unitdir}/mcelog.service
%{_udevrulesdir}/90-mcelog.rules
%{_tmpfilesdir}/mcelog.conf
%_docdir/%name
%_sbindir/rcmcelog
%{_docdir}/%{name}
%{_sbindir}/rcmcelog
%ghost /run/mcelog
%changelog

View File

@ -4,6 +4,7 @@ ConditionVirtualization=false
[Service]
EnvironmentFile=-/etc/sysconfig/mcelog
ExecStartPre=/sbin/modprobe msr
ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --foreground
StandardOutput=syslog

View File

@ -2,11 +2,11 @@
memdb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: mcelog-1.20/memdb.c
Index: mcelog-1.29/memdb.c
===================================================================
--- mcelog-1.20.orig/memdb.c 2015-06-15 14:25:23.000000000 +0200
+++ mcelog-1.20/memdb.c 2015-06-15 15:15:25.925718586 +0200
@@ -422,11 +422,11 @@
--- mcelog-1.29.orig/memdb.c 2016-01-20 18:33:20.000000000 +0100
+++ mcelog-1.29/memdb.c 2016-01-28 15:33:46.958564233 +0100
@@ -430,11 +430,11 @@ void prefill_memdb(int do_dmi)
md->location = xstrdup(bl);
md->name = xstrdup(dmi_getstring(&d->header, d->device_locator));
}