* [PATCH] rasdaemon: ras-events: Adapt to kernel v6.19 memory-failure trace event directory change
@ 2026-08-27 4:06 Junhao He
2026-08-27 9:17 ` Xie Yuanbin
0 siblings, 1 reply; 2+ messages in thread
From: Junhao He @ 2026-08-27 4:06 UTC (permalink / raw)
To: linux-edac, mchehab+huawei
Cc: linux-kernel, tony.luck, shijujose2008, xueshuai, tanxiaofei,
xieyuanbin1, linuxarm, hejunhao3
Kernel v6.19 moves memory_failure_event from the "ras" trace event
group to a separate "memory_failure" group, as the event's
TRACE_SYSTEM changed from "ras" to "memory_failure". This changes
the tracefs path from events/ras/memory_failure_event to
events/memory_failure/memory_failure_event.
Add get_memory_failure_group_name() to dynamically detect which
path exists, ensuring backward compatibility with older kernels
that still use the "ras" group.
kernel commit:
https://lore.kernel.org/all/20251119095943.67125-1-xieyuanbin1@huawei.com/
Signed-off-by: Junhao He <hejunhao3@h-partners.com>
---
ras-events.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/ras-events.c b/ras-events.c
index ab2dd51..229ea93 100644
--- a/ras-events.c
+++ b/ras-events.c
@@ -66,6 +66,20 @@ static const struct event_trigger event_triggers[] = {
#endif
};
+#ifdef HAVE_MEMORY_FAILURE
+static const char *get_memory_failure_group_name(struct ras_events *ras)
+{
+ char fname[MAX_PATH + 1];
+
+ snprintf(fname, sizeof(fname), "%s/events/memory_failure/memory_failure_event",
+ ras->tracing);
+ if (access(fname, F_OK) == 0)
+ return "memory_failure";
+
+ return "ras"; /* fallback to old path */
+}
+#endif
+
static int get_mountdir_by_type(char *mount_type, char *tracing_dir, size_t len)
{
FILE *fp;
@@ -325,7 +339,9 @@ int toggle_ras_mc_event(int enable)
#endif
#ifdef HAVE_MEMORY_FAILURE
- rc |= __toggle_ras_mc_event(ras, "ras", "memory_failure_event", enable);
+ const char *group = get_memory_failure_group_name(ras);
+
+ rc |= __toggle_ras_mc_event(ras, group, "memory_failure_event", enable);
#endif
#ifdef HAVE_CXL
@@ -1166,13 +1182,15 @@ int handle_ras_events(int record_events, int enable_ipmitool)
#endif
#ifdef HAVE_MEMORY_FAILURE
- rc = add_event_handler(ras, pevent, page_size, "ras", "memory_failure_event",
+ const char *group = get_memory_failure_group_name(ras);
+
+ rc = add_event_handler(ras, pevent, page_size, group, "memory_failure_event",
ras_memory_failure_event_handler, NULL, MF_EVENT);
if (!rc)
num_events++;
else if (rc != EVENT_DISABLED)
log(ALL, LOG_ERR, "Can't get traces from %s:%s\n",
- "ras", "memory_failure_event");
+ group, "memory_failure_event");
#endif
#ifdef HAVE_CXL
--
2.33.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rasdaemon: ras-events: Adapt to kernel v6.19 memory-failure trace event directory change
2026-08-27 4:06 [PATCH] rasdaemon: ras-events: Adapt to kernel v6.19 memory-failure trace event directory change Junhao He
@ 2026-08-27 9:17 ` Xie Yuanbin
0 siblings, 0 replies; 2+ messages in thread
From: Xie Yuanbin @ 2026-08-27 9:17 UTC (permalink / raw)
To: hejunhao3
Cc: linux-edac, linux-kernel, linuxarm, mchehab+huawei,
shijujose2008, tanxiaofei, tony.luck, xieyuanbin1, xueshuai
On Thu, 27 Aug 2026 12:06:41 +0800, Junhao He wrote:
> Kernel v6.19 moves memory_failure_event from the "ras" trace event
> group to a separate "memory_failure" group, as the event's
> TRACE_SYSTEM changed from "ras" to "memory_failure". This changes
> the tracefs path from events/ras/memory_failure_event to
> events/memory_failure/memory_failure_event.
>
> Add get_memory_failure_group_name() to dynamically detect which
> path exists, ensuring backward compatibility with older kernels
> that still use the "ras" group.
>
> kernel commit:
> https://lore.kernel.org/all/20251119095943.67125-1-xieyuanbin1@huawei.com/
Can this patch solve your problem?
Link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e57d6e9e20b551e4910d7a6331a81775c3ad6693
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-27 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 4:06 [PATCH] rasdaemon: ras-events: Adapt to kernel v6.19 memory-failure trace event directory change Junhao He
2026-08-27 9:17 ` Xie Yuanbin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®