* Can't find vprintk_safe in System.map
@ 2022-02-08 7:53 Chan Kim
0 siblings, 0 replies; only message in thread
From: Chan Kim @ 2022-02-08 7:53 UTC (permalink / raw)
To: kernelnewbies
[-- Attachment #1.1: Type: text/plain, Size: 1736 bytes --]
Hello all
I'm doing a experiment and found a strange phenomenon.
This is the vprintk_func( ) function defined in kernel/printk/printk_safe.c
(in linux 5.4.21, I'll update to recent version later, it's arm64).
__printf(1, 0) int vprintk_func(const char *fmt, va_list args)
{
/*
* Try to use the main logbuf even in NMI. But avoid calling console
* drivers that might have their own locks.
*/
if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK) &&
raw_spin_trylock(&logbuf_lock)) {
int len;
len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, 0, fmt, args);
raw_spin_unlock(&logbuf_lock);
defer_console_output();
return len;
}
/* Use extra buffer in NMI when logbuf_lock is taken or in safe mode. */
if (this_cpu_read(printk_context) & PRINTK_NMI_CONTEXT_MASK)
return vprintk_nmi(fmt, args);
/* Use extra buffer to prevent a recursion deadlock in safe mode. */
if (this_cpu_read(printk_context) & PRINTK_SAFE_CONTEXT_MASK)
return vprintk_safe(fmt, args);
/* No obstacles. */
return vprintk_default(fmt, args);
}
In qemu test, it passes all the printk_context check and enters
vprintk_default( ) funciton but in our FPGA board (with only 8MB ram instead
of DDR),
by writing debug information to some variables, I found the program seems to
enter vprintk_safe( ) function and stuck somewhere inside.
But when I examine the System.map file, I cannot find the vprintk_safe
function and vprintk_nmi (I can find vprintk_default). I'm curious if this
may be related to the malfunction.
How can this happen? And how should I understand this?
Thank you!
Chan Kim
[-- Attachment #1.2: Type: text/html, Size: 7831 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-08 7:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08 7:53 Can't find vprintk_safe in System.map Chan Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).