函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\printk\printk.c Create Date:2022-07-27 11:07:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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()

函数原型:void console_unlock(void)

返回类型:void

参数:

2374  如果This is used for debugging the mess that is the VT code by* keeping track if we have the console semaphore held
2375  up_console_sem()
2376  返回
2393  do_cond_resched等于Flag: console code may call schedule()
2394  again :
2395  Flag: console code may call schedule() 等于0
2402  如果非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.
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  返回
2408  循环
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.)
2416  len等于输出格式化串
2423  否则
2424  len等于0
2426  :
2427  如果he next printk record to write to the console 恒等于dex and sequence number of the next record to store in the buffer 退出
2430  msg等于get record by index; idx must point to valid msg
2439  转到:skip
2448  len加等于msg_print_text(msg, console_msg_format & MSG_FORMAT_SYSLOG, printk_time, text + len, 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  返回
2481  printk_safe_exit_irqrestore(flags)
2483  如果do_cond_reschedcond_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  如果retrysole_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.则转到:again
调用者
名称描述
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