8 Star 1 Fork 7

src-anolis-os/rasdaemon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
1048-Do-a-coding-style-cleanup-with-regards-to-tabs-and-w.patch 82.68 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343
From 964756be1024a526dbe343bea7a161535051065b Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <[email protected]>
Date: Tue, 11 Jun 2024 12:01:40 +0200
Subject: [PATCH 48/85] Do a coding style cleanup with regards to tabs and
white spaces
Use tabs instead of spaces and remove blank ending whitespaces.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
labels/supermicro | 16 +-
util/ras-mc-ctl.in | 1765 ++++++++++++++++++++++----------------------
2 files changed, 890 insertions(+), 891 deletions(-)
diff --git a/labels/supermicro b/labels/supermicro
index aea7c3c..d358bcd 100644
--- a/labels/supermicro
+++ b/labels/supermicro
@@ -64,7 +64,7 @@ Vendor: Supermicro
P1_DIMM4B: 1.1.1;
P2_DIMM4B: 2.0.1;
P2_DIMM4B: 2.1.1;
-
+
Model: X11DPH-i, X11DPH-T, X11DPH-TQ
P1-DIMMA1: 0.0.0; P1-DIMMA2: 0.0.1;
P1-DIMMB1: 0.1.0;
@@ -78,7 +78,7 @@ Vendor: Supermicro
P2-DIMMD1: 3.0.0; P2-DIMMD2: 3.0.1;
P2-DIMME1: 3.1.0;
P2-DIMMF1: 3.2.0;
-
+
Model: X10DRI, X10DRI-T
P1-DIMMA1: 0.0.0; P1-DIMMA2: 0.0.1;
P1-DIMMB1: 0.1.0; P1-DIMMB2: 0.1.1;
@@ -98,7 +98,7 @@ Vendor: Supermicro
P2-DIMMF1: 1.1.0;
P2-DIMMG1: 1.2.0;
P2-DIMMH1: 1.3.0;
-
+
Model: X11DDW-NT, X11DDW-L
P1-DIMMA1: 0.0.0;
P1-DIMMB1: 0.1.0;
@@ -112,7 +112,7 @@ Vendor: Supermicro
P2-DIMMD1: 3.0.0;
P2-DIMME1: 3.1.0;
P2-DIMMF1: 3.2.0;
-
+
Model: X11SPM-F, X11SPM-TF, X11SPM-TPF
DIMMA1: 0.0.0;
DIMMB1: 0.1.0;
@@ -120,7 +120,7 @@ Vendor: Supermicro
DIMMD1: 1.0.0;
DIMME1: 1.1.0;
DIMMF1: 1.2.0;
-
+
Model: B1DRi
P1_DIMMA1: 0.0.0;
P1_DIMMB1: 0.1.0;
@@ -130,13 +130,13 @@ Vendor: Supermicro
P2_DIMMF1: 1.1.0;
P2_DIMMG1: 1.2.0;
P2_DIMMH1: 1.3.0;
-
+
Model: X11SCA, X11SCA-F
DIMMA1: 0.0.0, 0.1.0; DIMMA2: 0.2.0, 0.3.0;
DIMMB1: 0.0.1, 0.1.1; DIMMB2: 0.2.1, 0.3.1;
-
+
Model: X11SCW-F
DIMMA1: 0.1.0;
DIMMA2: 0.0.0;
DIMMB1: 0.1.1;
- DIMMB2: 0.0.1;
\ No newline at end of file
+ DIMMB2: 0.0.1;
diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
index 725d215..b971ddd 100755
--- a/util/ras-mc-ctl.in
+++ b/util/ras-mc-ctl.in
@@ -112,25 +112,25 @@ if ( $conf{opt}{mainboard} || $conf{opt}{print_labels}
get_mainboard_info();
if ($conf{opt}{mainboard} eq "report") {
- print "$prog: mainboard: ",
- "$conf{mainboard}{vendor} model $conf{mainboard}{model}\n";
+ print "$prog: mainboard: ",
+ "$conf{mainboard}{vendor} model $conf{mainboard}{model}\n";
}
if ($conf{opt}{print_labels}) {
- print_dimm_labels ();
+ print_dimm_labels ();
}
if ($conf{opt}{register_labels}) {
- register_dimm_labels ();
+ register_dimm_labels ();
}
if ($conf{opt}{display_memory_layout}) {
- display_memory_layout ();
+ display_memory_layout ();
}
if ($conf{opt}{guess_dimm_label}) {
- guess_dimm_label ();
+ guess_dimm_label ();
}
if ($conf{opt}{error_count}) {
- display_error_count ();
+ display_error_count ();
}
}
@@ -184,39 +184,39 @@ sub parse_cmdline
Getopt::Long::Configure ("bundling");
my $rc = GetOptions ("mainboard:s" => sub { $$mref = $_[1]||"report" },
- "help" => sub {usage (0)},
- "quiet" => \$conf{opt}{quiet},
- "print-labels" => \$conf{opt}{print_labels},
- "guess-labels" => \$conf{opt}{guess_dimm_label},
- "register-labels" => \$conf{opt}{register_labels},
- "delay:s" => \$conf{opt}{delay},
- "labeldb=s" => \$conf{labeldb},
- "status" => \$conf{opt}{status},
- "layout" => \$conf{opt}{display_memory_layout},
- "summary" => \$conf{opt}{summary},
- "errors" => \$conf{opt}{errors},
- "error-count" => \$conf{opt}{error_count},
- "vendor-errors-summary" => \$conf{opt}{vendor_errors_summary},
- "vendor-errors" => \$conf{opt}{vendor_errors},
- "since=s" => \$conf{opt}{since},
- "vendor-platforms" => \$conf{opt}{vendor_platforms},
- );
+ "help" => sub {usage (0)},
+ "quiet" => \$conf{opt}{quiet},
+ "print-labels" => \$conf{opt}{print_labels},
+ "guess-labels" => \$conf{opt}{guess_dimm_label},
+ "register-labels" => \$conf{opt}{register_labels},
+ "delay:s" => \$conf{opt}{delay},
+ "labeldb=s" => \$conf{labeldb},
+ "status" => \$conf{opt}{status},
+ "layout" => \$conf{opt}{display_memory_layout},
+ "summary" => \$conf{opt}{summary},
+ "errors" => \$conf{opt}{errors},
+ "error-count" => \$conf{opt}{error_count},
+ "vendor-errors-summary" => \$conf{opt}{vendor_errors_summary},
+ "vendor-errors" => \$conf{opt}{vendor_errors},
+ "since=s" => \$conf{opt}{since},
+ "vendor-platforms" => \$conf{opt}{vendor_platforms},
+ );
usage(1) if !$rc;
usage (0) if !grep $conf{opt}{$_}, keys %{$conf{opt}};
if ($conf{opt}{delay} && !$conf{opt}{register_labels}) {
- log_error ("Only use --delay with --register-labels\n");
- exit (1);
+ log_error ("Only use --delay with --register-labels\n");
+ exit (1);
}
if ($conf{opt}{since}) {
- if ($conf{opt}{since} !~ /^20\d\d-[01]\d-[0-3]\d/) {
- log_error ("--since requires a date like yyyy-mm-dd where yyyy is the year, mm the month, and dd the day\n");
- exit (1);
- }
- $conf{opt}{since} = " where timestamp>='$conf{opt}{since}'";
+ if ($conf{opt}{since} !~ /^20\d\d-[01]\d-[0-3]\d/) {
+ log_error ("--since requires a date like yyyy-mm-dd where yyyy is the year, mm the month, and dd the day\n");
+ exit (1);
+ }
+ $conf{opt}{since} = " where timestamp>='$conf{opt}{since}'";
}
}
@@ -239,14 +239,14 @@ sub print_status
{
my $status = 0;
open (MODULES, "/proc/modules")
- or die "Unable to open /proc/modules: $!\n";
+ or die "Unable to open /proc/modules: $!\n";
while (<MODULES>) {
$status = 1 if /_edac/;
}
print "$prog: drivers ", ($status ? "are" : "not"), " loaded.\n"
- unless $conf{opt}{quiet};
+ unless $conf{opt}{quiet};
return ($status);
}
@@ -256,118 +256,118 @@ sub parse_dimm_nodes
my $file = $File::Find::name;
if (($file =~ /max_location$/)) {
- open IN, $file;
- my $location = <IN>;
- $location =~ s/\s+$//;
- close IN;
- my @temp = split(/ /, $location);
-
- $layers[0] = "mc";
-
- if (m,/mc/mc(\d+),) {
- $max_pos[0] = $1 if (!exists($max_pos[0]) || $1 > $max_pos[0]);
- } else {
- $max_pos[0] = 0 if (!exists($max_pos[0]));
- }
- for (my $i = 0; $i < scalar(@temp); $i += 2) {
- $layers[$i / 2 + 1] = $temp[$i];
- $max_pos[$i / 2 + 1] = $temp[$i + 1];
- }
-
- return;
+ open IN, $file;
+ my $location = <IN>;
+ $location =~ s/\s+$//;
+ close IN;
+ my @temp = split(/ /, $location);
+
+ $layers[0] = "mc";
+
+ if (m,/mc/mc(\d+),) {
+ $max_pos[0] = $1 if (!exists($max_pos[0]) || $1 > $max_pos[0]);
+ } else {
+ $max_pos[0] = 0 if (!exists($max_pos[0]));
+ }
+ for (my $i = 0; $i < scalar(@temp); $i += 2) {
+ $layers[$i / 2 + 1] = $temp[$i];
+ $max_pos[$i / 2 + 1] = $temp[$i + 1];
+ }
+
+ return;
}
if ($file =~ /size_mb$/) {
- my $mc = $file;
- $mc =~ s,.*mc(\d+).*,$1,;
+ my $mc = $file;
+ $mc =~ s,.*mc(\d+).*,$1,;
- my $csrow = $file;
- $csrow =~ s,.*csrow(\d+).*,$1,;
+ my $csrow = $file;
+ $csrow =~ s,.*csrow(\d+).*,$1,;
- open IN, $file;
- my $size = <IN>;
- close IN;
+ open IN, $file;
+ my $size = <IN>;
+ close IN;
- my $str_loc = join(':', $mc, $csrow);
- $csrow_size{$str_loc} = $size;
+ my $str_loc = join(':', $mc, $csrow);
+ $csrow_size{$str_loc} = $size;
- return;
+ return;
}
if ($file =~ /location$/) {
- my $mc = $file;
- $mc =~ s,.*mc(\d+).*,$1,;
-
- my $dimm = $file;
- $dimm =~ s,.*(rank|dimm)(\d+).*,$2,;
-
- open IN, $file;
- my $location = <IN>;
- $location =~ s/\s+$//;
- close IN;
-
- my @pos;
-
- # Get the name of the hierarchy labels
- if (!@layers) {
- my @temp = split(/ /, $location);
- $max_pos[0] = 0;
- $layers[0] = "mc";
- for (my $i = 0; $i < scalar(@temp); $i += 2) {
- $layers[$i / 2 + 1] = $temp[$i];
- $max_pos[$i / 2 + 1] = 0;
- }
- }
-
- my @temp = split(/ /, $location);
- for (my $i = 1; $i < scalar(@temp); $i += 2) {
- $pos[$i / 2] = $temp[$i];
-
- if ($pos[$i / 2] > $max_pos[$i / 2 + 1]) {
- $max_pos[$i / 2 + 1] = $pos[$i / 2];
- }
- }
- if ($mc > $max_pos[0]) {
- $max_pos[0] = $mc;
- }
-
- # Get DIMM size
-
- $file =~ s/dimm_location/size/;
- open IN, $file;
- my $size = <IN>;
- close IN;
-
- my $str_loc = join(':', $mc, @pos);
- $dimm_size{$str_loc} = $size;
- $dimm_node{$str_loc} = $dimm;
- $file =~ s/size/dimm_label/;
- $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 = <IN>);
- 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 = <IN>);
- close IN;
- } else {
- log_error ("dimm_ue_count not found in sysfs. Old kernel?\n");
- exit -1;
- }
- $dimm_ue_count{$str_loc} = $count;
-
- return;
+ my $mc = $file;
+ $mc =~ s,.*mc(\d+).*,$1,;
+
+ my $dimm = $file;
+ $dimm =~ s,.*(rank|dimm)(\d+).*,$2,;
+
+ open IN, $file;
+ my $location = <IN>;
+ $location =~ s/\s+$//;
+ close IN;
+
+ my @pos;
+
+ # Get the name of the hierarchy labels
+ if (!@layers) {
+ my @temp = split(/ /, $location);
+ $max_pos[0] = 0;
+ $layers[0] = "mc";
+ for (my $i = 0; $i < scalar(@temp); $i += 2) {
+ $layers[$i / 2 + 1] = $temp[$i];
+ $max_pos[$i / 2 + 1] = 0;
+ }
+ }
+
+ my @temp = split(/ /, $location);
+ for (my $i = 1; $i < scalar(@temp); $i += 2) {
+ $pos[$i / 2] = $temp[$i];
+
+ if ($pos[$i / 2] > $max_pos[$i / 2 + 1]) {
+ $max_pos[$i / 2 + 1] = $pos[$i / 2];
+ }
+ }
+ if ($mc > $max_pos[0]) {
+ $max_pos[0] = $mc;
+ }
+
+ # Get DIMM size
+
+ $file =~ s/dimm_location/size/;
+ open IN, $file;
+ my $size = <IN>;
+ close IN;
+
+ my $str_loc = join(':', $mc, @pos);
+ $dimm_size{$str_loc} = $size;
+ $dimm_node{$str_loc} = $dimm;
+ $file =~ s/size/dimm_label/;
+ $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 = <IN>);
+ 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 = <IN>);
+ close IN;
+ } else {
+ log_error ("dimm_ue_count not found in sysfs. Old kernel?\n");
+ exit -1;
+ }
+ $dimm_ue_count{$str_loc} = $count;
+
+ return;
}
}
@@ -376,14 +376,14 @@ sub guess_product {
my $pname = undef;
if (open (VENDOR, "/sys/class/dmi/id/product_vendor")) {
- $pvendor = <VENDOR>;
- close VENDOR;
- chomp($pvendor);
+ $pvendor = <VENDOR>;
+ close VENDOR;
+ chomp($pvendor);
}
if (open (NAME, "/sys/class/dmi/id/product_name")) {
- $pname = <NAME>;
- close NAME;
- chomp($pname);
+ $pname = <NAME>;
+ close NAME;
+ chomp($pname);
}
return ($pvendor, $pname);
@@ -394,11 +394,11 @@ sub get_mainboard_info {
my ($pvendor, $pname);
if ($conf{opt}{mainboard} && $conf{opt}{mainboard} ne "report") {
- ($vendor, $model) = split (/[: ]/, $conf{opt}{mainboard}, 2);
+ ($vendor, $model) = split (/[: ]/, $conf{opt}{mainboard}, 2);
}
if (!$vendor || !$model) {
- ($vendor, $model) = guess_vendor_model ();
+ ($vendor, $model) = guess_vendor_model ();
}
$conf{mainboard}{vendor} = $vendor;
@@ -407,9 +407,9 @@ sub get_mainboard_info {
($pvendor, $pname) = guess_product ();
# since product vendor is rare, use mainboard's vendor
if ($pvendor) {
- $conf{mainboard}{product_vendor} = $pvendor;
+ $conf{mainboard}{product_vendor} = $pvendor;
} else {
- $conf{mainboard}{product_vendor} = $vendor;
+ $conf{mainboard}{product_vendor} = $vendor;
}
$conf{mainboard}{product_name} = $pname if $pname;
}
@@ -427,25 +427,25 @@ sub guess_vendor_model_dmidecode {
LINE:
while (<DMI>) {
- $line++;
+ $line++;
- /^(\s*)(board|base board|system) information/i || next LINE;
- my $indent = $1;
+ /^(\s*)(board|base board|system) information/i || next LINE;
+ my $indent = $1;
my $type = $2;
- while ( <DMI> ) {
- /^(\s*)/;
- $1 lt $indent && last LINE;
- $indent = $1;
- if ($type eq "system") {
- /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $system_vendor = $1 );
- /product(?: name)?:\s*(.*\S)\s*/i && ( $system_model = $1 );
- } else {
- /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $vendor = $1 );
- /product(?: name)?:\s*(.*\S)\s*/i && ( $model = $1 );
- }
- last LINE if ($vendor && $model);
- }
+ while ( <DMI> ) {
+ /^(\s*)/;
+ $1 lt $indent && last LINE;
+ $indent = $1;
+ if ($type eq "system") {
+ /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $system_vendor = $1 );
+ /product(?: name)?:\s*(.*\S)\s*/i && ( $system_model = $1 );
+ } else {
+ /(?:manufacturer|vendor):\s*(.*\S)\s*/i && ( $vendor = $1 );
+ /product(?: name)?:\s*(.*\S)\s*/i && ( $model = $1 );
+ }
+ last LINE if ($vendor && $model);
+ }
}
close (DMI);
@@ -483,18 +483,18 @@ sub parse_mainboard_config
open (CFG, "$file") or die "Failed to read mainboard config: $file: $!\n";
while (<CFG>) {
- $line++;
- chomp; # remove newline
- s/^((?:[^'"#]*(?:(['"])[^\2]*\2)*)*)#.*/$1/; # remove comments
- s/^\s+//; # remove leading space
- s/\s+$//; # remove trailing space
- next unless length; # skip blank lines
- if (my ($key, $val) = /^\s*([-\w]+)\s*=\s*(.*)/) {
- $hash{$key}{val} = $val;
- $hash{$key}{line} = $line;
- next;
- }
- return undef;
+ $line++;
+ chomp; # remove newline
+ s/^((?:[^'"#]*(?:(['"])[^\2]*\2)*)*)#.*/$1/; # remove comments
+ s/^\s+//; # remove leading space
+ s/\s+$//; # remove trailing space
+ next unless length; # skip blank lines
+ if (my ($key, $val) = /^\s*([-\w]+)\s*=\s*(.*)/) {
+ $hash{$key}{val} = $val;
+ $hash{$key}{line} = $line;
+ next;
+ }
+ return undef;
}
close (CFG) or &log_error ("close $file: $!\n");
return \%hash;
@@ -507,16 +507,16 @@ sub guess_vendor_model {
# to get the vendor and model information.
#
if (-f $conf{mbconfig} ) {
- my $cfg = &parse_mainboard_config ($conf{mbconfig});
+ my $cfg = &parse_mainboard_config ($conf{mbconfig});
- # If mainboard config file specified a script, then try to
- # run the specified script or executable:
- #
- if ($cfg->{"script"}) {
- $cfg = &parse_mainboard_config ("$cfg->{script}{val} |");
- die "Failed to run mainboard script\n" if (!$cfg);
- }
- return ($cfg->{vendor}{val}, $cfg->{model}{val});
+ # If mainboard config file specified a script, then try to
+ # run the specified script or executable:
+ #
+ if ($cfg->{"script"}) {
+ $cfg = &parse_mainboard_config ("$cfg->{script}{val} |");
+ die "Failed to run mainboard script\n" if (!$cfg);
+ }
+ return ($cfg->{vendor}{val}, $cfg->{model}{val});
}
($vendor, $model) = &guess_vendor_model_sysfs ();
@@ -531,10 +531,10 @@ sub guess_dimm_label {
LINE:
while (<DMI>) {
- /^(\s*)memory device$/i || next LINE;
+ /^(\s*)memory device$/i || next LINE;
my ($dimm_label, $dimm_addr);
- while (<DMI>) {
+ while (<DMI>) {
if (/^\s*(locator|bank locator)/i) {
my $indent = $1;
$indent =~ tr/A-Z/a-z/;
@@ -552,7 +552,7 @@ sub guess_dimm_label {
next LINE;
}
next LINE if (/^\s*\n/);
- }
+ }
}
close (DMI);
@@ -568,84 +568,84 @@ sub parse_dimm_labels_file
my $num;
open (LABELS, "$file")
- or die "Unable to open label database: $file: $!\n";
+ or die "Unable to open label database: $file: $!\n";
while (<LABELS>) {
- $line++;
- next if /^#/;
- chomp;
- s/^\s+//;
- s/\s+$//;
- next unless length;
-
- if (/vendor\s*:\s*(.*\S)\s*/i) {
- $vendor = lc $1;
- @models = ();
- @products = ();
- $num = 0;
- next;
- }
- if (/(model|board)\s*:\s*(.*)$/i) {
- !$vendor && die "$file: line $line: MB model without vendor\n";
- @models = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2);
- @products = ();
- $num = 0;
- next;
- }
- if (/(product)\s*:\s*(.*)$/i) {
- !$vendor && die "$file: line $line: product without vendor\n";
- @models = ();
- @products = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2);
- $num = 0;
- next;
- }
-
- # Allow multiple labels to be specified on a single line,
- # separated by ;
- for my $str (split /;/) {
- $str =~ s/^\s*(.*)\s*$/$1/;
-
- next unless (my ($label, $info) = ($str =~ /^(.*)\s*:\s*(.*)$/i));
-
- unless ($info =~ /\d+(?:[\.\:]\d+)*/) {
- log_error ("$file: $line: Invalid syntax, ignoring: \"$_\"\n");
- next;
- }
-
- for my $target (split (/[, ]+/, $info)) {
- my $n;
- my ($mc, $top, $mid, $low, $extra) = ($target =~ /(\d+)(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}/);
-
- if (defined($extra)) {
- die ("Error: Only up to 3 layers are currently supported on label db \"$file\"\n");
- return;
- } elsif (!defined($top)) {
- die ("Error: The label db \"$file\" is defining a zero-layers machine\n");
- return;
- } else {
- $n = 3;
- if (!defined($low)) {
- $low = 0;
- $n--;
- }
- if (!defined($mid)) {
- $mid = 0;
- $n--;
- }
- map { $lh->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label }
- @models;
- map { $lh_prod->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label }
- @products;
- }
- if (!$num) {
- $num = $n;
- map { $num_layers->{$vendor}{lc $_} = $num } @models;
- map { $num_layers_prod->{$vendor}{lc $_} = $num } @products;
- } elsif ($num != $n) {
- die ("Error: Inconsistent number of layers at label db \"$file\"\n");
- }
- }
- }
+ $line++;
+ next if /^#/;
+ chomp;
+ s/^\s+//;
+ s/\s+$//;
+ next unless length;
+
+ if (/vendor\s*:\s*(.*\S)\s*/i) {
+ $vendor = lc $1;
+ @models = ();
+ @products = ();
+ $num = 0;
+ next;
+ }
+ if (/(model|board)\s*:\s*(.*)$/i) {
+ !$vendor && die "$file: line $line: MB model without vendor\n";
+ @models = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2);
+ @products = ();
+ $num = 0;
+ next;
+ }
+ if (/(product)\s*:\s*(.*)$/i) {
+ !$vendor && die "$file: line $line: product without vendor\n";
+ @models = ();
+ @products = grep { s/\s*(.*)\s*$/$1/ } split(/[,;]+/, $2);
+ $num = 0;
+ next;
+ }
+
+ # Allow multiple labels to be specified on a single line,
+ # separated by ;
+ for my $str (split /;/) {
+ $str =~ s/^\s*(.*)\s*$/$1/;
+
+ next unless (my ($label, $info) = ($str =~ /^(.*)\s*:\s*(.*)$/i));
+
+ unless ($info =~ /\d+(?:[\.\:]\d+)*/) {
+ log_error ("$file: $line: Invalid syntax, ignoring: \"$_\"\n");
+ next;
+ }
+
+ for my $target (split (/[, ]+/, $info)) {
+ my $n;
+ my ($mc, $top, $mid, $low, $extra) = ($target =~ /(\d+)(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}/);
+
+ if (defined($extra)) {
+ die ("Error: Only up to 3 layers are currently supported on label db \"$file\"\n");
+ return;
+ } elsif (!defined($top)) {
+ die ("Error: The label db \"$file\" is defining a zero-layers machine\n");
+ return;
+ } else {
+ $n = 3;
+ if (!defined($low)) {
+ $low = 0;
+ $n--;
+ }
+ if (!defined($mid)) {
+ $mid = 0;
+ $n--;
+ }
+ map { $lh->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label }
+ @models;
+ map { $lh_prod->{$vendor}{lc $_}{$mc}{$top}{$mid}{$low} = $label }
+ @products;
+ }
+ if (!$num) {
+ $num = $n;
+ map { $num_layers->{$vendor}{lc $_} = $num } @models;
+ map { $num_layers_prod->{$vendor}{lc $_} = $num } @products;
+ } elsif ($num != $n) {
+ die ("Error: Inconsistent number of layers at label db \"$file\"\n");
+ }
+ }
+ }
}
close (LABELS) or die "Error from label db \"$file\" : $!\n";
@@ -663,8 +663,8 @@ sub parse_dimm_labels
# well as any files under the labels dir
#
for my $file ($conf{labeldb}, <$conf{labeldir}/*>) {
- next unless -r $file;
- parse_dimm_labels_file (\%labels, \%num_layers, \%labels_prod, \%num_layers_prod, $file);
+ next unless -r $file;
+ parse_dimm_labels_file (\%labels, \%num_layers, \%labels_prod, \%num_layers_prod, $file);
}
return (\%labels, \%num_layers, \%labels_prod, \%num_layers_prod);
@@ -681,9 +681,9 @@ sub read_dimm_label
$pos = "$mc:$top" if ($num_layers == 1);
if (!defined($dimm_node{$pos})) {
- my $label = "$pos missing";
- $pos = "";
- return ($label, $pos);
+ my $label = "$pos missing";
+ $pos = "";
+ return ($label, $pos);
}
my $dimm = $dimm_node{$pos};
@@ -695,8 +695,8 @@ sub read_dimm_label
return ("label missing", "$pos missing") unless -f $dimm_label_file;
if (!open (LABEL, "$dimm_label_file")) {
- warn "Failed to open $dimm_label_file: $!\n";
- return ("Error");
+ warn "Failed to open $dimm_label_file: $!\n";
+ return ("Error");
}
chomp (my $label = <LABEL> || "");
@@ -729,16 +729,16 @@ sub _print_dimm_labels
my ($lref, $num_layers, $vendor, $model, $fh, $format) = @_;
for my $mc (sort keys %{$$lref{$vendor}{$model}}) {
- for my $top (sort keys %{$$lref{$vendor}{$model}{$mc}}) {
- for my $mid (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}}) {
- for my $low (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}{$mid}}) {
- my $label = $$lref{$vendor}{$model}{$mc}{$top}{$mid}{$low};
- my ($rlabel,$loc) = read_dimm_label ($$num_layers{$vendor}{$model}, $mc, $top, $mid, $low);
+ for my $top (sort keys %{$$lref{$vendor}{$model}{$mc}}) {
+ for my $mid (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}}) {
+ for my $low (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}{$mid}}) {
+ my $label = $$lref{$vendor}{$model}{$mc}{$top}{$mid}{$low};
+ my ($rlabel,$loc) = read_dimm_label ($$num_layers{$vendor}{$model}, $mc, $top, $mid, $low);
- printf $fh $format, $loc, $label, $rlabel;
- }
- }
- }
+ printf $fh $format, $loc, $label, $rlabel;
+ }
+ }
+ }
}
print $fh "\n";
}
@@ -754,9 +754,9 @@ sub print_dimm_labels
my $format = "%-35s %-20s %-20s\n";
if (!exists $$lref{$vendor}{$model} && !exists $$lref_prod{$pvendor}{$pname}) {
- log_error ("No dimm labels for $conf{mainboard}{vendor} " .
- "model $conf{mainboard}{model}\n");
- return;
+ log_error ("No dimm labels for $conf{mainboard}{vendor} " .
+ "model $conf{mainboard}{model}\n");
+ return;
}
my $sysfs_dir = "/sys/devices/system/edac/mc";
@@ -766,9 +766,9 @@ sub print_dimm_labels
printf $fh $format, "LOCATION", "CONFIGURED LABEL", "SYSFS CONTENTS";
if (exists $$lref{$vendor}{$model}) {
- _print_dimm_labels($lref, $num_layers, $vendor, $model, $fh, $format);
+ _print_dimm_labels($lref, $num_layers, $vendor, $model, $fh, $format);
} elsif (exists $$lref_prod{$pvendor}{$pname}) {
- _print_dimm_labels($lref_prod, $num_layers_prod, $pvendor, $pname, $fh, $format);
+ _print_dimm_labels($lref_prod, $num_layers_prod, $pvendor, $pname, $fh, $format);
}
}
@@ -777,27 +777,27 @@ sub write_dimm_labels
my ($lref, $num_layers, $vendor, $model) = @_;
for my $mc (sort keys %{$$lref{$vendor}{$model}}) {
- for my $top (sort keys %{$$lref{$vendor}{$model}{$mc}}) {
- for my $mid (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}}) {
- for my $low (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}{$mid}}) {
+ for my $top (sort keys %{$$lref{$vendor}{$model}{$mc}}) {
+ for my $mid (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}}) {
+ for my $low (sort keys %{$$lref{$vendor}{$model}{$mc}{$top}{$mid}}) {
- my $file = get_dimm_label_node($$num_layers{$vendor}{$model}, $mc, $top, $mid, $low);
+ my $file = get_dimm_label_node($$num_layers{$vendor}{$model}, $mc, $top, $mid, $low);
- # Ignore sysfs files that don't exist. Might just be
- # unpopulated bank.
- next unless -f $file;
+ # Ignore sysfs files that don't exist. Might just be
+ # unpopulated bank.
+ next unless -f $file;
- if (!open (DL, ">$file")) {
- warn ("Unable to open $file\n");
- next;
- }
+ if (!open (DL, ">$file")) {
+ warn ("Unable to open $file\n");
+ next;
+ }
- syswrite DL, $$lref{$vendor}{$model}{$mc}{$top}{$mid}{$low};
+ syswrite DL, $$lref{$vendor}{$model}{$mc}{$top}{$mid}{$low};
- close (DL);
- }
- }
- }
+ close (DL);
+ }
+ }
+ }
}
}
@@ -811,9 +811,9 @@ sub register_dimm_labels
my $sysfs = "/sys/devices/system/edac/mc";
if (!exists $$lref{$vendor}{$model} && !exists $$lref_prod{$pvendor}{$pname}) {
- log_error ("No dimm labels for $conf{mainboard}{vendor} " .
- "model $conf{mainboard}{model}\n");
- return 0;
+ log_error ("No dimm labels for $conf{mainboard}{vendor} " .
+ "model $conf{mainboard}{model}\n");
+ return 0;
}
my $sysfs_dir = "/sys/devices/system/edac/mc";
@@ -822,9 +822,9 @@ sub register_dimm_labels
select (undef, undef, undef, $conf{opt}{delay});
if (exists $$lref{$vendor}{$model}) {
- write_dimm_labels($lref, $num_layers, $vendor, $model);
+ write_dimm_labels($lref, $num_layers, $vendor, $model);
} else {
- write_dimm_labels($lref_prod, $num_layers_prod, $pvendor, $pname);
+ write_dimm_labels($lref_prod, $num_layers_prod, $pvendor, $pname);
}
return 1;
@@ -839,20 +839,20 @@ sub dimm_display_layer_rev($@)
$layer++;
if ($layer >= scalar(@pos) - 1) {
- my $str_loc = join(':', @pos);
- my $size = $dimm_size{$str_loc};
- if (!$size) {
- $size = 0;
- }
- my $s = sprintf " %4i MB |", $size;
- $item_size = length($s);
- return $s;
+ my $str_loc = join(':', @pos);
+ my $size = $dimm_size{$str_loc};
+ if (!$size) {
+ $size = 0;
+ }
+ my $s = sprintf " %4i MB |", $size;
+ $item_size = length($s);
+ return $s;
}
my $s;
for (my $i = 0; $i <= $max_pos[$layer]; $i++) {
- $pos[$layer] = $i;
- $s .= dimm_display_layer_rev($layer, @pos);
+ $pos[$layer] = $i;
+ $s .= dimm_display_layer_rev($layer, @pos);
}
return $s;
@@ -864,8 +864,8 @@ sub dimm_display_layer(@)
my $s;
for (my $i = 0; $i <= $max_pos[0]; $i++) {
- $pos[0] = $i;
- $s .= dimm_display_layer_rev(0, @pos);
+ $pos[0] = $i;
+ $s .= dimm_display_layer_rev(0, @pos);
}
return $s;
@@ -881,24 +881,24 @@ sub dimm_display_layer_header($$)
my $s;
for (my $i = 0; $i <= $layer; $i++) {
- $n_items *= $max_pos[$i] + 1;
+ $n_items *= $max_pos[$i] + 1;
}
$scale = $tot_items / $n_items;
my $d = 0;
for (my $i = 0; $i < $n_items; $i++) {
- my $val = sprintf("%s%d", $layers[$layer], $d);
- $val = substr($val, 0, $scale * $item_size - 2);
- my $fillsize = $scale * $item_size - 1 - length($val);
- $s .= "|";
- $s .= " " x ($fillsize / 2);
- $s .= $val;
- $s .= " " x ($fillsize - floor($fillsize / 2));
-
- $d++;
- if ($d > $max_pos[$layer]) {
- $d = 0;
- }
+ my $val = sprintf("%s%d", $layers[$layer], $d);
+ $val = substr($val, 0, $scale * $item_size - 2);
+ my $fillsize = $scale * $item_size - 1 - length($val);
+ $s .= "|";
+ $s .= " " x ($fillsize / 2);
+ $s .= $val;
+ $s .= " " x ($fillsize - floor($fillsize / 2));
+
+ $d++;
+ if ($d > $max_pos[$layer]) {
+ $d = 0;
+ }
}
$s .= "|";
return $s;
@@ -912,48 +912,48 @@ sub dimm_display_mem()
my $first = 1;
for (my $i = 0; $i < scalar(@pos) - 1; $i++) {
- $pos[$i] = 0;
- $tot_items *= $max_pos[$i] + 1;
+ $pos[$i] = 0;
+ $tot_items *= $max_pos[$i] + 1;
}
my $is_even = $max_pos[scalar(@max_pos) - 1] % 2;
for (my $d = $max_pos[scalar(@max_pos) - 1]; $d >= 0; $d--) {
- my $len;
-
- my $s = sprintf("%s%d: |", $layers[scalar(@max_pos) - 1], $d);
- my $p1 = length($s) - 1;
-
- $pos[scalar(@pos) - 1] = $d;
- $s .= dimm_display_layer(@pos);
- $len += length($s);
-
- $sep = "-" x $p1;
- $sep .= "+";
- $sep .= "-" x ($len - $p1 - 2);
- $sep .= "+";
-
- if ($first) {
- my $sep1 = " " x $p1;
- $sep1 .= "+";
- $sep1 .= "-" x ($len - $p1 - 2);
- $sep1 .= "+";
- printf "$sep1\n";
- for (my $layer = 0; $layer < scalar(@pos) - 1; $layer++) {
- my $s = sprintf("%s%d: |", $layers[scalar(@max_pos) - 1], 0);
- my $p1 = length($s) - 1;
- my $msg = " " x $p1;
- $msg .= dimm_display_layer_header($layer, $tot_items);
- printf "$msg\n";
- }
- printf "$sep\n" if (!$is_even);
- $first = 0;
- }
-
- if ($is_even && (($max_pos[scalar(@max_pos) - 1] - $d) % 2 == 0)) {
- printf "$sep\n";
- }
-
- printf "$s\n";
+ my $len;
+
+ my $s = sprintf("%s%d: |", $layers[scalar(@max_pos) - 1], $d);
+ my $p1 = length($s) - 1;
+
+ $pos[scalar(@pos) - 1] = $d;
+ $s .= dimm_display_layer(@pos);
+ $len += length($s);
+
+ $sep = "-" x $p1;
+ $sep .= "+";
+ $sep .= "-" x ($len - $p1 - 2);
+ $sep .= "+";
+
+ if ($first) {
+ my $sep1 = " " x $p1;
+ $sep1 .= "+";
+ $sep1 .= "-" x ($len - $p1 - 2);
+ $sep1 .= "+";
+ printf "$sep1\n";
+ for (my $layer = 0; $layer < scalar(@pos) - 1; $layer++) {
+ my $s = sprintf("%s%d: |", $layers[scalar(@max_pos) - 1], 0);
+ my $p1 = length($s) - 1;
+ my $msg = " " x $p1;
+ $msg .= dimm_display_layer_header($layer, $tot_items);
+ printf "$msg\n";
+ }
+ printf "$sep\n" if (!$is_even);
+ $first = 0;
+ }
+
+ if ($is_even && (($max_pos[scalar(@max_pos) - 1] - $d) % 2 == 0)) {
+ printf "$sep\n";
+ }
+
+ printf "$s\n";
}
printf "$sep\n";
}
@@ -961,11 +961,11 @@ sub dimm_display_mem()
sub fill_csrow_size()
{
foreach my $str_loc (keys %rank_size) {
- my @temp = split(/:/, $str_loc);
- my $csrow = join(':', $temp[0], $temp[1]);
- if ($csrow_ranks{$csrow}) {
- $rank_size{$str_loc} = $csrow_size{$csrow} / $csrow_ranks{$csrow};
- }
+ my @temp = split(/:/, $str_loc);
+ my $csrow = join(':', $temp[0], $temp[1]);
+ if ($csrow_ranks{$csrow}) {
+ $rank_size{$str_loc} = $csrow_size{$csrow} / $csrow_ranks{$csrow};
+ }
}
}
@@ -976,15 +976,15 @@ sub display_memory_layout
find({wanted => \&parse_dimm_nodes, no_chdir => 1}, $sysfs_dir);
if (!scalar(%csrow_size)) {
- log_error ("No memories found at via edac.\n");
- exit -1;
+ log_error ("No memories found at via edac.\n");
+ exit -1;
} elsif (!scalar(%dimm_size)) {
- fill_csrow_size;
- $layers[0] = "mc";
- $layers[1] = "csrow";
- $layers[2] = "channel";
- @max_pos = @max_csrow;
- %dimm_size = %rank_size;
+ fill_csrow_size;
+ $layers[0] = "mc";
+ $layers[1] = "csrow";
+ $layers[2] = "channel";
+ @max_pos = @max_csrow;
+ %dimm_size = %rank_size;
}
dimm_display_mem();
}
@@ -999,32 +999,32 @@ sub display_error_count
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;
+ 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;
+ my $label_width;
- open IN, $dimm_label_file{$key};
- chomp(my $label = <IN>);
- close IN;
- $label_width = length $label;
+ open IN, $dimm_label_file{$key};
+ chomp(my $label = <IN>);
+ close IN;
+ $label_width = length $label;
- if ($label_width > $max_width) {
- $max_width = $label_width;
- }
- $dimm_labels{$key} = $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};
+ 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");
+ print("$dimm_labels{$key}\t$ce_count\t$ue_count\n");
}
}
@@ -1032,7 +1032,7 @@ sub find_prog
{
my ($file) = @_;
for my $dir ("/sbin", "/usr/sbin", split ':', $ENV{PATH}) {
- return "$dir/$file" if -x "$dir/$file";
+ return "$dir/$file" if -x "$dir/$file";
}
# log_error ("Failed to find $file in PATH\n");
return "";
@@ -1043,26 +1043,26 @@ sub get_extlog_type
my @types;
if ($_[0] < 0 || $_[0] > 15) {
- return "unknown-type";
+ return "unknown-type";
}
@types = ("unknown",
- "no error",
- "single-bit ECC",
- "multi-bit ECC",
- "single-symbol chipkill ECC",
- "multi-symbol chipkill ECC",
- "master abort",
- "target abort",
- "parity error",
- "watchdog timeout",
- "invalid address",
- "mirror Broken",
- "memory sparing",
- "scrub corrected error",
- "scrub uncorrected error",
- "physical memory map-out event",
- "unknown-type");
+ "no error",
+ "single-bit ECC",
+ "multi-bit ECC",
+ "single-symbol chipkill ECC",
+ "multi-symbol chipkill ECC",
+ "master abort",
+ "target abort",
+ "parity error",
+ "watchdog timeout",
+ "invalid address",
+ "mirror Broken",
+ "memory sparing",
+ "scrub corrected error",
+ "scrub uncorrected error",
+ "physical memory map-out event",
+ "unknown-type");
return $types[$_[0]];
}
@@ -1071,14 +1071,14 @@ sub get_extlog_severity
my @sev;
if ($_[0] < 0 || $_[0] > 3) {
- return "unknown-severity";
+ return "unknown-severity";
}
@sev = ("recoverable",
- "fatal",
- "corrected",
- "informational",
- "unknown-severity");
+ "fatal",
+ "corrected",
+ "informational",
+ "unknown-severity");
return $sev[$_[0]];
}
@@ -1107,46 +1107,46 @@ sub get_cper_data_text
my @out;
if ($validation_bits & CPER_MEM_VALID_NODE) {
- push @out, (sprintf "node=%d", $node);
+ push @out, (sprintf "node=%d", $node);
}
if ($validation_bits & CPER_MEM_VALID_CARD) {
- push @out, (sprintf "card=%d", $card);
+ push @out, (sprintf "card=%d", $card);
}
if ($validation_bits & CPER_MEM_VALID_MODULE) {
- push @out, (sprintf "module=%d", $module);
+ push @out, (sprintf "module=%d", $module);
}
if ($validation_bits & CPER_MEM_VALID_BANK) {
- push @out, (sprintf "bank=%d", $bank);
+ push @out, (sprintf "bank=%d", $bank);
}
if ($validation_bits & CPER_MEM_VALID_DEVICE) {
- push @out, (sprintf "device=%d", $device);
+ push @out, (sprintf "device=%d", $device);
}
if ($validation_bits & CPER_MEM_VALID_ROW) {
- push @out, (sprintf "row=%d", $row);
+ push @out, (sprintf "row=%d", $row);
}
if ($validation_bits & CPER_MEM_VALID_COLUMN) {
- push @out, (sprintf "column=%d", $column);
+ push @out, (sprintf "column=%d", $column);
}
if ($validation_bits & CPER_MEM_VALID_BIT_POSITION) {
- push @out, (sprintf "bit_position=%d", $bit_pos);
+ push @out, (sprintf "bit_position=%d", $bit_pos);
}
if ($validation_bits & CPER_MEM_VALID_REQUESTOR_ID) {
- push @out, (sprintf "0x%08x", $requestor_id);
+ push @out, (sprintf "0x%08x", $requestor_id);
}
if ($validation_bits & CPER_MEM_VALID_RESPONDER_ID) {
- push @out, (sprintf "0x%08x", $responder_id);
+ push @out, (sprintf "0x%08x", $responder_id);
}
if ($validation_bits & CPER_MEM_VALID_TARGET_ID) {
- push @out, (sprintf "0x%08x", $target_id);
+ push @out, (sprintf "0x%08x", $target_id);
}
if ($validation_bits & CPER_MEM_VALID_RANK_NUMBER) {
- push @out, (sprintf "rank=%d", $rank);
+ push @out, (sprintf "rank=%d", $rank);
}
if ($validation_bits & CPER_MEM_VALID_CARD_HANDLE) {
- push @out, (sprintf "mem_array_handle=%d", $mem_array_handle);
+ push @out, (sprintf "mem_array_handle=%d", $mem_array_handle);
}
if ($validation_bits & CPER_MEM_VALID_MODULE_HANDLE) {
- push @out, (sprintf "mem_dev_handle=%d", $mem_dev_handle);
+ push @out, (sprintf "mem_dev_handle=%d", $mem_dev_handle);
}
return join (", ", @out);
@@ -1159,10 +1159,10 @@ sub get_uuid_le
my @le16_table = (3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15);
for (my $i = 0; $i < 16; $i++) {
- $out .= sprintf "%.2x", $bytes[$le16_table[$i]];
- if ($i == 3 or $i == 5 or $i == 7 or $i == 9) {
- $out .= "-";
- }
+ $out .= sprintf "%.2x", $bytes[$le16_table[$i]];
+ if ($i == 3 or $i == 5 or $i == 7 or $i == 9) {
+ $out .= "-";
+ }
}
return $out;
}
@@ -1185,141 +1185,141 @@ sub summary
$query_handle->bind_columns(\($err_type, $label, $mc, $top, $mid, $low, $count));
$out = "";
while($query_handle->fetch()) {
- $out .= "\t$err_type on DIMM Label(s): '$label' location: $mc:$top:$mid:$low errors: $count\n";
+ $out .= "\t$err_type on DIMM Label(s): '$label' location: $mc:$top:$mid:$low errors: $count\n";
}
if ($out ne "") {
- print "Memory controller events summary:\n$out\n";
+ print "Memory controller events summary:\n$out\n";
} else {
- print "No Memory errors.\n\n";
+ print "No Memory errors.\n\n";
}
$query_handle->finish;
# PCIe AER aer_event errors
if ($has_aer == 1) {
- $query = "select err_type, err_msg, count(*) from aer_event$conf{opt}{since} group by err_type, err_msg";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($err_type, $msg, $count));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "\t$count $err_type errors: $msg\n";
- }
- if ($out ne "") {
- print "PCIe AER events summary:\n$out\n";
- } else {
- print "No PCIe AER errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select err_type, err_msg, count(*) from aer_event$conf{opt}{since} group by err_type, err_msg";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($err_type, $msg, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "\t$count $err_type errors: $msg\n";
+ }
+ if ($out ne "") {
+ print "PCIe AER events summary:\n$out\n";
+ } else {
+ print "No PCIe AER errors.\n\n";
+ }
+ $query_handle->finish;
}
# ARM processor arm_event errors
if ($has_arm == 1) {
- $query = "select mpidr, count(*) from arm_event$conf{opt}{since} group by mpidr";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($mpidr, $count));
- $out = "";
- while($query_handle->fetch()) {
- $out .= sprintf "\tCPU(mpidr=0x%x) has %d errors\n", $mpidr, $count;
- }
- if ($out ne "") {
- print "ARM processor events summary:\n$out\n";
- } else {
- print "No ARM processor errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select mpidr, count(*) from arm_event$conf{opt}{since} group by mpidr";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($mpidr, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= sprintf "\tCPU(mpidr=0x%x) has %d errors\n", $mpidr, $count;
+ }
+ if ($out ne "") {
+ print "ARM processor events summary:\n$out\n";
+ } else {
+ print "No ARM processor errors.\n\n";
+ }
+ $query_handle->finish;
}
# extlog errors
if ($has_extlog == 1) {
- $query = "select etype, severity, count(*) from extlog_event$conf{opt}{since} group by etype, severity";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($etype, $severity, $count));
- $out = "";
- while($query_handle->fetch()) {
- $etype_string = get_extlog_type($etype);
- $severity_string = get_extlog_severity($severity);
- $out .= "\t$count $etype_string $severity_string errors\n";
- }
- if ($out ne "") {
- print "Extlog records summary:\n$out";
- } else {
- print "No Extlog errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select etype, severity, count(*) from extlog_event$conf{opt}{since} group by etype, severity";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($etype, $severity, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $etype_string = get_extlog_type($etype);
+ $severity_string = get_extlog_severity($severity);
+ $out .= "\t$count $etype_string $severity_string errors\n";
+ }
+ if ($out ne "") {
+ print "Extlog records summary:\n$out";
+ } else {
+ print "No Extlog errors.\n\n";
+ }
+ $query_handle->finish;
}
# devlink errors
if ($has_devlink == 1) {
- $query = "select dev_name, count(*) from devlink_event$conf{opt}{since} group by dev_name";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($dev_name, $count));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "\t$dev_name has $count errors\n";
- }
- if ($out ne "") {
- print "Devlink records summary:\n$out";
- } else {
- print "No devlink errors.\n";
- }
- $query_handle->finish;
+ $query = "select dev_name, count(*) from devlink_event$conf{opt}{since} group by dev_name";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($dev_name, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "\t$dev_name has $count errors\n";
+ }
+ if ($out ne "") {
+ print "Devlink records summary:\n$out";
+ } else {
+ print "No devlink errors.\n";
+ }
+ $query_handle->finish;
}
# Disk errors
if ($has_disk_errors == 1) {
- $query = "select dev, count(*) from disk_errors$conf{opt}{since} group by dev";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($dev, $count));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "\t$dev has $count errors\n";
- }
- if ($out ne "") {
- print "Disk errors summary:\n$out";
- } else {
- print "No disk errors.\n";
- }
- $query_handle->finish;
+ $query = "select dev, count(*) from disk_errors$conf{opt}{since} group by dev";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($dev, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "\t$dev has $count errors\n";
+ }
+ if ($out ne "") {
+ print "Disk errors summary:\n$out";
+ } else {
+ print "No disk errors.\n";
+ }
+ $query_handle->finish;
}
# Memory failure errors
if ($has_mem_failure == 1) {
- $query = "select action_result, count(*) from memory_failure_event$conf{opt}{since} group by action_result";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($action_result, $count));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "\t$action_result errors: $count\n";
- }
- if ($out ne "") {
- print "Memory failure events summary:\n$out\n";
- } else {
- print "No Memory failure errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select action_result, count(*) from memory_failure_event$conf{opt}{since} group by action_result";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($action_result, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "\t$action_result errors: $count\n";
+ }
+ if ($out ne "") {
+ print "Memory failure events summary:\n$out\n";
+ } else {
+ print "No Memory failure errors.\n\n";
+ }
+ $query_handle->finish;
}
# MCE mce_record errors
if ($has_mce == 1) {
- $query = "select error_msg, count(*) from mce_record$conf{opt}{since} group by error_msg";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($msg, $count));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "\t$count $msg errors\n";
- }
- if ($out ne "") {
- print "MCE records summary:\n$out";
- } else {
- print "No MCE errors.\n";
- }
- $query_handle->finish;
+ $query = "select error_msg, count(*) from mce_record$conf{opt}{since} group by error_msg";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($msg, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "\t$count $msg errors\n";
+ }
+ if ($out ne "") {
+ print "MCE records summary:\n$out";
+ } else {
+ print "No MCE errors.\n";
+ }
+ $query_handle->finish;
}
undef($dbh);
@@ -1342,157 +1342,157 @@ sub errors
$query = "select id, timestamp, err_count, err_type, err_msg, label, mc, top_layer,middle_layer,lower_layer, address, grain, syndrome, driver_detail from mc_event$conf{opt}{since} order by id";
$query_handle = $dbh->prepare($query);
if (!$query_handle) {
- log_error ("mc_event table missing from $dbname. Run 'rasdaemon --record'.\n");
- exit -1
+ log_error ("mc_event table missing from $dbname. Run 'rasdaemon --record'.\n");
+ exit -1
}
$query_handle->execute();
$query_handle->bind_columns(\($id, $time, $count, $type, $msg, $label, $mc, $top, $mid, $low, $addr, $grain, $syndrome, $detail));
$out = "";
while($query_handle->fetch()) {
- $out .= "$id $time $count $type error(s): $msg at $label location: $mc:$top:$mid:$low, addr $addr, grain $grain, syndrome $syndrome $detail\n";
+ $out .= "$id $time $count $type error(s): $msg at $label location: $mc:$top:$mid:$low, addr $addr, grain $grain, syndrome $syndrome $detail\n";
}
if ($out ne "") {
- print "Memory controller events:\n$out\n";
+ print "Memory controller events:\n$out\n";
} else {
- print "No Memory errors.\n\n";
+ print "No Memory errors.\n\n";
}
$query_handle->finish;
# PCIe AER aer_event errors
if ($has_aer == 1) {
- $query = "select id, timestamp, dev_name, err_type, err_msg from aer_event$conf{opt}{since} order by id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $time, $devname, $type, $msg));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "$id $time $devname $type error: $msg\n";
- }
- if ($out ne "") {
- print "PCIe AER events:\n$out\n";
- } else {
- print "No PCIe AER errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select id, timestamp, dev_name, err_type, err_msg from aer_event$conf{opt}{since} order by id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $time, $devname, $type, $msg));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "$id $time $devname $type error: $msg\n";
+ }
+ if ($out ne "") {
+ print "PCIe AER events:\n$out\n";
+ } else {
+ print "No PCIe AER errors.\n\n";
+ }
+ $query_handle->finish;
}
# ARM processor arm_event errors
if ($has_arm == 1) {
- $query = "select id, timestamp, error_count, affinity, mpidr, running_state, psci_state from arm_event$conf{opt}{since} order by id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $error_count, $affinity, $mpidr, $r_state, $psci_state));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "$id $timestamp error: ";
- $out .= "error_count=$error_count, " if ($error_count);
- $out .= "affinity_level=$affinity, ";
- $out .= sprintf "mpidr=0x%x, ", $mpidr;
- $out .= sprintf "running_state=0x%x, ", $r_state;
- $out .= sprintf "psci_state=0x%x", $psci_state;
- $out .= "\n";
- }
- if ($out ne "") {
- print "ARM processor events:\n$out\n";
- } else {
- print "No ARM processor errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select id, timestamp, error_count, affinity, mpidr, running_state, psci_state from arm_event$conf{opt}{since} order by id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $error_count, $affinity, $mpidr, $r_state, $psci_state));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "$id $timestamp error: ";
+ $out .= "error_count=$error_count, " if ($error_count);
+ $out .= "affinity_level=$affinity, ";
+ $out .= sprintf "mpidr=0x%x, ", $mpidr;
+ $out .= sprintf "running_state=0x%x, ", $r_state;
+ $out .= sprintf "psci_state=0x%x", $psci_state;
+ $out .= "\n";
+ }
+ if ($out ne "") {
+ print "ARM processor events:\n$out\n";
+ } else {
+ print "No ARM processor errors.\n\n";
+ }
+ $query_handle->finish;
}
# Extlog errors
if ($has_extlog == 1) {
- $query = "select id, timestamp, etype, severity, address, fru_id, fru_text, cper_data from extlog_event$conf{opt}{since} order by id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $etype, $severity, $addr, $fru_id, $fru_text, $cper_data));
- $out = "";
- while($query_handle->fetch()) {
- $etype_string = get_extlog_type($etype);
- $severity_string = get_extlog_severity($severity);
- $out .= "$id $timestamp error: ";
- $out .= "type=$etype_string, ";
- $out .= "severity=$severity_string, ";
- $out .= sprintf "address=0x%08x, ", $addr;
- $out .= sprintf "fru_id=%s, ", get_uuid_le($fru_id);
- $out .= "fru_text='$fru_text', ";
- $out .= get_cper_data_text($cper_data) if ($cper_data);
- $out .= "\n";
- }
- if ($out ne "") {
- print "Extlog events:\n$out\n";
- } else {
- print "No Extlog errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select id, timestamp, etype, severity, address, fru_id, fru_text, cper_data from extlog_event$conf{opt}{since} order by id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $etype, $severity, $addr, $fru_id, $fru_text, $cper_data));
+ $out = "";
+ while($query_handle->fetch()) {
+ $etype_string = get_extlog_type($etype);
+ $severity_string = get_extlog_severity($severity);
+ $out .= "$id $timestamp error: ";
+ $out .= "type=$etype_string, ";
+ $out .= "severity=$severity_string, ";
+ $out .= sprintf "address=0x%08x, ", $addr;
+ $out .= sprintf "fru_id=%s, ", get_uuid_le($fru_id);
+ $out .= "fru_text='$fru_text', ";
+ $out .= get_cper_data_text($cper_data) if ($cper_data);
+ $out .= "\n";
+ }
+ if ($out ne "") {
+ print "Extlog events:\n$out\n";
+ } else {
+ print "No Extlog errors.\n\n";
+ }
+ $query_handle->finish;
}
# devlink errors
if ($has_devlink == 1) {
- $query = "select id, timestamp, bus_name, dev_name, driver_name, reporter_name, msg from devlink_event$conf{opt}{since} order by id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $bus_name, $dev_name, $driver_name, $reporter_name, $msg));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "$id $timestamp error: ";
- $out .= "bus_name=$bus_name, ";
- $out .= "dev_name=$dev_name, ";
- $out .= "driver_name=$driver_name, ";
- $out .= "reporter_name=$reporter_name, ";
- $out .= "message='$msg', ";
- $out .= "\n";
- }
- if ($out ne "") {
- print "Devlink events:\n$out\n";
- } else {
- print "No devlink errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select id, timestamp, bus_name, dev_name, driver_name, reporter_name, msg from devlink_event$conf{opt}{since} order by id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $bus_name, $dev_name, $driver_name, $reporter_name, $msg));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "$id $timestamp error: ";
+ $out .= "bus_name=$bus_name, ";
+ $out .= "dev_name=$dev_name, ";
+ $out .= "driver_name=$driver_name, ";
+ $out .= "reporter_name=$reporter_name, ";
+ $out .= "message='$msg', ";
+ $out .= "\n";
+ }
+ if ($out ne "") {
+ print "Devlink events:\n$out\n";
+ } else {
+ print "No devlink errors.\n\n";
+ }
+ $query_handle->finish;
}
# Disk errors
if ($has_disk_errors == 1) {
- $query = "select id, timestamp, dev, sector, nr_sector, error, rwbs, cmd from disk_errors$conf{opt}{since} order by id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $dev, $sector, $nr_sector, $error, $rwbs, $cmd));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "$id $timestamp error: ";
- $out .= "dev=$dev, ";
- $out .= "sector=$sector, ";
- $out .= "nr_sector=$nr_sector, ";
- $out .= "error='$error', ";
- $out .= "rwbs='$rwbs', ";
- $out .= "cmd='$cmd', ";
- $out .= "\n";
- }
- if ($out ne "") {
- print "Disk errors:\n$out\n";
- } else {
- print "No disk errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select id, timestamp, dev, sector, nr_sector, error, rwbs, cmd from disk_errors$conf{opt}{since} order by id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $dev, $sector, $nr_sector, $error, $rwbs, $cmd));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "$id $timestamp error: ";
+ $out .= "dev=$dev, ";
+ $out .= "sector=$sector, ";
+ $out .= "nr_sector=$nr_sector, ";
+ $out .= "error='$error', ";
+ $out .= "rwbs='$rwbs', ";
+ $out .= "cmd='$cmd', ";
+ $out .= "\n";
+ }
+ if ($out ne "") {
+ print "Disk errors:\n$out\n";
+ } else {
+ print "No disk errors.\n\n";
+ }
+ $query_handle->finish;
}
# Memory failure errors
if ($has_mem_failure == 1) {
- $query = "select id, timestamp, pfn, page_type, action_result from memory_failure_event$conf{opt}{since} order by id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $pfn, $page_type, $action_result));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "$id $timestamp error: ";
- $out .= "pfn=$pfn, page_type=$page_type, action_result=$action_result\n";
- }
- if ($out ne "") {
- print "Memory failure events:\n$out\n";
- } else {
- print "No Memory failure errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select id, timestamp, pfn, page_type, action_result from memory_failure_event$conf{opt}{since} order by id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $pfn, $page_type, $action_result));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "$id $timestamp error: ";
+ $out .= "pfn=$pfn, page_type=$page_type, action_result=$action_result\n";
+ }
+ if ($out ne "") {
+ print "Memory failure events:\n$out\n";
+ } else {
+ print "No Memory failure errors.\n\n";
+ }
+ $query_handle->finish;
}
# MCE mce_record errors
@@ -1527,13 +1527,13 @@ sub errors
$out .= sprintf ", bank=0x%08x", $bank if ($bank);
$out .= "\n";
- }
- if ($out ne "") {
- print "MCE events:\n$out\n";
- } else {
- print "No MCE errors.\n\n";
- }
- $query_handle->finish;
+ }
+ if ($out ne "") {
+ print "MCE events:\n$out\n";
+ } else {
+ print "No MCE errors.\n\n";
+ }
+ $query_handle->finish;
}
undef($dbh);
@@ -1558,10 +1558,10 @@ sub vendor_errors_summary
$found_platform = 0;
if ($num_args ne 0) {
- $platform_id = $ARGV[0];
+ $platform_id = $ARGV[0];
} else {
- usage(1);
- return;
+ usage(1);
+ return;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
@@ -1569,100 +1569,99 @@ sub vendor_errors_summary
# HiSilicon KunPeng9xx errors
if ($platform_id eq HISILICON_KUNPENG_9XX) {
$found_platform = 1;
- $query = "select err_severity, module_id, count(*) from hip08_oem_type1_event_v2$conf{opt}{since} group by err_severity, module_id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($err_severity, $module_id, $count));
- $out = "";
- $err_sev = "";
- while($query_handle->fetch()) {
- if ($err_severity ne $err_sev) {
- $out .= "$err_severity errors:\n";
- $err_sev = $err_severity;
- }
- $out .= "\t$module_id: $count\n";
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx OEM type1 error events summary:\n$out\n";
- }
- $query_handle->finish;
-
- $query = "select err_severity, module_id, count(*) from hip08_oem_type2_event_v2$conf{opt}{since} group by err_severity, module_id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($err_severity, $module_id, $count));
- $out = "";
- $err_sev = "";
- while($query_handle->fetch()) {
- if ($err_severity ne $err_sev) {
- $out .= "$err_severity errors:\n";
- $err_sev = $err_severity;
- }
- $out .= "\t$module_id: $count\n";
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx OEM type2 error events summary:\n$out\n";
- }
- $query_handle->finish;
-
- $query = "select err_severity, sub_module_id, count(*) from hip08_pcie_local_event_v2$conf{opt}{since} group by err_severity, sub_module_id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($err_severity, $sub_module_id, $count));
- $out = "";
- $err_sev = "";
- while($query_handle->fetch()) {
- if ($err_severity ne $err_sev) {
- $out .= "$err_severity errors:\n";
- $err_sev = $err_severity;
- }
- $out .= "\t$sub_module_id: $count\n";
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx PCIe controller error events summary:\n$out\n";
- }
- $query_handle->finish;
-
- $query = "select err_severity, module_id, count(*) from hisi_common_section_v2$conf{opt}{since} group by err_severity, module_id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($err_severity, $module_id, $count));
- $out = "";
- $err_sev = "";
- while($query_handle->fetch()) {
- if ($err_severity ne $err_sev) {
- $out .= "$err_severity errors:\n";
- $err_sev = $err_severity;
- }
- $out .= "\t$module_id: $count\n";
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx common error events summary:\n$out\n";
- }
- $query_handle->finish;
+ $query = "select err_severity, module_id, count(*) from hip08_oem_type1_event_v2$conf{opt}{since} group by err_severity, module_id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($err_severity, $module_id, $count));
+ $out = "";
+ $err_sev = "";
+ while($query_handle->fetch()) {
+ if ($err_severity ne $err_sev) {
+ $out .= "$err_severity errors:\n";
+ $err_sev = $err_severity;
+ }
+ $out .= "\t$module_id: $count\n";
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx OEM type1 error events summary:\n$out\n";
+ }
+ $query_handle->finish;
+
+ $query = "select err_severity, module_id, count(*) from hip08_oem_type2_event_v2$conf{opt}{since} group by err_severity, module_id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($err_severity, $module_id, $count));
+ $out = "";
+ $err_sev = "";
+ while($query_handle->fetch()) {
+ if ($err_severity ne $err_sev) {
+ $out .= "$err_severity errors:\n";
+ $err_sev = $err_severity;
+ }
+ $out .= "\t$module_id: $count\n";
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx OEM type2 error events summary:\n$out\n";
+ }
+ $query_handle->finish;
+
+ $query = "select err_severity, sub_module_id, count(*) from hip08_pcie_local_event_v2$conf{opt}{since} group by err_severity, sub_module_id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($err_severity, $sub_module_id, $count));
+ $out = "";
+ $err_sev = "";
+ while($query_handle->fetch()) {
+ if ($err_severity ne $err_sev) {
+ $out .= "$err_severity errors:\n";
+ $err_sev = $err_severity;
+ }
+ $out .= "\t$sub_module_id: $count\n";
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx PCIe controller error events summary:\n$out\n";
+ }
+ $query_handle->finish;
+
+ $query = "select err_severity, module_id, count(*) from hisi_common_section_v2$conf{opt}{since} group by err_severity, module_id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($err_severity, $module_id, $count));
+ $out = "";
+ $err_sev = "";
+ while($query_handle->fetch()) {
+ if ($err_severity ne $err_sev) {
+ $out .= "$err_severity errors:\n";
+ $err_sev = $err_severity;
+ }
+ $out .= "\t$module_id: $count\n";
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx common error events summary:\n$out\n";
+ }
+ $query_handle->finish;
}
# THead Yitian710 DDR errors
if ($platform_id eq THEAD_YITIAN_7XX) {
$found_platform = 1;
- $query = "select address, count(*) from yitian_ddr_reg_dump_event";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($address, $count));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "\terrors: $count";
- }
- if ($out ne "") {
- print "THead YiTian710 DDR error dump events summary:\n$out\n";
- } else {
- print "No THead YiTian710 DDR error dump errors.\n\n";
- }
- $query_handle->finish;
+ $query = "select address, count(*) from yitian_ddr_reg_dump_event";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($address, $count));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "\terrors: $count";
+ }
+ if ($out ne "") {
+ print "THead YiTian710 DDR error dump events summary:\n$out\n";
+ } else {
+ print "No THead YiTian710 DDR error dump errors.\n\n";
+ }
+ $query_handle->finish;
}
-
if ($platform_id && !($found_platform)) {
- print "Platform ID $platform_id is not valid\n";
+ print "Platform ID $platform_id is not valid\n";
}
undef($dbh);
@@ -1683,155 +1682,155 @@ sub vendor_errors
$module = 0;
$found_module = 0;
if ($num_args ne 0) {
- $platform_id = $ARGV[0];
- if ($num_args gt 1) {
- $module = $ARGV[1];
- }
+ $platform_id = $ARGV[0];
+ if ($num_args gt 1) {
+ $module = $ARGV[1];
+ }
} else {
- usage(1);
- return;
+ usage(1);
+ return;
}
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
# HiSilicon KunPeng9xx errors
if ($platform_id eq HISILICON_KUNPENG_9XX) {
- $found_platform = 1;
- $query = "select id, timestamp, version, soc_id, socket_id, nimbus_id, module_id, sub_module_id, err_severity, regs_dump from hip08_oem_type1_event_v2$conf{opt}{since} order by id, module_id, err_severity";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $nimbus_id, $module_id, $sub_module_id, $err_severity, $regs));
- $out = "";
- while($query_handle->fetch()) {
- if ($module eq 0 || ($module_id && uc($module) eq uc($module_id))) {
- $out .= "$id. $timestamp Error Info: ";
- $out .= "version=$version, ";
- $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
- $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
- $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
- $out .= "module_id=$module_id, " if (defined $module_id && length $module_id);
- $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
- $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
- $out .= "Error Registers: $regs " if (defined $regs && length $regs);
- $out .= "\n\n";
- $found_module = 1;
+ $found_platform = 1;
+ $query = "select id, timestamp, version, soc_id, socket_id, nimbus_id, module_id, sub_module_id, err_severity, regs_dump from hip08_oem_type1_event_v2$conf{opt}{since} order by id, module_id, err_severity";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $nimbus_id, $module_id, $sub_module_id, $err_severity, $regs));
+ $out = "";
+ while($query_handle->fetch()) {
+ if ($module eq 0 || ($module_id && uc($module) eq uc($module_id))) {
+ $out .= "$id. $timestamp Error Info: ";
+ $out .= "version=$version, ";
+ $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
+ $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
+ $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
+ $out .= "module_id=$module_id, " if (defined $module_id && length $module_id);
+ $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
+ $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
+ $out .= "Error Registers: $regs " if (defined $regs && length $regs);
+ $out .= "\n\n";
+ $found_module = 1;
}
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx OEM type1 error events:\n$out\n";
- }
- $query_handle->finish;
-
- $query = "select id, timestamp, version, soc_id, socket_id, nimbus_id, module_id, sub_module_id, err_severity, regs_dump from hip08_oem_type2_event_v2$conf{opt}{since} order by id, module_id, err_severity";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $nimbus_id, $module_id, $sub_module_id, $err_severity, $regs));
- $out = "";
- while($query_handle->fetch()) {
- if ($module eq 0 || ($module_id && uc($module) eq uc($module_id))) {
- $out .= "$id. $timestamp Error Info: ";
- $out .= "version=$version, ";
- $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
- $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
- $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
- $out .= "module_id=$module_id, " if (defined $module_id && length $module_id);
- $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
- $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
- $out .= "Error Registers: $regs " if (defined $regs && length $regs);
- $out .= "\n\n";
- $found_module = 1;
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx OEM type1 error events:\n$out\n";
+ }
+ $query_handle->finish;
+
+ $query = "select id, timestamp, version, soc_id, socket_id, nimbus_id, module_id, sub_module_id, err_severity, regs_dump from hip08_oem_type2_event_v2$conf{opt}{since} order by id, module_id, err_severity";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $nimbus_id, $module_id, $sub_module_id, $err_severity, $regs));
+ $out = "";
+ while($query_handle->fetch()) {
+ if ($module eq 0 || ($module_id && uc($module) eq uc($module_id))) {
+ $out .= "$id. $timestamp Error Info: ";
+ $out .= "version=$version, ";
+ $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
+ $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
+ $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
+ $out .= "module_id=$module_id, " if (defined $module_id && length $module_id);
+ $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
+ $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
+ $out .= "Error Registers: $regs " if (defined $regs && length $regs);
+ $out .= "\n\n";
+ $found_module = 1;
}
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx OEM type2 error events:\n$out\n";
- }
- $query_handle->finish;
-
- $query = "select id, timestamp, version, soc_id, socket_id, nimbus_id, sub_module_id, core_id, port_id, err_severity, err_type, regs_dump from hip08_pcie_local_event_v2$conf{opt}{since} order by id, sub_module_id, err_severity";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $nimbus_id, $sub_module_id, $core_id, $port_id, $err_severity, $err_type, $regs));
- $out = "";
- while($query_handle->fetch()) {
- if ($module eq 0 || ($sub_module_id && uc($module) eq uc($sub_module_id))) {
- $out .= "$id. $timestamp Error Info: ";
- $out .= "version=$version, ";
- $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
- $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
- $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
- $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
- $out .= "core_id=$core_id, " if (defined $core_id && length $core_id);
- $out .= "port_id=$port_id, " if (defined $port_id && length $port_id);
- $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
- $out .= "err_type=$err_type, " if (defined $err_type && length $err_type);
- $out .= "Error Registers: $regs " if (defined $regs && length $regs);
- $out .= "\n\n";
- $found_module = 1;
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx OEM type2 error events:\n$out\n";
+ }
+ $query_handle->finish;
+
+ $query = "select id, timestamp, version, soc_id, socket_id, nimbus_id, sub_module_id, core_id, port_id, err_severity, err_type, regs_dump from hip08_pcie_local_event_v2$conf{opt}{since} order by id, sub_module_id, err_severity";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $nimbus_id, $sub_module_id, $core_id, $port_id, $err_severity, $err_type, $regs));
+ $out = "";
+ while($query_handle->fetch()) {
+ if ($module eq 0 || ($sub_module_id && uc($module) eq uc($sub_module_id))) {
+ $out .= "$id. $timestamp Error Info: ";
+ $out .= "version=$version, ";
+ $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
+ $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
+ $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
+ $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
+ $out .= "core_id=$core_id, " if (defined $core_id && length $core_id);
+ $out .= "port_id=$port_id, " if (defined $port_id && length $port_id);
+ $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
+ $out .= "err_type=$err_type, " if (defined $err_type && length $err_type);
+ $out .= "Error Registers: $regs " if (defined $regs && length $regs);
+ $out .= "\n\n";
+ $found_module = 1;
}
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx PCIe controller error events:\n$out\n";
- }
- $query_handle->finish;
-
- $query = "select id, timestamp, version, soc_id, socket_id, totem_id, nimbus_id, sub_system_id, module_id, sub_module_id, core_id, port_id, err_type, pcie_info, err_severity, regs_dump from hisi_common_section_v2$conf{opt}{since} order by id, module_id, err_severity";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $totem_id, $nimbus_id, $sub_system_id, $module_id, $sub_module_id, $core_id, $port_id, $err_type, $pcie_info, $err_severity, $regs));
- $out = "";
- while($query_handle->fetch()) {
- if ($module eq 0 || ($module_id && uc($module) eq uc($module_id))) {
- $out .= "$id. $timestamp Error Info: ";
- $out .= "version=$version, ";
- $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
- $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
- $out .= "totem_id=$totem_id, " if (defined $totem_id && length $totem_id);
- $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
- $out .= "sub_system_id=$sub_system_id, " if (defined $sub_system_id && length $sub_system_id);
- $out .= "module_id=$module_id, " if (defined $module_id && length $module_id);
- $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
- $out .= "core_id=$core_id, " if (defined $core_id && length $core_id );
- $out .= "port_id=$port_id, " if (defined $port_id && length $port_id);
- $out .= "err_type=$err_type, " if (defined $err_type && length $err_type);
- $out .= "pcie_info=$pcie_info, " if (defined $pcie_info && length $pcie_info);
- $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
- $out .= "Error Registers: $regs" if (defined $regs && length $regs);
- $out .= "\n\n";
- $found_module = 1;
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx PCIe controller error events:\n$out\n";
+ }
+ $query_handle->finish;
+
+ $query = "select id, timestamp, version, soc_id, socket_id, totem_id, nimbus_id, sub_system_id, module_id, sub_module_id, core_id, port_id, err_type, pcie_info, err_severity, regs_dump from hisi_common_section_v2$conf{opt}{since} order by id, module_id, err_severity";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $version, $soc_id, $socket_id, $totem_id, $nimbus_id, $sub_system_id, $module_id, $sub_module_id, $core_id, $port_id, $err_type, $pcie_info, $err_severity, $regs));
+ $out = "";
+ while($query_handle->fetch()) {
+ if ($module eq 0 || ($module_id && uc($module) eq uc($module_id))) {
+ $out .= "$id. $timestamp Error Info: ";
+ $out .= "version=$version, ";
+ $out .= "soc_id=$soc_id, " if (defined $soc_id && length $soc_id);
+ $out .= "socket_id=$socket_id, " if (defined $socket_id && length $socket_id);
+ $out .= "totem_id=$totem_id, " if (defined $totem_id && length $totem_id);
+ $out .= "nimbus_id=$nimbus_id, " if (defined $nimbus_id && length $nimbus_id);
+ $out .= "sub_system_id=$sub_system_id, " if (defined $sub_system_id && length $sub_system_id);
+ $out .= "module_id=$module_id, " if (defined $module_id && length $module_id);
+ $out .= "sub_module_id=$sub_module_id, " if (defined $sub_module_id && length $sub_module_id);
+ $out .= "core_id=$core_id, " if (defined $core_id && length $core_id );
+ $out .= "port_id=$port_id, " if (defined $port_id && length $port_id);
+ $out .= "err_type=$err_type, " if (defined $err_type && length $err_type);
+ $out .= "pcie_info=$pcie_info, " if (defined $pcie_info && length $pcie_info);
+ $out .= "err_severity=$err_severity, " if (defined $err_severity && length $err_severity);
+ $out .= "Error Registers: $regs" if (defined $regs && length $regs);
+ $out .= "\n\n";
+ $found_module = 1;
}
- }
- if ($out ne "") {
- print "HiSilicon KunPeng9xx common error events:\n$out\n";
- }
- $query_handle->finish;
+ }
+ if ($out ne "") {
+ print "HiSilicon KunPeng9xx common error events:\n$out\n";
+ }
+ $query_handle->finish;
}
# THead Yitian7xx ddr errors
if ($platform_id eq THEAD_YITIAN_7XX) {
$found_platform = 1;
- $query = "select id, timestamp, address, regs_dump from yitian_ddr_reg_dump_event order by id";
- $query_handle = $dbh->prepare($query);
- $query_handle->execute();
- $query_handle->bind_columns(\($id, $timestamp, $address, $regs_dump));
- $out = "";
- while($query_handle->fetch()) {
- $out .= "$id. $timestamp ";
- $out .= "Error Address: $address ";
- $out .= "Error Registers Dump: $regs_dump" if ($regs_dump);
- $out .= "\n\n";
- }
- if ($out ne "") {
- print "THead Yitian710 DDRC error events:\n$out\n";
- } else {
- print "No THead Yitian710 DDRC error events.\n";
- }
- $query_handle->finish;
+ $query = "select id, timestamp, address, regs_dump from yitian_ddr_reg_dump_event order by id";
+ $query_handle = $dbh->prepare($query);
+ $query_handle->execute();
+ $query_handle->bind_columns(\($id, $timestamp, $address, $regs_dump));
+ $out = "";
+ while($query_handle->fetch()) {
+ $out .= "$id. $timestamp ";
+ $out .= "Error Address: $address ";
+ $out .= "Error Registers Dump: $regs_dump" if ($regs_dump);
+ $out .= "\n\n";
+ }
+ if ($out ne "") {
+ print "THead Yitian710 DDRC error events:\n$out\n";
+ } else {
+ print "No THead Yitian710 DDRC error events.\n";
+ }
+ $query_handle->finish;
}
if ($platform_id && !($found_platform)) {
- print "Platform ID $platform_id is not valid\n";
+ print "Platform ID $platform_id is not valid\n";
} elsif ($module && !($found_module)) {
- print "No error record for the module $module\n";
+ print "No error record for the module $module\n";
}
undef($dbh);
}
--
2.33.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/rasdaemon.git
[email protected]:src-anolis-os/rasdaemon.git
src-anolis-os
rasdaemon
rasdaemon
a8

搜索帮助