lkml.org 
[lkml]   [2017]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint
Btw,

how about communicating stuff to the userspace daemon like this?

This'll simplify a lot of detection in userspace.

Thoughts?

---
diff --git a/drivers/ras/debugfs.c b/drivers/ras/debugfs.c
index 501603057dff..62d3da9d256f 100644
--- a/drivers/ras/debugfs.c
+++ b/drivers/ras/debugfs.c
@@ -1,5 +1,7 @@
#include <linux/debugfs.h>

+#include "../../arch/x86/kernel/cpu/mcheck/mce-internal.h"
+
struct dentry *ras_debugfs_dir;

static atomic_t trace_count = ATOMIC_INIT(0);
@@ -12,7 +14,9 @@ EXPORT_SYMBOL_GPL(ras_userspace_consumers);

static int trace_show(struct seq_file *m, void *v)
{
- return atomic_read(&trace_count);
+ seq_printf(m, "readers:%d\n", atomic_read(&trace_count));
+ seq_printf(m, "has decoder:%d\n", mca_cfg.has_decoder);
+ return 0;
}

static int trace_open(struct inode *inode, struct file *file)
--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

\
 
 \ /
  Last update: 2017-08-30 13:49    [W:0.086 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site