From: Shiju Jose <shiju.jose@huawei.com>
To: <linux-edac@vger.kernel.org>, <mchehab+huawei@kernel.org>
Cc: <linuxarm@openeuler.org>, <tanxiaofei@huawei.com>,
<jonathan.cameron@huawei.com>
Subject: [PATCH v2 5/8] rasdaemon: ras-mc-ctl: Add support for the vendor-specific errors
Date: Mon, 25 Jan 2021 17:14:52 +0000 [thread overview]
Message-ID: <20210125171455.1886-6-shiju.jose@huawei.com> (raw)
In-Reply-To: <20210125171455.1886-1-shiju.jose@huawei.com>
Add commands to support logging the vendor-specific
error info in the ras-mc-ctl.
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Reviewed-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
util/ras-mc-ctl.in | 64 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 63 insertions(+), 1 deletion(-)
diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
index 97b1fa4..6820823 100755
--- a/util/ras-mc-ctl.in
+++ b/util/ras-mc-ctl.in
@@ -87,6 +87,9 @@ Usage: $prog [OPTIONS...]
--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.
+ --vendor-errors-summary <platform-id> Presents a summary of the vendor-specific logged errors.
+ --vendor-errors <platform-id> Shows the vendor-specific errors stored in the error database.
+ --vendor-platforms Shows the supported platforms with platform-ids for the vendor-specific errors.
--help This help message.
EOF
@@ -134,6 +137,18 @@ if ($conf{opt}{errors}) {
errors ();
}
+if ($conf{opt}{vendor_errors_summary}) {
+ vendor_errors_summary ();
+}
+
+if ($conf{opt}{vendor_errors}) {
+ vendor_errors ();
+}
+
+if ($conf{opt}{vendor_platforms}) {
+ vendor_platforms ();
+}
+
exit (0);
sub parse_cmdline
@@ -149,6 +164,9 @@ sub parse_cmdline
$conf{opt}{summary} = 0;
$conf{opt}{errors} = 0;
$conf{opt}{error_count} = 0;
+ $conf{opt}{vendor_errors_summary} = 0;
+ $conf{opt}{vendor_errors} = 0;
+ $conf{opt}{vendor_platforms} = 0;
my $rref = \$conf{opt}{report};
my $mref = \$conf{opt}{mainboard};
@@ -166,7 +184,10 @@ sub parse_cmdline
"layout" => \$conf{opt}{display_memory_layout},
"summary" => \$conf{opt}{summary},
"errors" => \$conf{opt}{errors},
- "error-count" => \$conf{opt}{error_count}
+ "error-count" => \$conf{opt}{error_count},
+ "vendor-errors-summary" => \$conf{opt}{vendor_errors_summary},
+ "vendor-errors" => \$conf{opt}{vendor_errors},
+ "vendor-platforms" => \$conf{opt}{vendor_platforms},
);
usage(1) if !$rc;
@@ -1495,6 +1516,47 @@ sub errors
undef($dbh);
}
+sub vendor_errors_summary
+{
+ require DBI;
+ my ($num_args, $platform_id);
+
+ $num_args = $#ARGV + 1;
+ $platform_id = 0;
+ if ($num_args ne 0) {
+ $platform_id = $ARGV[0];
+ } else {
+ return;
+ }
+
+ my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
+
+ undef($dbh);
+}
+
+sub vendor_errors
+{
+ require DBI;
+ my ($num_args, $platform_id);
+
+ $num_args = $#ARGV + 1;
+ $platform_id = 0;
+ if ($num_args ne 0) {
+ $platform_id = $ARGV[0];
+ } else {
+ return;
+ }
+
+ my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
+
+ undef($dbh);
+}
+
+sub vendor_platforms
+{
+ print "\nSupported platforms for the vendor-specific errors:\n";
+}
+
sub log_msg { print STDERR "$prog: ", @_ unless $conf{opt}{quiet}; }
sub log_error { log_msg ("Error: @_"); }
--
2.17.1
next prev parent reply other threads:[~2021-01-25 17:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-25 17:14 [PATCH v2 0/8] rasdaemon: add support for memory_failure events, Shiju Jose
2021-01-25 17:14 ` [PATCH v2 1/8] rasdaemon: add support for memory_failure events Shiju Jose
2021-01-25 17:14 ` [PATCH v2 2/8] rasdaemon: ras-mc-ctl: Modify ARM processor error summary log Shiju Jose
2021-01-25 17:14 ` [PATCH v2 3/8] rasdaemon: ras-mc-ctl: Add memory failure events Shiju Jose
2021-01-25 17:14 ` [PATCH v2 4/8] rasdaemon: ras-mc-ctl: Fix for exception when an event is not enabled Shiju Jose
2021-01-25 17:14 ` Shiju Jose [this message]
2021-01-25 17:14 ` [PATCH v2 6/8] rasdaemon: ras-mc-ctl: Add support for HiSilicon Kunpeng920 errors Shiju Jose
2021-01-25 17:14 ` [PATCH v2 7/8] rasdaemon: ras-mc-ctl: Add support for HiSilicon Kunpeng9xx common errors Shiju Jose
2021-01-25 17:14 ` [PATCH v2 8/8] rasdaemon: Modify confiure.ac for Hisilicon Kunpeng errors Shiju Jose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210125171455.1886-6-shiju.jose@huawei.com \
--to=shiju.jose@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-edac@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=mchehab+huawei@kernel.org \
--cc=tanxiaofei@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).