| Function report | 
| Source Code: kernel\debug\kdb\kdb_io.c | Create Date:2022-07-28 11:39:59 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:vkdb_printf
Proto:int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| enum kdb_msgsrc | src | |
| const char * | fmt | |
| va_list | ap | 
| 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 = smp_processor_id() | 
| 565 | cycle | 
| 566 | old_cpu = cmpxchg( & kdb_printf_cpu, - 1, this_cpu) | 
| 570 | cpu_relax() | 
| 573 | diag = kdbgetintenv("LINES", & linecount) | 
| 577 | diag = kdbgetintenv("COLUMNS", & colcount) | 
| 581 | diag = kdbgetintenv("LOGGING", & logging) | 
| 585 | If Not Miscellaneous functions and data areas || suspend_grep Then | 
| 588 | size_avail = size of A bit too big to go on stack | 
| 601 | If Not suspend_grep && Miscellaneous functions and data areas Then | 
| 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 | If Not cp Then | 
| 617 | If next_avail == A bit too big to go on stack Then | 
| 625 | If Not strncmp(cp2, kdb_prompt_str, len) Then | 
| 632 | Go to kdb_printit | 
| 639 | size_avail = size of A bit too big to go on stack - len | 
| 640 | Go to kdb_print_out | 
| 647 | cp++ | 
| 648 | replaced_byte = 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 | If Not fnd Then | 
| 665 | cphold = replaced_byte | 
| 669 | size_avail = size of A bit too big to go on stack - len | 
| 670 | Go to kdb_print_out | 
| 683 | kdb_printit : | 
| 690 | If Not Use kdb or gdbserver mode && kgdb_connected - Is a host GDB connected to us? Then | 
| 691 | gdbstub_msg_write(cp, retlen - (cp - A bit too big to go on stack )) | 
| 692 | Else | 
| 693 | If dbg_io_ops && Not is_console Then | 
| 694 | len = retlen - cp - A bit too big to go on stack | 
| 697 | write_char( * cp2) | 
| 698 | cp2++ | 
| 707 | If logging Then | 
| 712 | Else pr_info("%s", A bit too big to go on stack ) | 
| 722 | got = 0 | 
| 725 | If A bit too big to go on stack [len] == '\n' Then | 
| 727 | got = 0 | 
| 728 | Else if A bit too big to go on stack [len] == '\r' Then | 
| 729 | got = 0 | 
| 730 | Else | 
| 731 | got++ | 
| 734 | Current number of lines displayed += got / (colcount + 1) | 
| 738 | If Current number of lines displayed >= linecount Then | 
| 750 | moreprompt = kdbgetenv("MOREPROMPT") | 
| 751 | If (moreprompt == NULL) Then moreprompt = "more> " | 
| 755 | c = console_drivers | 
| 757 | If dbg_io_ops && Not is_console Then | 
| 759 | cp = moreprompt | 
| 761 | write_char( * cp) | 
| 762 | cp++ | 
| 778 | A bit too big to go on stack [0] = '\0' | 
| 780 | size_avail = size of A bit too big to go on stack | 
| 784 | KDB_STATE_CLEAR(PAGER) | 
| 787 | kdb_printf("\n") | 
| 788 | Else if ch == ' ' Then | 
| 789 | kdb_printf("\r") | 
| 790 | suspend_grep = 1 | 
| 795 | Else if ch == '/' && Not Miscellaneous functions and data areas Then | 
| 796 | kdb_printf("\r") | 
| 801 | suspend_grep = 1 | 
| 802 | Else if ch Then | 
| 804 | suspend_grep = 1 | 
| 805 | If ch != '/' Then kdb_printf("\nOnly 'q', 'Q' or '/' are processed at more prompt, input ignored\n") | 
| 809 | Else kdb_printf("\n'/' cannot be used during | grep filtering, input ignored\n") | 
| 812 | Else if Miscellaneous functions and data areas Then | 
| 814 | suspend_grep = 1 | 
| 815 | kdb_printf("\n") | 
| 826 | If Miscellaneous functions and data areas && Not suspend_grep Then | 
| 827 | cphold = replaced_byte | 
| 831 | size_avail = size of A bit too big to go on stack - len | 
| 834 | kdb_print_out : | 
| 835 | suspend_grep = 0 | 
| 836 | If logging Then console_loglevel = saved_loglevel | 
| 839 | smp_store_release( & kdb_printf_cpu, old_cpu) | 
| 840 | local_irq_restore(flags) | 
| 841 | Return retlen | 
| Name | Describe | 
|---|---|
| kdb_printf | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |