lkml.org 
[lkml]   [2017]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] printk: add task name and CPU to console messages
Date
*** FOR TESTING ***

Add current->comm/smp_processor_id() prefix to every console line.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
kernel/printk/printk.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index a34a839e6045..a36cc6b9148e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1540,6 +1540,9 @@ static size_t print_prefix(const struct printk_log *msg, bool syslog, char *buf)
}
}

+ if (buf)
+ len += sprintf(buf, "{%s/%d}", current->comm,
+ smp_processor_id());
len += print_time(msg->ts_nsec, buf ? buf + len : NULL);
return len;
}
--
2.15.1
\
 
 \ /
  Last update: 2017-12-04 14:56    [W:0.149 / U:21.032 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site