函数逻辑报告 |
Source Code:kernel\debug\debug_core.c |
Create Date:2022-07-27 12:41:50 |
| Last Modify:2020-03-17 19:04:10 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:kgdb_cpu_enter
函数原型:static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, int exception_state)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct kgdb_state * | ks | |
| struct pt_regs * | regs | |
| int | exception_state |
| 560 | sstep_tries等于100 |
| 563 | trace_on等于0 |
| 564 | online_cpus等于num_online_cpus() |
| 567 | enter_kgdb自加 |
| 570 | 如果exception_state恒等于Waiting to become a master kgdb cpu 则atomic_inc( & We use NR_CPUs not PERCPU, in case kgdb is used to debug early* bootup code (which might not have percpu set up yet):) |
| 572 | 否则atomic_inc( & slaves_in_kgdb) |
| 575 | 如果disable_hw_break则disable_hw_break(regs) |
| 578 | acquirelock : |
| 583 | local_irq_save(flags) |
| 586 | debuggerinfo等于regs |
| 588 | ret_state等于0 |
| 589 | irq_depth等于hardirq_count()右移HARDIRQ_SHIFT位 |
| 592 | smp_mb() |
| 594 | 如果Guard for recursive entry 恒等于1则 |
| 597 | 转到:cpu_master_loop |
| 604 | 当1循环 |
| 605 | cpu_loop : |
| 608 | 转到:cpu_master_loop |
| 609 | 否则如果exception_state按位与Waiting to become a master kgdb cpu 则 |
| 612 | 退出 |
| 615 | dump_stack() |
| 617 | 否则如果exception_state按位与Slave cpu enter exception 则 |
| 618 | 如果非raw_spin_is_locked( & dbg_slave_lock)则转到:return_normal |
| 620 | 否则 |
| 621 | return_normal : |
| 625 | 如果correct_hw_break则correct_hw_break() |
| 627 | 如果trace_on则tracing_on() |
| 629 | debuggerinfo = NULL |
| 630 | task = NULL |
| 633 | enter_kgdb自减 |
| 634 | smp_mb__before_atomic() |
| 635 | atomic_dec( & slaves_in_kgdb) |
| 636 | dbg_touch_watchdogs() |
| 637 | local_irq_restore(flags) |
| 638 | 返回:0 |
| 640 | cpu_relax() |
| 649 | 如果atomic_read( & keep track of the CPU which is doing the single stepping)不等于负1且task且进程ID不等于kgdb_sstep_pid且sstep_tries先自减则 |
| 652 | atomic_set( & The CPU# of the active CPU, or -1 if none:, - 1) |
| 653 | raw_spin_unlock( & dbg_master_lock) |
| 654 | dbg_touch_watchdogs() |
| 655 | local_irq_restore(flags) |
| 657 | 转到:acquirelock |
| 661 | ret_state等于1 |
| 662 | 转到:kgdb_restore |
| 672 | 如果pre_exception则pre_exception() |
| 679 | 如果非kgdb_single_step则raw_spin_lock( & dbg_slave_lock) |
| 699 | 0x10c7 is 2**32 / 1000000 (rounded up) (1000) |
| 708 | kgdb_single_step等于0 |
| 709 | kgdb_contthread等于当前进程 |
| 710 | Guard for recursive entry 等于0 |
| 711 | trace_on等于tracing_is_on() |
| 712 | 如果trace_on则tracing_off() |
| 715 | 当1循环 |
| 716 | cpu_master_loop : |
| 717 | 如果Use kdb or gdbserver mode 则 |
| 720 | 如果error恒等于负1则继续下一循环 |
| 723 | 否则 |
| 729 | 否则如果error恒等于Switch from one cpu to another 则 |
| 733 | 否则 |
| 740 | 如果post_exception则post_exception() |
| 743 | 如果非kgdb_single_step则 |
| 744 | raw_spin_unlock( & dbg_slave_lock) |
| 747 | cpu_relax() |
| 750 | kgdb_restore : |
| 751 | 如果atomic_read( & keep track of the CPU which is doing the single stepping)不等于负1则 |
| 753 | 如果task则kgdb_sstep_pid等于进程ID |
| 755 | 否则kgdb_sstep_pid等于0 |
| 758 | 如果correct_hw_break则correct_hw_break() |
| 760 | 如果trace_on则tracing_on() |
| 763 | debuggerinfo = NULL |
| 764 | task = NULL |
| 767 | enter_kgdb自减 |
| 768 | smp_mb__before_atomic() |
| 769 | atomic_dec( & We use NR_CPUs not PERCPU, in case kgdb is used to debug early* bootup code (which might not have percpu set up yet):) |
| 771 | atomic_set( & The CPU# of the active CPU, or -1 if none:, - 1) |
| 772 | raw_spin_unlock( & dbg_master_lock) |
| 773 | dbg_touch_watchdogs() |
| 774 | local_irq_restore(flags) |
| 776 | 返回:ret_state |
| 名称 | 描述 |
|---|---|
| kgdb_handle_exception | kgdb_handle_exception() - main entry point from a kernel exception* Locking hierarchy:* interface locks, if any (begin_session)* kgdb lock (kgdb_active) |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |