rasdaemon/diskerror: fix incomplete diskerror log
Signed-off-by: Lv Ying <lvying6@huawei.com>
This commit is contained in:
parent
962c9569f0
commit
40f0a70c6e
62
rasdaemon-diskerror-fix-incomplete-diskerror-log.patch
Normal file
62
rasdaemon-diskerror-fix-incomplete-diskerror-log.patch
Normal file
@ -0,0 +1,62 @@
|
||||
From be5ea839fd52453f01ceb131813fb2e6919684ab Mon Sep 17 00:00:00 2001
|
||||
From: Lv Ying <lvying6@huawei.com>
|
||||
Date: Thu, 15 Dec 2022 21:01:59 +0800
|
||||
Subject: [PATCH] rasdaemon/diskerror: fix incomplete diskerror log
|
||||
|
||||
Currently, rasdaemon output incomplete diskerror log(only contains timestamp):
|
||||
<idle>-0 [000] 0.017915: block_rq_complete: 2022-12-16 04:17:32 +0800
|
||||
|
||||
Fix incomplete diskerror log just like block_rq_complete tracepoint output format:
|
||||
<idle>-0 [042] d.h. 177962.715669: block_rq_complete: 21,0 N () 18446744073709551615 + 0 [-121]
|
||||
---
|
||||
ras-diskerror-handler.c | 22 ++++++++++++++--------
|
||||
1 file changed, 14 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/ras-diskerror-handler.c b/ras-diskerror-handler.c
|
||||
index b16319f..0a6e315 100644
|
||||
--- a/ras-diskerror-handler.c
|
||||
+++ b/ras-diskerror-handler.c
|
||||
@@ -97,26 +97,32 @@ int ras_diskerror_event_handler(struct trace_seq *s,
|
||||
dev = (dev_t)val;
|
||||
if (asprintf(&ev.dev, "%u:%u", major(dev), minor(dev)) < 0)
|
||||
return -1;
|
||||
+ trace_seq_printf(s, "%s ", ev.dev);
|
||||
+
|
||||
+ ev.rwbs = pevent_get_field_raw(s, event, "rwbs", record, &len, 1);
|
||||
+ if (!ev.rwbs)
|
||||
+ return -1;
|
||||
+ trace_seq_printf(s, "%s ", ev.rwbs);
|
||||
+
|
||||
+ ev.cmd = pevent_get_field_raw(s, event, "cmd", record, &len, 1);
|
||||
+ if (!ev.cmd)
|
||||
+ return -1;
|
||||
+ trace_seq_printf(s, "(%s) ", ev.cmd);
|
||||
|
||||
if (pevent_get_field_val(s, event, "sector", record, &val, 1) < 0)
|
||||
return -1;
|
||||
ev.sector = val;
|
||||
+ trace_seq_printf(s, "%llu ", ev.sector);
|
||||
|
||||
if (pevent_get_field_val(s, event, "nr_sector", record, &val, 1) < 0)
|
||||
return -1;
|
||||
ev.nr_sector = (unsigned int)val;
|
||||
+ trace_seq_printf(s, "+ %u ", ev.nr_sector);
|
||||
|
||||
if (pevent_get_field_val(s, event, "error", record, &val, 1) < 0)
|
||||
return -1;
|
||||
ev.error = get_blk_error((int)val);
|
||||
-
|
||||
- ev.rwbs = pevent_get_field_raw(s, event, "rwbs", record, &len, 1);
|
||||
- if (!ev.rwbs)
|
||||
- return -1;
|
||||
-
|
||||
- ev.cmd = pevent_get_field_raw(s, event, "cmd", record, &len, 1);
|
||||
- if (!ev.cmd)
|
||||
- return -1;
|
||||
+ trace_seq_printf(s, "[%s]", ev.error);
|
||||
|
||||
/* Insert data into the SGBD */
|
||||
#ifdef HAVE_SQLITE3
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: rasdaemon
|
||||
Version: 0.6.7
|
||||
Release: 6
|
||||
Release: 7
|
||||
License: GPLv2
|
||||
Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events
|
||||
URL: https://github.com/mchehab/rasdaemon.git
|
||||
@ -38,6 +38,7 @@ Patch16: 0008-rasdaemon-ras-mc-ctl-Relocate-reading-and-display-Ku.patch
|
||||
Patch17: 0009-rasdaemon-ras-mc-ctl-Updated-HiSilicon-platform-name.patch
|
||||
Patch18: 0010-rasdaemon-Fix-for-a-memory-out-of-bounds-issue-and-o.patch
|
||||
Patch19: 0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch
|
||||
Patch20: rasdaemon-diskerror-fix-incomplete-diskerror-log.patch
|
||||
|
||||
%description
|
||||
The rasdaemon program is a daemon which monitors the platform
|
||||
@ -83,6 +84,12 @@ rm INSTALL %{buildroot}/usr/include/*.h
|
||||
/usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || :
|
||||
|
||||
%changelog
|
||||
* Thu Feb 16 2023 Lv Ying <lvying6@huawei.com> - 0.6.7-7
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:rasdaemon/diskerror: fix incomplete diskerror log
|
||||
|
||||
* Thu Oct 27 2022 Lei Feng <fenglei47@h-partners.com> - 0.6.7-6
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user