forked from rubenslte/android_kernel_samsung_msm8226
vsprintf: Fix %ps on non symbols when using kallsyms
Using %ps in a printk format will sometimes fail silently and
print the empty string if the address passed in does not match a
symbol that kallsyms knows about. But using %pS will fall back to
printing the full address if kallsyms can't find the symbol. Make
%ps act the same as %pS by falling back to printing the address.
While we're here also make %ps print the module that a symbol
comes from so that it matches what %pS already does. Take this
simple function for example (in a module):
static void test_printk(void)
{
int test;
pr_info("with pS: %pS\n", &test);
pr_info("with ps: %ps\n", &test);
}
Before this patch:
with pS: 0xdff7df44
with ps:
After this patch:
with pS: 0xdff7df44
with ps: 0xdff7df44
Change-Id: Id03d74b079d40fe24b07a978909faedc741e281a
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
+1
-1
@@ -438,7 +438,7 @@ char *symbol_string(char *buf, char *end, void *ptr,
|
||||
else if (ext != 'f' && ext != 's')
|
||||
sprint_symbol(sym, value);
|
||||
else
|
||||
kallsyms_lookup(value, NULL, NULL, NULL, sym);
|
||||
sprint_symbol_no_offset(sym, value);
|
||||
|
||||
return string(buf, end, sym, spec);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user