Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\printk\printk.c Create Date:2022-07-28 10:06:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sole_unlock - unlock the console system* Releases the console_lock which the caller holds on the console system* and the console driver list.* While the console_lock was held, console output may have been buffered* by printk()

Proto:void console_unlock(void)

Type:void

Parameter:Nothing

2374  If This is used for debugging the mess that is the VT code by* keeping track if we have the console semaphore held Then
2375  up_console_sem()
2376  Return
2393  do_cond_resched = Flag: console code may call schedule()
2394  again :
2395  Flag: console code may call schedule() = 0
2402  If Not Can we actually use the console at this time on this cpu?* Console drivers may assume that per-cpu resources have been allocated. So* unless they're explicitly marked as being able to cope (CON_ANYTIME) don't* call them until this CPU is officially up. Then
2403  This is used for debugging the mess that is the VT code by* keeping track if we have the console semaphore held = 0
2404  up_console_sem()
2405  Return
2408  cycle
2410  ext_len = 0
2413  printk_safe_enter_irqsave(flags)
2414  raw_spin_lock( & The logbuf_lock protects kmsg buffer, indices, counters. This can be taken* within the scheduler's rq lock. It must be released before calling* console_unlock() or anything else that might wake up a process.)
2423  Else
2424  len = 0
2426  :
2427  If he next printk record to write to the console == dex and sequence number of the next record to store in the buffer Then Break
2430  msg = get record by index; idx must point to valid msg
2439  Go to skip
2448  len += msg_print_text(msg, console_msg_format & MSG_FORMAT_SYSLOG, printk_time, text + len, size of text - len)
2460  console_idx = get next record; idx must point to valid msg
2461  he next printk record to write to the console ++
2462  raw_spin_unlock( & The logbuf_lock protects kmsg buffer, indices, counters. This can be taken* within the scheduler's rq lock. It must be released before calling* console_unlock() or anything else that might wake up a process.)
2470  sole_lock_spinning_enable - mark beginning of code where another* thread might safely busy wait* This basically converts console_lock into a spinlock. This marks* the section where the console_lock owner can not sleep, because
2472  stop_critical_timings()
2473  Call the console drivers, asking them to write out* log_buf[start] to log_buf[end - 1].* The console_lock must be held.
2474  start_critical_timings()
2478  Return
2481  printk_safe_exit_irqrestore(flags)
2483  If do_cond_resched Then cond_resched()
2487  This is used for debugging the mess that is the VT code by* keeping track if we have the console semaphore held = 0
2489  raw_spin_unlock( & The logbuf_lock protects kmsg buffer, indices, counters. This can be taken* within the scheduler's rq lock. It must be released before calling* console_unlock() or anything else that might wake up a process.)
2491  up_console_sem()
2499  raw_spin_lock( & The logbuf_lock protects kmsg buffer, indices, counters. This can be taken* within the scheduler's rq lock. It must be released before calling* console_unlock() or anything else that might wake up a process.)
2500  retry = he next printk record to write to the console != dex and sequence number of the next record to store in the buffer
2501  raw_spin_unlock( & The logbuf_lock protects kmsg buffer, indices, counters. This can be taken* within the scheduler's rq lock. It must be released before calling* console_unlock() or anything else that might wake up a process.)
2502  printk_safe_exit_irqrestore(flags)
2504  If retry && sole_trylock - try to lock the console system for exclusive use.* Try to acquire a lock which guarantees that the caller has exclusive* access to the console system and the console_drivers list.* returns 1 on success, and 0 on failure to acquire the lock. Then Go to again
Caller
NameDescribe
vprintk_emit
resume_console
console_cpu_notifysole_cpu_notify - print deferred console messages after CPU hotplug*@cpu: unused* If printk() is called from a CPU that is not online yet, the messages* will be printed on the console only if there are CON_ANYTIME consoles
console_unblank
console_flush_on_panicsole_flush_on_panic - flush console content on panic*@mode: flush all messages in buffer or just the pending ones* Immediately output all pending messages no matter what.
console_deviceReturn the console tty driver structure and its associated index
console_stopPrevent further output on the passed console device so that (for example)* serial drivers can disable console output before suspending a port, and can* re-enable output afterwards.
console_start
register_consoleThe console driver calls this routine during kernel initialization* to register the console printing procedure with printk() and to* print any messages that were printed by the kernel before the* console driver was initialized
unregister_console
wake_up_klogd_work_func