mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jack Stone <jack@hawkeye.stone.uk.eu.org>
To: linux-kernel@vger.kernel.org
Cc: hpa@zytor.com, Ian Kent <raven@themaw.net>
Subject: [PATCH 6/7] Add pr_debug_pid to kernel.h
Date: Sat, 09 Jun 2007 09:18:36 +0100	[thread overview]
Message-ID: <466A625C.4030700@hawkeye.stone.uk.eu.org> (raw)
In-Reply-To: <466A5E28.2000707@hawkeye.stone.uk.eu.org>

This patch adds a new function to kernel.h. This function prints out the
pid of the current process and the name of the function where it was
called from followed by the debug message and a newline.

This function mimics the output of autofs4.

Signed-off-by: Jack Stone <jack@hawkeye.stone.uk.eu.org>
---
Index: linux/include/linux/kernel.h
===================================================================
--- linux.orig/include/linux/kernel.h
+++ linux/include/linux/kernel.h
@@ -228,6 +228,8 @@ extern void print_hex_dump(const char *l
 /* If you are writing a driver, please use dev_dbg instead */
 #define pr_debug(fmt,arg...) \
 	printk(KERN_DEBUG fmt,##arg)
+#define pr_debug_pid(fmt,arg...) \
+	printk(KERN_DEBUG "pid %d: %s: " fmt "\n" , current->pid ,
__FUNCTION__, ##args)
 #define pr_err(fmt,arg...) \
 	printk(KERN_ERR fmt,##arg)
 #else
@@ -236,6 +238,11 @@ static inline int __attribute__ ((format
 	return 0;
 }

+static inline int __attribute__ ((format (printf, 1, 2)))
pr_debug_pid(const char * fmt, ...)
+{
+	return 0;
+}
+
 static inline int __attribute__ ((format (printf, 1, 2))) pr_err(const
char * fmt, ...)
 {
 	return 0;



  parent reply	other threads:[~2007-06-09  8:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 22:18 [PATCH 0/7] Cleanup code to replace DPRINTK with pr_debug Jack Stone
2007-06-08 22:20 ` [PATCH 1/7] Add a new debug function to kernel.h Jack Stone
2007-06-08 22:21 ` [PATCH 2/7] Replace DPRINTK with pr_debug in alternative.c Jack Stone
2007-06-08 22:22 ` [PATCH 3/7] Replace DPRINTK with pr_debug in autofs Jack Stone
2007-06-08 22:40   ` H. Peter Anvin
2007-06-08 22:23 ` [PATCH 4/7] Update DPRINTK macro to use pr_debug in autofs4 Jack Stone
2007-06-08 22:24 ` [PATCH 5/7] Replace DPRINTK with pr_debug in ncpfs Jack Stone
2007-06-08 22:25 ` [PATCH 6/7] Add pr_debug_pid to kernel.h Jack Stone
2007-06-08 22:25 ` [PATCH 7/7] Replace DPRINTK with pr_debug_pid in autofs4 Jack Stone
2007-06-09  6:43 ` [PATCH 0/7] Cleanup code to replace DPRINTK with pr_debug Ian Kent
2007-06-09  7:56   ` Jack Stone
2007-06-09  8:00 ` Jack Stone
2007-06-09  8:06   ` [PATCH 1/7] Add a new debug function to kernel.h Jack Stone
2007-06-11  4:34     ` Ian Kent
2007-06-09  8:08   ` [PATCH 2/7] Replace DPRINTK with pr_debug in alternative.c Jack Stone
2007-06-09 18:00     ` Alexey Dobriyan
2007-06-09 18:05       ` Jack Stone
2007-06-09  8:10   ` [PATCH 3/7] Replace DPRINTK with pr_debug in autofs Jack Stone
2007-06-09  8:12   ` [PATCH 4/7] Update DPRINTK macro to use pr_debug Jack Stone
2007-06-09  8:15   ` [PATCH 5/7] Replace DPRINTK with pr_debug in ncpfs Jack Stone
2007-06-09  8:18   ` Jack Stone [this message]
2007-06-09 18:03     ` [PATCH 6/7] Add pr_debug_pid to kernel.h Alexey Dobriyan
2007-06-09 18:04       ` Jack Stone
2007-06-09  8:20   ` [PATCH 7/7] Replace DPRINTK with pr_debug_pid in autofs4 Jack Stone
2007-06-10 17:50 ` [PATCH 0/7] Cleanup code to replace DPRINTK with pr_debug Randy Dunlap
2007-06-10 19:29   ` Jack Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466A625C.4030700@hawkeye.stone.uk.eu.org \
    --to=jack@hawkeye.stone.uk.eu.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®