函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:vkdb_printf

函数原型:int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap)

返回类型:int

参数:

类型参数名称
enum kdb_msgsrcsrc
const char *fmt
va_listap
550  saved_loglevel等于0
551  retlen等于0
554  cphold等于NULL, replaced_byte等于' '
555  moreprompt等于"more> "
556  c等于console_drivers
557  flags等于prefix, newline flags
563  local_irq_save(flags)
564  this_cpu等于当前cpu ID()
565  循环
566  old_cpu等于cmpxchg( & kdb_printf_cpu, - 1, this_cpu)
567  如果old_cpu恒等于负1或old_cpu恒等于this_cpu退出
570  cpu_relax()
573  diag等于kdbgetintenv("LINES", & linecount)
574  如果diaglinecount小于等于1则linecount等于24
577  diag等于kdbgetintenv("COLUMNS", & colcount)
578  如果diagcolcount小于等于1则colcount等于80
581  diag等于kdbgetintenv("LOGGING", & logging)
582  如果diaglogging等于0
585  如果非Miscellaneous functions and data areas suspend_grep
587  next_avail等于A bit too big to go on stack
588  size_avail等于A bit too big to go on stack 的长度
590  vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally
601  如果非suspend_grepMiscellaneous functions and data areas
602  cp等于strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
603  如果非cp
617  如果next_avail恒等于A bit too big to go on stack
640  转到:kdb_print_out
647  cp自加
648  replaced_byte等于cp
649  cphold等于cp
650  cp等于'\0'
657  fnd等于search arg1 to see if it contains arg2* (kdmain.c provides flags for ^pat and pat$)* return 1 for found, 0 for not found
658  如果非fnd
665  cphold等于replaced_byte
670  转到:kdb_print_out
672  如果Miscellaneous functions and data areas 大于等于KDB_GREPPING_FLAG_SEARCHMiscellaneous functions and data areas 等于0
683  kdb_printit :
688  retlen等于strlen - Find the length of a string*@s: The string to be sized
689  cp等于printk_skip_headers(A bit too big to go on stack )
690  如果非Use kdb or gdbserver mode kgdb_connected - Is a host GDB connected to us?
691  gdbstub_msg_write(cp, retlen - (cp - A bit too big to go on stack ))
692  否则
693  如果dbg_io_ops且非is_console
695  cp2等于cp
696 len自减循环
697  write_char( * cp2)
698  cp2自加
701 c循环
704  c等于next
707  如果logging
708  saved_loglevel等于console_loglevel
709  console_loglevel等于Mum's the word
710  如果printk_get_level(A bit too big to go on stack )或src恒等于 trapped from printk() printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
712  否则打印信息("%s", A bit too big to go on stack )
716  如果KDB_STATE(PAGER)则
722  got等于0
723  len等于retlen
724 len自减循环
725  如果A bit too big to go on stack [len]恒等于'\n'则
727  got等于0
728  否则如果A bit too big to go on stack [len]恒等于'\r'则
729  got等于0
730  否则
731  got自加
734  Current number of lines displayed 加等于gotcolcount加1的和
738  如果Current number of lines displayed 大于等于linecount
745  Current number of lines displayed 等于1
750  moreprompt等于kdbgetenv("MOREPROMPT")
751  如果(moreprompt == NULL)则moreprompt等于"more> "
754  kdb_input_flush* Get rid of any buffered console input
755  c等于console_drivers
757  如果dbg_io_ops且非is_console
759  cp等于moreprompt
760 len自减循环
761  write_char( * cp)
762  cp自加
765 c循环
768  c等于next
771  如果loggingprintk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
774  ch等于kdb_getchar() - Read a single character from a kdb console (or consoles)
775  Current number of lines displayed 等于1
778  A bit too big to go on stack [0]等于'\0'
779  next_avail等于A bit too big to go on stack
780  size_avail等于A bit too big to go on stack 的长度
781  如果ch恒等于'q'或ch恒等于'Q'则
787  kdb_printf("\n")
788  否则如果ch恒等于' '则
789  kdb_printf("\r")
790  suspend_grep等于1
791  否则如果ch恒等于'\n'或ch恒等于'\r'则
793  kdb_printf("\r")
794  suspend_grep等于1
795  否则如果ch恒等于'/'且非Miscellaneous functions and data areas
796  kdb_printf("\r")
801  suspend_grep等于1
802  否则如果ch
804  suspend_grep等于1
805  如果ch不等于'/'则kdb_printf("\nOnly 'q', 'Q' or '/' are processed at more prompt, input ignored\n")
809  否则kdb_printf("\n'/' cannot be used during | grep filtering, input ignored\n")
814  suspend_grep等于1
815  kdb_printf("\n")
817  kdb_input_flush* Get rid of any buffered console input
826  如果Miscellaneous functions and data areas 且非suspend_grep
827  cphold等于replaced_byte
828  strcpy(A bit too big to go on stack , cphold)
829  len等于strlen - Find the length of a string*@s: The string to be sized
830  next_avail等于A bit too big to go on stack len
831  size_avail等于A bit too big to go on stack 的长度减len
834  kdb_print_out :
835  suspend_grep等于0
836  如果loggingconsole_loglevel等于saved_loglevel
839  smp_store_release( & kdb_printf_cpu, old_cpu)
840  local_irq_restore(flags)
841  返回:retlen
调用者
名称描述
kdb_printf
vprintk_default