From 88bed8bbddee488a5041bdcaa498800042159e04 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 02 2019 00:46:21 +0000 Subject: import rasdaemon-0.6.1-2.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69cfd0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/rasdaemon-0.6.1.tar.bz2 diff --git a/.rasdaemon.metadata b/.rasdaemon.metadata new file mode 100644 index 0000000..e6215b6 --- /dev/null +++ b/.rasdaemon.metadata @@ -0,0 +1 @@ +742eda555cccb8ca8f9b6a18bab1f4a732c11318 SOURCES/rasdaemon-0.6.1.tar.bz2 diff --git a/SOURCES/60a91e4da4f2daf2b10143fc148a8043312b61e5.patch b/SOURCES/60a91e4da4f2daf2b10143fc148a8043312b61e5.patch new file mode 100644 index 0000000..57a4e46 --- /dev/null +++ b/SOURCES/60a91e4da4f2daf2b10143fc148a8043312b61e5.patch @@ -0,0 +1,149 @@ +commit 60a91e4da4f2daf2b10143fc148a8043312b61e5 +Author: Aristeu Rozanski +Date: Wed Aug 1 16:29:58 2018 -0400 + + rasdaemon: ras-mc-ctl: add option to show error counts + + In some scenarios it might not be desirable to have a daemon running + to parse and store the errors provided by EDAC and only having the + number of CEs and UEs is enough. This patch implements this feature + as an ras-mc-ctl option. + + Signed-off-by: Aristeu Rozanski + Signed-off-by: Mauro Carvalho Chehab + +diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in +index 38b7824..aee431a 100755 +--- a/util/ras-mc-ctl.in ++++ b/util/ras-mc-ctl.in +@@ -50,6 +50,8 @@ my %dimm_location = (); + my %csrow_size = (); + my %rank_size = (); + my %csrow_ranks = (); ++my %dimm_ce_count = (); ++my %dimm_ue_count = (); + + my @layers; + my @max_pos; +@@ -76,6 +78,7 @@ Usage: $prog [OPTIONS...] + --layout Display the memory layout. + --summary Presents a summary of the logged errors. + --errors Shows the errors stored at the error database. ++ --error-count Shows the corrected and uncorrected error counts using sysfs. + --help This help message. + EOF + +@@ -83,7 +86,7 @@ parse_cmdline(); + + if ( $conf{opt}{mainboard} || $conf{opt}{print_labels} + || $conf{opt}{register_labels} || $conf{opt}{display_memory_layout} +- || $conf{opt}{guess_dimm_label}) { ++ || $conf{opt}{guess_dimm_label} || $conf{opt}{error_count}) { + + get_mainboard_info(); + +@@ -105,6 +108,9 @@ if ( $conf{opt}{mainboard} || $conf{opt}{print_labels} + if ($conf{opt}{guess_dimm_label}) { + guess_dimm_label (); + } ++ if ($conf{opt}{error_count}) { ++ display_error_count (); ++ } + } + + if ($conf{opt}{status}) { +@@ -134,6 +140,7 @@ sub parse_cmdline + $conf{opt}{guess_dimm_label} = 0; + $conf{opt}{summary} = 0; + $conf{opt}{errors} = 0; ++ $conf{opt}{error_count} = 0; + + my $rref = \$conf{opt}{report}; + my $mref = \$conf{opt}{mainboard}; +@@ -150,7 +157,8 @@ sub parse_cmdline + "status" => \$conf{opt}{status}, + "layout" => \$conf{opt}{display_memory_layout}, + "summary" => \$conf{opt}{summary}, +- "errors" => \$conf{opt}{errors} ++ "errors" => \$conf{opt}{errors}, ++ "error-count" => \$conf{opt}{error_count} + ); + + usage(1) if !$rc; +@@ -284,6 +292,30 @@ sub parse_dimm_nodes + $dimm_label_file{$str_loc} = $file; + $dimm_location{$str_loc} = $location; + ++ my $count; ++ ++ $file =~s/dimm_label/dimm_ce_count/; ++ if (-e $file) { ++ open IN, $file; ++ chomp($count = ); ++ close IN; ++ } else { ++ log_error ("dimm_ce_count not found in sysfs. Old kernel?\n"); ++ exit -1; ++ } ++ $dimm_ce_count{$str_loc} = $count; ++ ++ $file =~s/dimm_ce_count/dimm_ue_count/; ++ if (-e $file) { ++ open IN, $file; ++ chomp($count = ); ++ close IN; ++ } else { ++ log_error ("dimm_ue_count not found in sysfs. Old kernel?\n"); ++ exit -1; ++ } ++ $dimm_ue_count{$str_loc} = $count; ++ + return; + } + } +@@ -906,6 +938,45 @@ sub display_memory_layout + dimm_display_mem(); + } + ++sub display_error_count ++{ ++ my $sysfs_dir = "/sys/devices/system/edac/mc"; ++ my $key; ++ my $max_width = 0; ++ my %dimm_labels = (); ++ ++ find ({wanted => \&parse_dimm_nodes, no_chdir => 1}, $sysfs_dir); ++ ++ if (!scalar(keys %dimm_node)) { ++ log_error ("No DIMMs found in /sys or new sysfs EDAC interface not found.\n"); ++ exit -1; ++ } ++ ++ foreach $key (keys %dimm_node) { ++ my $label_width; ++ ++ open IN, $dimm_label_file{$key}; ++ chomp(my $label = ); ++ close IN; ++ $label_width = length $label; ++ ++ if ($label_width > $max_width) { ++ $max_width = $label_width; ++ } ++ $dimm_labels{$key} = $label; ++ } ++ my $string = "Label"; ++ $string .= " " x ($max_width - length $string); ++ print($string . "\tCE\tUE\n"); ++ ++ foreach $key (keys %dimm_node) { ++ my $ce_count = $dimm_ce_count{$key}; ++ my $ue_count = $dimm_ue_count{$key}; ++ ++ print("$dimm_labels{$key}\t$ce_count\t$ue_count\n"); ++ } ++} ++ + sub find_prog + { + my ($file) = @_; diff --git a/SPECS/rasdaemon.spec b/SPECS/rasdaemon.spec new file mode 100644 index 0000000..4040ae0 --- /dev/null +++ b/SPECS/rasdaemon.spec @@ -0,0 +1,154 @@ +Name: rasdaemon +Version: 0.6.1 +Release: 2%{?dist} +Summary: Utility to receive RAS error tracings +Group: Applications/System +License: GPLv2 +URL: http://git.infradead.org/users/mchehab/rasdaemon.git +Source0: http://www.infradead.org/~mchehab/rasdaemon/%{name}-%{version}.tar.bz2 + +ExcludeArch: s390 s390x +BuildRequires: gettext-devel +BuildRequires: perl-generators +BuildRequires: sqlite-devel +BuildRequires: systemd +Provides: bundled(kernel-event-lib) +Requires: hwdata +Requires: perl-DBD-SQLite +%ifarch %{ix86} x86_64 +Requires: dmidecode +%endif + +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +Patch1: 60a91e4da4f2daf2b10143fc148a8043312b61e5.patch + +%description +%{name} is a RAS (Reliability, Availability and Serviceability) logging tool. +It currently records memory errors, using the EDAC tracing events. +EDAC is drivers in the Linux kernel that handle detection of ECC errors +from memory controllers for most chipsets on i386 and x86_64 architectures. +EDAC drivers for other architectures like arm also exists. +This userspace component consists of an init script which makes sure +EDAC drivers and DIMM labels are loaded at system startup, as well as +an utility for reporting current error counts from the EDAC sysfs files. + +%prep +%setup -q +%patch1 -p1 + +%build +%ifarch %{arm} aarch64 +%configure --enable-mce --enable-aer --enable-sqlite3 --enable-extlog --enable-abrt-report --enable-non-standard --enable-hisi-ns-decode --enable-arm +%else +%configure --enable-mce --enable-aer --enable-sqlite3 --enable-extlog --enable-abrt-report +%endif +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} +install -D -p -m 0644 misc/rasdaemon.service %{buildroot}/%{_unitdir}/rasdaemon.service +install -D -p -m 0644 misc/ras-mc-ctl.service %{buildroot}%{_unitdir}/ras-mc-ctl.service +rm INSTALL %{buildroot}/usr/include/*.h + +%files +%doc AUTHORS ChangeLog COPYING README TODO +%{_sbindir}/rasdaemon +%{_sbindir}/ras-mc-ctl +%{_mandir}/*/* +%{_unitdir}/*.service +%{_sharedstatedir}/rasdaemon +%{_sysconfdir}/ras/dimm_labels.d + +%changelog +* Mon Aug 20 2018 Aristeu Rozanski 0.6.1-2 +- Add support for error count display [1573685] + +* Wed Apr 25 2018 Mauro Carvalho Chehab 0.6.1-1 +- Bump to version 0.6.1 adding support for Skylake Xeon MSCOD, a bug fix and some new DELL labels + +* Fri Feb 09 2018 Fedora Release Engineering - 0.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Oct 14 2017 Mauro Carvalho Chehab 0.6.0-1 +- Bump to version 0.6.0 adding support for Arm and Hisilicon events and update Dell Skylate labels + +* Thu Aug 03 2017 Fedora Release Engineering - 0.5.8-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.5.8-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.5.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Apr 15 2016 Mauro Carvalho Chehab 0.5.8-3 +- Add a virtual provide, per BZ#104132 + +* Fri Apr 15 2016 Mauro Carvalho Chehab 0.5.8-2 +- Bump to version 0.5.8 with support for Broadwell EP/EX MSCOD/DE MSCOD + +* Thu Feb 04 2016 Fedora Release Engineering - 0.5.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jul 03 2015 Mauro Carvalho Chehab 0.5.6-1 +- Bump to version 0.5.6 with support for LMCE and some fixes + +* Thu Jun 18 2015 Fedora Release Engineering - 0.5.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Jun 03 2015 Mauro Carvalho Chehab 0.5.5-1 +- Bump to version 0.5.5 with support for newer Intel platforms & some fixes + +* Tue Sep 16 2014 Peter Robinson 0.5.4-3 +- aarch64/ppc64 have edac capabilities +- spec cleanups +- No need to run autoreconf + +* Sun Aug 17 2014 Fedora Release Engineering - 0.5.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Mauro Carvalho Chehab 0.5.4-1 +- Bump to version 0.5.4 with some fixes, mainly for amd64 + +* Sun Aug 10 2014 Mauro Carvalho Chehab 0.5.3-1 +- Bump to version 0.5.3 and enable ABRT and ExtLog + +* Sun Jun 08 2014 Fedora Release Engineering - 0.5.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Apr 03 2014 Mauro Carvalho Chehab 0.5.2-1 +- fix and enable ABRT report support + +* Fri Mar 28 2014 Mauro Carvalho Chehab 0.5.1-1 +- Do some fixes at the service files and add some documentation for --record + +* Sun Feb 16 2014 Mauro Carvalho Chehab 0.5.0-1 +- Add experimental ABRT support + +* Tue Sep 10 2013 Mauro Carvalho Chehab 0.4.2-1 +- Fix ras-mc-ctl layout filling + +* Sun Aug 04 2013 Fedora Release Engineering - 0.4.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 17 2013 Petr Pisar - 0.4.1-4 +- Perl 5.18 rebuild + +* Sun Jun 2 2013 Peter Robinson 0.4.1-3 +- ARM has EDMA drivers (currently supported in Calxeda highbank) + +* Wed May 29 2013 Mauro Carvalho Chehab 0.4.1-2 +- Fix the name of perl-DBD-SQLite package + +* Wed May 29 2013 Mauro Carvalho Chehab 0.4.1-1 +- Updated to version 0.4.1 with contains some bug fixes + +* Tue May 28 2013 Mauro Carvalho Chehab 0.4.0-1 +- Updated to version 0.4.0 and added support for mce, aer and sqlite3 storage + +* Mon May 20 2013 Mauro Carvalho Chehab 0.3.0-1 +- Package created +