aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-09-12 23:11:29 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-17 09:08:30 -0400
commit798efc60e4276825df34af0e91ecbe0781237834 (patch)
tree8ccec7118a7a76f5731fecb8507643c44936eb49 /include/linux/device.h
parent8f949b9a7e0bac3a9c3c29dc27c476a87e21db3e (diff)
dev_dbg/dynamic_debug: Update to use printk_emit, optimize stack
commit c4e00daaa9 ("driver-core: extend dev_printk() to pass structured data") changed __dev_printk and broke dynamic-debug's ability to control the dynamic prefix of dev_dbg(dev,..). commit af7f2158fd ("drivers-core: make structured logging play nice with dynamic-debug") made a minimal correction. The current dynamic debug code uses up to 3 recursion levels via %pV. This can consume quite a bit of stack. Directly call printk_emit to reduce the recursion depth. These changes include: dev_dbg: o Create and use function create_syslog_header to format the syslog header for printk_emit uses. o Call create_syslog_header and neaten __dev_printk o Make __dev_printk static not global o Remove include header declaration of __dev_printk o Remove now unused EXPORT_SYMBOL() of __dev_printk o Whitespace neatening dynamic_dev_dbg: o Remove KERN_DEBUG from dynamic_emit_prefix o Call create_syslog_header and printk_emit o Whitespace neatening Signed-off-by: Joe Perches <joe@perches.com> Acked-by: David S. Miller <davem@davemloft.net> Tested-by: Jim Cromie <jim.cromie@gmail.com> Acked-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 378a27c1d1af..a1443b48ed4b 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -895,12 +895,12 @@ extern const char *dev_driver_string(const struct device *dev);
895 895
896#ifdef CONFIG_PRINTK 896#ifdef CONFIG_PRINTK
897 897
898extern int __dev_printk(const char *level, const struct device *dev, 898extern int create_syslog_header(const struct device *dev,
899 struct va_format *vaf); 899 char *hdr, size_t hdrlen);
900
900extern __printf(3, 4) 901extern __printf(3, 4)
901int dev_printk(const char *level, const struct device *dev, 902int dev_printk(const char *level, const struct device *dev,
902 const char *fmt, ...) 903 const char *fmt, ...);
903 ;
904extern __printf(2, 3) 904extern __printf(2, 3)
905int dev_emerg(const struct device *dev, const char *fmt, ...); 905int dev_emerg(const struct device *dev, const char *fmt, ...);
906extern __printf(2, 3) 906extern __printf(2, 3)