[RFC 2/9] printk: Bring back printk_emit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Needed for adding structured logging in a number of different areas.

Signed-off-by: Tony Asleson <tasleson@xxxxxxxxxx>
---
 include/linux/printk.h |  5 +++++
 kernel/printk/printk.c | 15 +++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index c09d67edda3a..06c3ba5b695e 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -167,6 +167,11 @@ int vprintk_emit(int facility, int level,
 asmlinkage __printf(1, 0)
 int vprintk(const char *fmt, va_list args);
 
+asmlinkage __printf(5, 6) __cold
+int printk_emit(int facility, int level,
+		const char *dict, size_t dictlen,
+		const char *fmt, ...);
+
 asmlinkage __printf(1, 2) __cold
 int printk(const char *fmt, ...);
 
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index ca65327a6de8..8d7be8c9bb08 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2009,6 +2009,21 @@ asmlinkage int vprintk(const char *fmt, va_list args)
 }
 EXPORT_SYMBOL(vprintk);
 
+asmlinkage int printk_emit(int facility, int level,
+			   const char *dict, size_t dictlen,
+			   const char *fmt, ...)
+{
+	va_list args;
+	int r;
+
+	va_start(args, fmt);
+	r = vprintk_emit(facility, level, dict, dictlen, fmt, args);
+	va_end(args);
+
+	return r;
+}
+EXPORT_SYMBOL(printk_emit);
+
 int vprintk_default(const char *fmt, va_list args)
 {
 	int r;
-- 
2.21.0




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux