diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2012-07-19 15:46:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 13:20:53 -0400 |
commit | af7f2158fdee9d7f55b793b09f8170a3391f889a (patch) | |
tree | 8667955bac67e38218234d3371ed227d6b27d859 /drivers/base | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
drivers-core: make structured logging play nice with dynamic-debug
commit c4e00daaa96d3a0786f1f4fe6456281c60ef9a16 changed __dev_printk
in a way that broke dynamic-debug's ability to control the dynamic
prefix of dev_dbg(dev,..), but not dev_dbg(NULL,..) or pr_debug(..),
which is why it wasnt noticed sooner.
When dev==NULL, __dev_printk() just calls printk(), which just works.
But otherwise, it assumed that level was always a string like "<L>"
and just plucked out the 'L', ignoring the rest. However,
dynamic_emit_prefix() adds "[tid] module:func:line:" to the string,
those additions all got lost.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Cc: stable <stable@vger.kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index f338037a4f3d..cdd01c52c629 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -1865,6 +1865,7 @@ int __dev_printk(const char *level, const struct device *dev, | |||
1865 | struct va_format *vaf) | 1865 | struct va_format *vaf) |
1866 | { | 1866 | { |
1867 | char dict[128]; | 1867 | char dict[128]; |
1868 | const char *level_extra = ""; | ||
1868 | size_t dictlen = 0; | 1869 | size_t dictlen = 0; |
1869 | const char *subsys; | 1870 | const char *subsys; |
1870 | 1871 | ||
@@ -1911,10 +1912,14 @@ int __dev_printk(const char *level, const struct device *dev, | |||
1911 | "DEVICE=+%s:%s", subsys, dev_name(dev)); | 1912 | "DEVICE=+%s:%s", subsys, dev_name(dev)); |
1912 | } | 1913 | } |
1913 | skip: | 1914 | skip: |
1915 | if (level[3]) | ||
1916 | level_extra = &level[3]; /* skip past "<L>" */ | ||
1917 | |||
1914 | return printk_emit(0, level[1] - '0', | 1918 | return printk_emit(0, level[1] - '0', |
1915 | dictlen ? dict : NULL, dictlen, | 1919 | dictlen ? dict : NULL, dictlen, |
1916 | "%s %s: %pV", | 1920 | "%s %s: %s%pV", |
1917 | dev_driver_string(dev), dev_name(dev), vaf); | 1921 | dev_driver_string(dev), dev_name(dev), |
1922 | level_extra, vaf); | ||
1918 | } | 1923 | } |
1919 | EXPORT_SYMBOL(__dev_printk); | 1924 | EXPORT_SYMBOL(__dev_printk); |
1920 | 1925 | ||