All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mark Salter <msalter@redhat.com>, Tony Luck <tony.luck@intel.com>,
	David Howells <dhowells@redhat.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>, Borislav Petkov <bp@alien8.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Vineet Gupta <vgupta@synopsys.com>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org,
	linux-am33-list@redhat.com, linux-sh@vger.kernel.org,
	linux-edac@vger.kernel.org, x86@kernel.org,
	linux-snps-arc@lists.infradead.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [00/13] replace print_symbol() with printk()-s
Date: Fri, 5 Jan 2018 19:25:38 +0900	[thread overview]
Message-ID: <20180105102538.GC471@jagdpanzerIV> (raw)

On (01/05/18 19:21), Sergey Senozhatsky wrote:
> On (01/05/18 11:03), Petr Mladek wrote:
> [..]
> > Anyway, print_symbol() is an old weird API and it would be nice
> > to eventually get rid of it. I could take this patches into
> > printk.git.
> 
> no objections from my side if the patch set will go through the printk tree.
> shall we wait for ACKs or can we move on? do you plan to land it in 4.16?
> 
> > Would you mind if I change the commit messages to something like?:
> > 
> >     print_symbol() is an old weird API. It has been
> >     obsoleted by printk() and %pS format specifier.
> 
> I wouldn't. let's drop the "weird" part. other than that looks
> good to me.

oh, one more thing. one extra patch, which gets rid of
print_symbol()/__print_symbol().

8< ===

From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] kallsyms: remove print_symbol() function

No more print_symbol()/__print_symbol() users left, remove these
symbols.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Joe Perches <joe@perches.com>
---
 Documentation/filesystems/sysfs.txt                    |  4 ++--
 Documentation/translations/zh_CN/filesystems/sysfs.txt |  4 ++--
 include/linux/kallsyms.h                               | 18 ------------------
 kernel/kallsyms.c                                      | 11 -----------
 4 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 23190e5c940b..657a83b943f0 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
 extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
 extern int sprint_backtrace(char *buffer, unsigned long address);
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-extern void __print_symbol(const char *fmt, unsigned long address);
-
 int lookup_symbol_name(unsigned long addr, char *symname);
 int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void)
 	return false;
 }
 
-/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
 #endif /*CONFIG_KALLSYMS*/
 
-/* This macro allows us to keep printk typechecking */
-static __printf(1, 2)
-void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-static inline void print_symbol(const char *fmt, unsigned long addr)
-{
-	__check_printsym_format(fmt, "");
-	__print_symbol(fmt, (unsigned long)
-		       __builtin_extract_return_addr((void *)addr));
-}
-
 static inline void print_ip_sym(unsigned long ip)
 {
 	printk("[<%px>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 24f456689f9c..a23e21ada81b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
 	return __sprint_symbol(buffer, address, -1, 1);
 }
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
-	char buffer[KSYM_SYMBOL_LEN];
-
-	sprint_symbol(buffer, address);
-
-	printk(fmt, buffer);
-}
-EXPORT_SYMBOL(__print_symbol);
-
 /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
 struct kallsym_iter {
 	loff_t pos;

WARNING: multiple messages have this Message-ID (diff)
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 00/13] replace print_symbol() with printk()-s
Date: Fri, 05 Jan 2018 10:25:38 +0000	[thread overview]
Message-ID: <20180105102538.GC471@jagdpanzerIV> (raw)
In-Reply-To: <20180105102105.GB471@jagdpanzerIV>

On (01/05/18 19:21), Sergey Senozhatsky wrote:
> On (01/05/18 11:03), Petr Mladek wrote:
> [..]
> > Anyway, print_symbol() is an old weird API and it would be nice
> > to eventually get rid of it. I could take this patches into
> > printk.git.
> 
> no objections from my side if the patch set will go through the printk tree.
> shall we wait for ACKs or can we move on? do you plan to land it in 4.16?
> 
> > Would you mind if I change the commit messages to something like?:
> > 
> >     print_symbol() is an old weird API. It has been
> >     obsoleted by printk() and %pS format specifier.
> 
> I wouldn't. let's drop the "weird" part. other than that looks
> good to me.

oh, one more thing. one extra patch, which gets rid of
print_symbol()/__print_symbol().

8< =
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] kallsyms: remove print_symbol() function

No more print_symbol()/__print_symbol() users left, remove these
symbols.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Joe Perches <joe@perches.com>
---
 Documentation/filesystems/sysfs.txt                    |  4 ++--
 Documentation/translations/zh_CN/filesystems/sysfs.txt |  4 ++--
 include/linux/kallsyms.h                               | 18 ------------------
 kernel/kallsyms.c                                      | 11 -----------
 4 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 23190e5c940b..657a83b943f0 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
 extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
 extern int sprint_backtrace(char *buffer, unsigned long address);
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-extern void __print_symbol(const char *fmt, unsigned long address);
-
 int lookup_symbol_name(unsigned long addr, char *symname);
 int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void)
 	return false;
 }
 
-/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
 #endif /*CONFIG_KALLSYMS*/
 
-/* This macro allows us to keep printk typechecking */
-static __printf(1, 2)
-void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-static inline void print_symbol(const char *fmt, unsigned long addr)
-{
-	__check_printsym_format(fmt, "");
-	__print_symbol(fmt, (unsigned long)
-		       __builtin_extract_return_addr((void *)addr));
-}
-
 static inline void print_ip_sym(unsigned long ip)
 {
 	printk("[<%px>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 24f456689f9c..a23e21ada81b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
 	return __sprint_symbol(buffer, address, -1, 1);
 }
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
-	char buffer[KSYM_SYMBOL_LEN];
-
-	sprint_symbol(buffer, address);
-
-	printk(fmt, buffer);
-}
-EXPORT_SYMBOL(__print_symbol);
-
 /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
 struct kallsym_iter {
 	loff_t pos;
-- 
2.15.1


WARNING: multiple messages have this Message-ID (diff)
From: sergey.senozhatsky.work@gmail.com (Sergey Senozhatsky)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH 00/13] replace print_symbol() with printk()-s
Date: Fri, 5 Jan 2018 19:25:38 +0900	[thread overview]
Message-ID: <20180105102538.GC471@jagdpanzerIV> (raw)
In-Reply-To: <20180105102105.GB471@jagdpanzerIV>

On (01/05/18 19:21), Sergey Senozhatsky wrote:
> On (01/05/18 11:03), Petr Mladek wrote:
> [..]
> > Anyway, print_symbol() is an old weird API and it would be nice
> > to eventually get rid of it. I could take this patches into
> > printk.git.
> 
> no objections from my side if the patch set will go through the printk tree.
> shall we wait for ACKs or can we move on? do you plan to land it in 4.16?
> 
> > Would you mind if I change the commit messages to something like?:
> > 
> >     print_symbol() is an old weird API. It has been
> >     obsoleted by printk() and %pS format specifier.
> 
> I wouldn't. let's drop the "weird" part. other than that looks
> good to me.

oh, one more thing. one extra patch, which gets rid of
print_symbol()/__print_symbol().

8< ===

From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] kallsyms: remove print_symbol() function

No more print_symbol()/__print_symbol() users left, remove these
symbols.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
Suggested-by: Joe Perches <joe at perches.com>
---
 Documentation/filesystems/sysfs.txt                    |  4 ++--
 Documentation/translations/zh_CN/filesystems/sysfs.txt |  4 ++--
 include/linux/kallsyms.h                               | 18 ------------------
 kernel/kallsyms.c                                      | 11 -----------
 4 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 23190e5c940b..657a83b943f0 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
 extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
 extern int sprint_backtrace(char *buffer, unsigned long address);
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-extern void __print_symbol(const char *fmt, unsigned long address);
-
 int lookup_symbol_name(unsigned long addr, char *symname);
 int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void)
 	return false;
 }
 
-/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
 #endif /*CONFIG_KALLSYMS*/
 
-/* This macro allows us to keep printk typechecking */
-static __printf(1, 2)
-void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-static inline void print_symbol(const char *fmt, unsigned long addr)
-{
-	__check_printsym_format(fmt, "");
-	__print_symbol(fmt, (unsigned long)
-		       __builtin_extract_return_addr((void *)addr));
-}
-
 static inline void print_ip_sym(unsigned long ip)
 {
 	printk("[<%px>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 24f456689f9c..a23e21ada81b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
 	return __sprint_symbol(buffer, address, -1, 1);
 }
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
-	char buffer[KSYM_SYMBOL_LEN];
-
-	sprint_symbol(buffer, address);
-
-	printk(fmt, buffer);
-}
-EXPORT_SYMBOL(__print_symbol);
-
 /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
 struct kallsym_iter {
 	loff_t pos;
-- 
2.15.1

WARNING: multiple messages have this Message-ID (diff)
From: sergey.senozhatsky.work@gmail.com (Sergey Senozhatsky)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/13] replace print_symbol() with printk()-s
Date: Fri, 5 Jan 2018 19:25:38 +0900	[thread overview]
Message-ID: <20180105102538.GC471@jagdpanzerIV> (raw)
In-Reply-To: <20180105102105.GB471@jagdpanzerIV>

On (01/05/18 19:21), Sergey Senozhatsky wrote:
> On (01/05/18 11:03), Petr Mladek wrote:
> [..]
> > Anyway, print_symbol() is an old weird API and it would be nice
> > to eventually get rid of it. I could take this patches into
> > printk.git.
> 
> no objections from my side if the patch set will go through the printk tree.
> shall we wait for ACKs or can we move on? do you plan to land it in 4.16?
> 
> > Would you mind if I change the commit messages to something like?:
> > 
> >     print_symbol() is an old weird API. It has been
> >     obsoleted by printk() and %pS format specifier.
> 
> I wouldn't. let's drop the "weird" part. other than that looks
> good to me.

oh, one more thing. one extra patch, which gets rid of
print_symbol()/__print_symbol().

8< ===

From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] kallsyms: remove print_symbol() function

No more print_symbol()/__print_symbol() users left, remove these
symbols.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Joe Perches <joe@perches.com>
---
 Documentation/filesystems/sysfs.txt                    |  4 ++--
 Documentation/translations/zh_CN/filesystems/sysfs.txt |  4 ++--
 include/linux/kallsyms.h                               | 18 ------------------
 kernel/kallsyms.c                                      | 11 -----------
 4 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 23190e5c940b..657a83b943f0 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
 extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
 extern int sprint_backtrace(char *buffer, unsigned long address);
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-extern void __print_symbol(const char *fmt, unsigned long address);
-
 int lookup_symbol_name(unsigned long addr, char *symname);
 int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void)
 	return false;
 }
 
-/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
 #endif /*CONFIG_KALLSYMS*/
 
-/* This macro allows us to keep printk typechecking */
-static __printf(1, 2)
-void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-static inline void print_symbol(const char *fmt, unsigned long addr)
-{
-	__check_printsym_format(fmt, "");
-	__print_symbol(fmt, (unsigned long)
-		       __builtin_extract_return_addr((void *)addr));
-}
-
 static inline void print_ip_sym(unsigned long ip)
 {
 	printk("[<%px>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 24f456689f9c..a23e21ada81b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
 	return __sprint_symbol(buffer, address, -1, 1);
 }
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
-	char buffer[KSYM_SYMBOL_LEN];
-
-	sprint_symbol(buffer, address);
-
-	printk(fmt, buffer);
-}
-EXPORT_SYMBOL(__print_symbol);
-
 /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
 struct kallsym_iter {
 	loff_t pos;
-- 
2.15.1

WARNING: multiple messages have this Message-ID (diff)
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mark Salter <msalter@redhat.com>, Tony Luck <tony.luck@intel.com>,
	David Howells <dhowells@redhat.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>, Borislav Petkov <bp@alien8.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Vineet Gupta <vgupta@synopsys.com>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org,
	linux-am33-list@redhat.com, linux-sh@vger.kernel.org,
	linux-edac@vger.kernel.org, x86@kernel.org,
	linux-snps-arc@lists.infradead.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH 00/13] replace print_symbol() with printk()-s
Date: Fri, 5 Jan 2018 19:25:38 +0900	[thread overview]
Message-ID: <20180105102538.GC471@jagdpanzerIV> (raw)
In-Reply-To: <20180105102105.GB471@jagdpanzerIV>

On (01/05/18 19:21), Sergey Senozhatsky wrote:
> On (01/05/18 11:03), Petr Mladek wrote:
> [..]
> > Anyway, print_symbol() is an old weird API and it would be nice
> > to eventually get rid of it. I could take this patches into
> > printk.git.
> 
> no objections from my side if the patch set will go through the printk tree.
> shall we wait for ACKs or can we move on? do you plan to land it in 4.16?
> 
> > Would you mind if I change the commit messages to something like?:
> > 
> >     print_symbol() is an old weird API. It has been
> >     obsoleted by printk() and %pS format specifier.
> 
> I wouldn't. let's drop the "weird" part. other than that looks
> good to me.

oh, one more thing. one extra patch, which gets rid of
print_symbol()/__print_symbol().

8< ===

From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: [PATCH] kallsyms: remove print_symbol() function

No more print_symbol()/__print_symbol() users left, remove these
symbols.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Joe Perches <joe@perches.com>
---
 Documentation/filesystems/sysfs.txt                    |  4 ++--
 Documentation/translations/zh_CN/filesystems/sysfs.txt |  4 ++--
 include/linux/kallsyms.h                               | 18 ------------------
 kernel/kallsyms.c                                      | 11 -----------
 4 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
         if (dev_attr->show)
                 ret = dev_attr->show(dev, dev_attr, buf);
         if (ret >= (ssize_t)PAGE_SIZE) {
-                print_symbol("dev_attr_show: %s returned bad count\n",
-                                (unsigned long)dev_attr->show);
+                printk("dev_attr_show: %pS returned bad count\n",
+                                dev_attr->show);
         }
         return ret;
 }
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 23190e5c940b..657a83b943f0 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
 extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
 extern int sprint_backtrace(char *buffer, unsigned long address);
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-extern void __print_symbol(const char *fmt, unsigned long address);
-
 int lookup_symbol_name(unsigned long addr, char *symname);
 int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void)
 	return false;
 }
 
-/* Stupid that this does nothing, but I didn't create this mess. */
-#define __print_symbol(fmt, addr)
 #endif /*CONFIG_KALLSYMS*/
 
-/* This macro allows us to keep printk typechecking */
-static __printf(1, 2)
-void __check_printsym_format(const char *fmt, ...)
-{
-}
-
-static inline void print_symbol(const char *fmt, unsigned long addr)
-{
-	__check_printsym_format(fmt, "");
-	__print_symbol(fmt, (unsigned long)
-		       __builtin_extract_return_addr((void *)addr));
-}
-
 static inline void print_ip_sym(unsigned long ip)
 {
 	printk("[<%px>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 24f456689f9c..a23e21ada81b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
 	return __sprint_symbol(buffer, address, -1, 1);
 }
 
-/* Look up a kernel symbol and print it to the kernel messages. */
-void __print_symbol(const char *fmt, unsigned long address)
-{
-	char buffer[KSYM_SYMBOL_LEN];
-
-	sprint_symbol(buffer, address);
-
-	printk(fmt, buffer);
-}
-EXPORT_SYMBOL(__print_symbol);
-
 /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
 struct kallsym_iter {
 	loff_t pos;
-- 
2.15.1

             reply	other threads:[~2018-01-05 10:25 UTC|newest]

Thread overview: 180+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 10:25 Sergey Senozhatsky [this message]
2018-01-05 10:25 ` [PATCH 00/13] replace print_symbol() with printk()-s Sergey Senozhatsky
2018-01-05 10:25 ` Sergey Senozhatsky
2018-01-05 10:25 ` Sergey Senozhatsky
2018-01-05 10:25 ` Sergey Senozhatsky
  -- strict thread matches above, loose matches on Subject: below --
2018-01-17  2:36 [00/13] " Sergey Senozhatsky
2018-01-17  2:36 ` [PATCH 00/13] " Sergey Senozhatsky
2018-01-17  2:36 ` Sergey Senozhatsky
2018-01-17  2:36 ` Sergey Senozhatsky
2018-01-17  2:36 ` Sergey Senozhatsky
2018-01-16 16:33 [00/13] " Petr Mladek
2018-01-16 16:33 ` [PATCH 00/13] " Petr Mladek
2018-01-16 16:33 ` Petr Mladek
2018-01-16 16:33 ` Petr Mladek
2018-01-08  2:09 [00/13] " Sergey Senozhatsky
2018-01-08  2:09 ` [PATCH 00/13] " Sergey Senozhatsky
2018-01-08  2:09 ` Sergey Senozhatsky
2018-01-08  2:09 ` Sergey Senozhatsky
2018-01-08  2:09 ` Sergey Senozhatsky
2018-01-05 14:57 [00/13] " Sergey Senozhatsky
2018-01-05 14:57 ` [PATCH 00/13] " Sergey Senozhatsky
2018-01-05 14:57 ` Sergey Senozhatsky
2018-01-05 14:57 ` Sergey Senozhatsky
2018-01-05 14:57 ` Sergey Senozhatsky
2018-01-05 14:42 [00/13] " Petr Mladek
2018-01-05 14:42 ` [PATCH 00/13] " Petr Mladek
2018-01-05 14:42 ` Petr Mladek
2018-01-05 14:42 ` Petr Mladek
2018-01-05 14:42 ` Petr Mladek
2017-12-21  5:54 [00/13] " Sergey Senozhatsky
2017-12-21  5:54 ` [PATCH 00/13] " Sergey Senozhatsky
2017-12-21  5:54 ` Sergey Senozhatsky
2017-12-21  5:54 ` Sergey Senozhatsky
2017-12-21  5:54 ` Sergey Senozhatsky
2017-12-12  7:34 [PATCHv2,11/13] irq debug: do not use print_symbol() Sergey Senozhatsky
2017-12-12  7:34 ` [PATCHv2 11/13] " Sergey Senozhatsky
2017-12-12  7:34 ` Sergey Senozhatsky
2017-12-12  7:34 ` Sergey Senozhatsky
2017-12-12  7:34 ` Sergey Senozhatsky
2017-12-12  3:10 [00/13] replace print_symbol() with printk()-s Joe Perches
2017-12-12  3:10 ` [PATCH 00/13] " Joe Perches
2017-12-12  3:10 ` Joe Perches
2017-12-12  3:10 ` Joe Perches
2017-12-12  3:10 ` Joe Perches
2017-12-12  2:50 [11/13] irq debug: do not use print_symbol() Sergey Senozhatsky
2017-12-12  2:50 ` [PATCH 11/13] " Sergey Senozhatsky
2017-12-12  2:50 ` Sergey Senozhatsky
2017-12-12  2:50 ` Sergey Senozhatsky
2017-12-12  2:50 ` Sergey Senozhatsky
2017-12-12  2:47 [00/13] replace print_symbol() with printk()-s Sergey Senozhatsky
2017-12-12  2:47 ` [PATCH 00/13] " Sergey Senozhatsky
2017-12-12  2:47 ` Sergey Senozhatsky
2017-12-12  2:47 ` Sergey Senozhatsky
2017-12-12  2:47 ` Sergey Senozhatsky
2017-12-12  2:41 [08/13] x86: do not use print_symbol() Sergey Senozhatsky
2017-12-12  2:41 ` [PATCH 08/13] " Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 [13/13] arc: do not use __print_symbol() Sergey Senozhatsky
2017-12-12  2:41 ` [PATCH 13/13] " Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-12  2:41 ` Sergey Senozhatsky
2017-12-11 17:45 [08/13] x86: do not use print_symbol() Borislav Petkov
2017-12-11 17:45 ` [PATCH 08/13] " Borislav Petkov
2017-12-11 17:45 ` Borislav Petkov
2017-12-11 17:45 ` Borislav Petkov
2017-12-11 17:45 ` Borislav Petkov
2017-12-11 16:28 [13/13] arc: do not use __print_symbol() Vineet Gupta
2017-12-11 16:28 ` [PATCH 13/13] " Vineet Gupta
2017-12-11 16:28 ` Vineet Gupta
2017-12-11 16:28 ` Vineet Gupta
2017-12-11 16:28 ` Vineet Gupta
2017-12-11 12:55 [11/13] irq debug: do not use print_symbol() David Laight
2017-12-11 12:55 ` [PATCH 11/13] " David Laight
2017-12-11 12:55 ` David Laight
2017-12-11 12:55 ` David Laight
2017-12-11 12:55 ` David Laight
2017-12-11 12:50 [13/13] arc: do not use __print_symbol() Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 13/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [12/13] lib: do not use print_symbol() Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 12/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [11/13] irq debug: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 11/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [10/13] sysfs: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 10/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [09/13] drivers: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 09/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [08/13] x86: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 08/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [07/13] unicore32: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 07/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [06/13] sh: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 06/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [05/13] mn10300: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 05/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [04/13] ia64: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 04/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [03/13] c6x: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 03/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [02/13] arm64: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 02/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [01/13] arm: " Sergey Senozhatsky
2017-12-11 12:50 ` [PATCH 01/13] " Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 [PATCH 00/13] replace print_symbol() with printk()-s Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 12:50 ` Sergey Senozhatsky
2017-12-11 16:26 ` Joe Perches
2017-12-11 16:26   ` Joe Perches
2017-12-11 16:26   ` Joe Perches
2017-12-11 16:26   ` Joe Perches
2017-12-20 10:20 ` Sergey Senozhatsky
2017-12-20 10:20   ` Sergey Senozhatsky
2017-12-20 10:20   ` Sergey Senozhatsky
2017-12-20 10:20   ` Sergey Senozhatsky
2018-01-05 10:03 ` Petr Mladek
2018-01-05 10:03   ` Petr Mladek
2018-01-05 10:03   ` Petr Mladek
2018-01-05 10:03   ` Petr Mladek
2018-01-05 10:21   ` Sergey Senozhatsky
2018-01-05 10:21     ` Sergey Senozhatsky
2018-01-05 10:21     ` Sergey Senozhatsky
2018-01-05 10:21     ` Sergey Senozhatsky
2018-01-05 11:38     ` Petr Mladek
2018-01-05 11:38       ` Petr Mladek
2018-01-05 11:38       ` Petr Mladek
2018-01-05 11:38       ` Petr Mladek
2018-01-05 12:01     ` Sergey Senozhatsky
2018-01-05 12:01       ` Sergey Senozhatsky
2018-01-05 12:01       ` Sergey Senozhatsky
2018-01-05 12:01       ` Sergey Senozhatsky
2018-01-05 12:23       ` Sergey Senozhatsky
2018-01-05 12:23         ` Sergey Senozhatsky
2018-01-05 12:23         ` Sergey Senozhatsky
2018-01-05 12:23         ` Sergey Senozhatsky
2018-01-05 13:09         ` Petr Mladek
2018-01-05 13:09           ` Petr Mladek
2018-01-05 13:09           ` Petr Mladek
2018-01-05 13:09           ` Petr Mladek

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=20180105102538.GC471@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dhowells@redhat.com \
    --cc=fengguang.wu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=linux-am33-list@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=msalter@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=vgupta@synopsys.com \
    --cc=x86@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.