自学内容网 自学内容网

【Linux】内核调用栈打印函数dump_stack使用效果

 init/main.c的start_kernel示例,这个调用栈不太深:

 /var/log/dmesg日志:

[    0.000000] kernel: [init/main.c start_kernel 911] start_kernel(void)
[    0.000000] kernel: [kernel/panic.c print_tainted 519 LOG_TIMES: 1 ]  
[    0.000000] kernel: CPU: 0 PID: 0 Comm: swapper Not tainted 6.9.0+ #3
[    0.000000] kernel: Call Trace:
[    0.000000] kernel:  <TASK>
[    0.000000] kernel:  dump_stack_lvl+0x76/0xa0
[    0.000000] kernel:  dump_stack+0x10/0x20
[    0.000000] kernel:  start_kernel+0x51/0x1780
[    0.000000] kernel:  x86_64_start_reservations+0x18/0x30
[    0.000000] kernel:  x86_64_start_kernel+0xbf/0x110
[    0.000000] kernel:  common_startup_64+0x13e/0x141
[    0.000000] kernel:  </TASK>

这是网卡驱动发送数据的函数,调用栈比较深:


[   20.288274] kernel: [kernel/sched/core.c wake_up_new_task 4974]  pid: 1325 exe name: (udev-worker) 
[   20.294028] kernel: [net/ipv4/udp.c udp_send_skb 913]  
[   20.294037] kernel: [net/ipv4/ip_output.c ip_send_skb 1520]  
[   20.294042] kernel: [net/ipv4/ip_output.c ip_local_out 131] 1
[   20.294046] kernel: [net/ipv4/ip_output.c __ip_local_out 107] 1
[   20.294072] kernel: [include/linux/netdevice.h dev_queue_xmit 3092]  
[   20.294078] kernel: [net/core/dev.c __dev_queue_xmit 4378]  
[   20.294083] kernel: [net/core/dev.c __dev_xmit_skb 3855]  
[   20.294088] kernel: [net/sched/sch_generic.c sch_direct_xmit 322]  
[   20.294094] kernel: [net/core/dev.c dev_hard_start_xmit 3648]  
[   20.294098] kernel: [net/core/dev.c xmit_one 3631]  
[   20.294102] kernel: [include/linux/netdevice.h netdev_start_xmit 4922]  
[   20.294107] kernel: [include/linux/netdevice.h __netdev_start_xmit 4905] ops->ndo_start_xmit(skb, dev);
[   20.294112] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3200]  
[   20.294118] kernel: CPU: 2 PID: 748 Comm: avahi-daemon Not tainted 6.9.0+ #3
[   20.294126] kernel: Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[   20.294131] kernel: Call Trace:
[   20.294136] kernel:  <TASK>
[   20.294143] kernel:  dump_stack_lvl+0x76/0xa0
[   20.294159] kernel:  dump_stack+0x10/0x20
[   20.294171] kernel:  e1000_xmit_frame+0x53/0x1ba0 [e1000]
[   20.294230] kernel:  ? vprintk_default+0x1d/0x30
[   20.294240] kernel:  ? vprintk+0x41/0x80
[   20.294250] kernel:  ? _printk+0x60/0x90
[   20.294266] kernel:  netdev_start_xmit+0xdd/0x340
[   20.294280] kernel:  dev_hard_start_xmit+0x9a/0x450
[   20.294293] kernel:  sch_direct_xmit+0xea/0x450
[   20.294307] kernel:  __dev_queue_xmit+0xb40/0x1090
[   20.294320] kernel:  ? _printk+0x60/0x90
[   20.294335] kernel:  ip_finish_output2+0x35d/0x810
[   20.294347] kernel:  __ip_finish_output+0xd9/0x280
[   20.294356] kernel:  ? dev_loopback_xmit+0xb7/0x250
[   20.294366] kernel:  ip_finish_output+0x60/0x280
[   20.294455] kernel:  ip_mc_output+0xb7/0x420
[   20.294465] kernel:  ? __pfx_ip_finish_output+0x10/0x10
[   20.294475] kernel:  ip_local_out+0x1e2/0x1f0
[   20.294485] kernel:  ip_send_skb+0x77/0x1e0
[   20.294494] kernel:  udp_send_skb+0x1a4/0x4d0
[   20.294507] kernel:  udp_sendmsg+0xc25/0x1060
[   20.294520] kernel:  ? __pfx_ip_generic_getfrag+0x10/0x10
[   20.294542] kernel:  inet_sendmsg+0x180/0x1f0
[   20.294550] kernel:  ? inet_sendmsg+0x180/0x1f0
[   20.294620] kernel:  sock_sendmsg_nosec+0x18e/0x220
[   20.294633] kernel:  ____sys_sendmsg+0x356/0x470
[   20.294649] kernel: [kernel/fork.c __do_sys_set_tid_address 1979]  
[   20.294650] kernel:  ___sys_sendmsg+0x164/0x5c0
[   20.294676] kernel:  __sys_sendmsg+0x89/0xf0
[   20.294686] kernel:  ? __sys_sendmsg+0x89/0xf0
[   20.294704] kernel:  __x64_sys_sendmsg+0x5a/0x180
[   20.294715] kernel:  x64_sys_call+0x25e/0x25c0
[   20.294725] kernel:  do_syscall_64+0x7e/0x180
[   20.294734] kernel:  ? aa_file_perm+0x140/0x570
[   20.294750] kernel:  ? inode_needs_update_time+0x4b/0xd0
[   20.294761] kernel:  ? file_update_time+0x1d/0x90
[   20.294770] kernel:  ? pipe_write+0x472/0x6b0
[   20.294783] kernel:  ? security_file_permission+0x36/0x60
[   20.294797] kernel:  ? vfs_write+0x2d1/0x6d0
[   20.294815] kernel:  ? ksys_write+0xc9/0x100
[   20.294828] kernel:  ? syscall_exit_to_user_mode+0x72/0x360
[   20.294841] kernel:  ? do_syscall_64+0x8b/0x180
[   20.294852] kernel:  ? restore_fpregs_from_fpstate+0x47/0xf0
[   20.294865] kernel:  ? switch_fpu_return+0x50/0xe0
[   20.294946] kernel:  ? syscall_exit_to_user_mode+0x72/0x360
[   20.294959] kernel:  ? do_syscall_64+0x8b/0x180
[   20.294969] kernel:  ? syscall_exit_to_user_mode+0x72/0x360
[   20.294982] kernel:  ? do_syscall_64+0x8b/0x180
[   20.294990] kernel:  ? ksys_write+0xc9/0x100
[   20.295003] kernel:  ? syscall_exit_to_user_mode+0x72/0x360
[   20.295016] kernel:  ? do_syscall_64+0x8b/0x180
[   20.295026] kernel:  ? do_syscall_64+0x8b/0x180
[   20.295036] kernel:  ? clear_bhb_loop+0x15/0x70
[   20.295047] kernel:  ? clear_bhb_loop+0x15/0x70
[   20.295057] kernel:  ? clear_bhb_loop+0x15/0x70
[   20.295070] kernel:  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   20.295080] kernel: RIP: 0033:0x796376b2c004
[   20.295087] kernel: Code: 15 19 6e 0d 00 f7 d8 64 89 02 b8 ff ff ff ff eb bf 0f 1f 44 00 00 f3 0f 1e fa 80 3d 45 f0 0d 00 00 74 13 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 4c c3 0f 1f 00 55 48 89 e5 48 83 ec 20 89 55
[   20.295094] kernel: RSP: 002b:00007ffcbf149758 EFLAGS: 00000202 ORIG_RAX: 000000000000002e
[   20.295102] kernel: RAX: ffffffffffffffda RBX: 00006032333d86a0 RCX: 0000796376b2c004
[   20.295107] kernel: RDX: 0000000000000000 RSI: 00007ffcbf149830 RDI: 000000000000000c
[   20.295112] kernel: RBP: 00007ffcbf1497d0 R08: 0000000000000004 R09: 0000000000000019
[   20.295117] kernel: R10: 0000796376ec1259 R11: 0000000000000202 R12: 000000000000000c
[   20.295122] kernel: R13: 00007ffcbf149830 R14: 00006032333c405c R15: 000000000000000c
[   20.295136] kernel:  </TASK>
[   20.295311] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202] [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202]  ens33
[   20.295320] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3217] name: ens33
[   20.295326] kernel: [include/linux/etherdevice.h eth_skb_pad 645]  
[   20.295330] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_tso 2790]  
[   20.295335] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_tx_csum 2866]  
[   20.295340] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_tx_map 2928]  
[   20.295348] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_tx_queue 3073]  
[   20.295662] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_clean 3923] NAPI Rx polling callback
[   20.295669] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_clean_tx_irq2 3963] Reclaim resources after transmit completes
[   20.295678] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_clean_tx_irq2 4062] netdev->stats.tx_packets: 32, netdev->stats.tx_bytes: 3451
[   20.295679] kernel: [kernel/fork.c kernel_clone 2821]  args->name: (null)
[   20.295687] kernel: [kernel/fork.c copy_process 2185]  

[   21.737604] kernel: [include/linux/netdevice.h dev_queue_xmit 3092]  
[   21.737610] kernel: [net/core/dev.c __dev_queue_xmit 4378]  
[   21.737615] kernel: [net/core/dev.c __dev_xmit_skb 3855]  
[   21.737619] kernel: [net/sched/sch_generic.c sch_direct_xmit 322]  
[   21.737623] kernel: [net/core/dev.c dev_hard_start_xmit 3648]  
[   21.737627] kernel: [net/core/dev.c xmit_one 3631]  
[   21.737697] kernel: [include/linux/netdevice.h netdev_start_xmit 4922]  
[   21.737700] kernel: [include/linux/netdevice.h __netdev_start_xmit 4905] ops->ndo_start_xmit(skb, dev);
[   21.737704] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3200]  
[   21.737708] kernel: CPU: 0 PID: 748 Comm: avahi-daemon Not tainted 6.9.0+ #3
[   21.737714] kernel: Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[   21.737718] kernel: Call Trace:
[   21.737721] kernel:  <TASK>
[   21.737726] kernel:  dump_stack_lvl+0x76/0xa0
[   21.737738] kernel:  dump_stack+0x10/0x20
[   21.737749] kernel:  e1000_xmit_frame+0x53/0x1ba0 [e1000]
[   21.737877] kernel:  ? vprintk_default+0x1d/0x30
[   21.737885] kernel:  ? vprintk+0x41/0x80
[   21.737893] kernel:  ? _printk+0x60/0x90
[   21.737906] kernel:  netdev_start_xmit+0xdd/0x340
[   21.737917] kernel:  dev_hard_start_xmit+0x9a/0x450
[   21.737927] kernel:  sch_direct_xmit+0xea/0x450
[   21.737938] kernel:  __dev_queue_xmit+0xb40/0x1090
[   21.737947] kernel:  ? _printk+0x60/0x90
[   21.737960] kernel:  ip6_finish_output2+0x386/0x9a0
[   21.737971] kernel:  ? __pfx_dev_loopback_xmit+0x10/0x10
[   21.737979] kernel:  ip6_finish_output+0xe0/0x4b0
[   21.737988] kernel:  ? nf_hook_slow+0x7d/0x280
[   21.737998] kernel:  ip6_output+0xb8/0x2b0
[   21.738008] kernel:  ? __pfx_ip6_finish_output+0x10/0x10
[   21.738018] kernel:  ip6_local_out+0x7f/0x1c0
[   21.738026] kernel:  ip6_send_skb+0x5f/0x1e0
[   21.738035] kernel:  udp_v6_send_skb+0x20f/0x580
[   21.738047] kernel:  udpv6_sendmsg+0xd15/0x1070
[   21.738057] kernel:  ? __pfx_ip_generic_getfrag+0x10/0x10
[   21.738079] kernel:  inet6_sendmsg+0x180/0x1f0
[   21.738086] kernel:  ? inet6_sendmsg+0x180/0x1f0
[   21.738094] kernel:  sock_sendmsg_nosec+0x69/0x220
[   21.738103] kernel:  ____sys_sendmsg+0x356/0x470
[   21.738116] kernel:  ___sys_sendmsg+0x164/0x5c0
[   21.738182] kernel:  ? inode_needs_update_time+0x4b/0xd0
[   21.738197] kernel:  __sys_sendmsg+0x89/0xf0
[   21.738203] kernel:  ? __sys_sendmsg+0x89/0xf0
[   21.738216] kernel:  __x64_sys_sendmsg+0x5a/0x180
[   21.738223] kernel:  x64_sys_call+0x25e/0x25c0
[   21.738230] kernel:  do_syscall_64+0x7e/0x180
[   21.738237] kernel:  ? syscall_exit_to_user_mode+0x72/0x360
[   21.738247] kernel:  ? do_syscall_64+0x8b/0x180
[   21.738253] kernel:  ? do_syscall_64+0x8b/0x180
[   21.738261] kernel:  ? ksys_write+0xc9/0x100
[   21.738271] kernel:  ? syscall_exit_to_user_mode+0x72/0x360
[   21.738280] kernel:  ? do_syscall_64+0x8b/0x180
[   21.738286] kernel:  ? do_syscall_64+0x8b/0x180
[   21.738293] kernel:  ? clear_bhb_loop+0x15/0x70
[   21.738301] kernel:  ? clear_bhb_loop+0x15/0x70
[   21.738308] kernel:  ? clear_bhb_loop+0x15/0x70
[   21.738318] kernel:  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   21.738325] kernel: RIP: 0033:0x796376b2c004
[   21.738330] kernel: Code: 15 19 6e 0d 00 f7 d8 64 89 02 b8 ff ff ff ff eb bf 0f 1f 44 00 00 f3 0f 1e fa 80 3d 45 f0 0d 00 00 74 13 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 4c c3 0f 1f 00 55 48 89 e5 48 83 ec 20 89 55
[   21.738335] kernel: RSP: 002b:00007ffcbf149758 EFLAGS: 00000202 ORIG_RAX: 000000000000002e
[   21.738340] kernel: RAX: ffffffffffffffda RBX: 00006032333d9da0 RCX: 0000796376b2c004
[   21.738345] kernel: RDX: 0000000000000000 RSI: 00007ffcbf149830 RDI: 000000000000000d
[   21.738348] kernel: RBP: 00007ffcbf1497d0 R08: 0000796376ec1260 R09: 00007ffcbf149792
[   21.738352] kernel: R10: 0000000000000001 R11: 0000000000000202 R12: 000000000000000d
[   21.738356] kernel: R13: 00007ffcbf149830 R14: 00006032333d5d5c R15: 000000000000000d
[   21.738367] kernel:  </TASK>
[   21.738369] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202] [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202]  ens33
[   21.738375] kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3217] name: ens33

 
2024-11-15T22:17:33.588491+08:00 a kernel: [net/ipv4/tcp_output.c tcp_send_ack 4321] source ip: 192.168.16.132: 80, dest ip: 101.6.15.130: 80, family: 2,  state: 1
2024-11-15T22:17:33.588492+08:00 a kernel: [net/ipv4/tcp_output.c __tcp_transmit_skb 1460] source ip: 192.168.16.132: 80, dest ip: 101.6.15.130: 80, family: 2,  state: 1
2024-11-15T22:17:33.588494+08:00 a kernel: [net/ipv4/tcp_output.c tcp_event_ack_sent 192] source ip: 192.168.16.132: 80, dest ip: 101.6.15.130: 80, family: 2,  state: 1
2024-11-15T22:17:33.588495+08:00 a kernel: [net/ipv4/ip_output.c ip_local_out 131] 1
2024-11-15T22:17:33.588497+08:00 a kernel: [net/ipv4/ip_output.c __ip_local_out 107] 1
2024-11-15T22:17:33.588498+08:00 a kernel: [include/linux/netdevice.h dev_queue_xmit 3092]  
2024-11-15T22:17:33.588500+08:00 a kernel: [net/core/dev.c __dev_queue_xmit 4378]  
2024-11-15T22:17:33.588501+08:00 a kernel: [net/core/dev.c __dev_xmit_skb 3855]  
2024-11-15T22:17:33.588503+08:00 a kernel: [net/sched/sch_generic.c sch_direct_xmit 322]  
2024-11-15T22:17:33.588504+08:00 a kernel: [net/core/dev.c dev_hard_start_xmit 3648]  
2024-11-15T22:17:33.588506+08:00 a kernel: [net/core/dev.c xmit_one 3631]  
2024-11-15T22:17:33.588507+08:00 a kernel: [include/linux/netdevice.h netdev_start_xmit 4922]  
2024-11-15T22:17:33.588509+08:00 a kernel: [include/linux/netdevice.h __netdev_start_xmit 4905] ops->ndo_start_xmit(skb, dev);
2024-11-15T22:17:33.588510+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3200]  
2024-11-15T22:17:33.588512+08:00 a kernel: CPU: 2 PID: 2306 Comm: gnome-terminal- Not tainted 6.9.0+ #3
2024-11-15T22:17:33.588513+08:00 a kernel: Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
2024-11-15T22:17:33.588515+08:00 a kernel: Call Trace:
2024-11-15T22:17:33.588516+08:00 a kernel:  <TASK>
2024-11-15T22:17:33.588518+08:00 a kernel:  dump_stack_lvl+0x76/0xa0
2024-11-15T22:17:33.588519+08:00 a kernel:  dump_stack+0x10/0x20
2024-11-15T22:17:33.588521+08:00 a kernel:  e1000_xmit_frame+0x53/0x1ba0 [e1000]
2024-11-15T22:17:33.588691+08:00 a kernel:  ? vprintk_default+0x1d/0x30
2024-11-15T22:17:33.588694+08:00 a kernel:  ? vprintk+0x41/0x80
2024-11-15T22:17:33.588695+08:00 a kernel:  ? _printk+0x60/0x90
2024-11-15T22:17:33.588696+08:00 a kernel:  netdev_start_xmit+0xdd/0x340
2024-11-15T22:17:33.588699+08:00 a kernel:  dev_hard_start_xmit+0x9a/0x450
2024-11-15T22:17:33.588701+08:00 a kernel:  sch_direct_xmit+0xea/0x450
2024-11-15T22:17:33.588703+08:00 a kernel:  __dev_queue_xmit+0xb40/0x1090
2024-11-15T22:17:33.588704+08:00 a kernel:  ? _printk+0x60/0x90
2024-11-15T22:17:33.588706+08:00 a kernel:  dev_queue_xmit+0x60/0x180
2024-11-15T22:17:33.588708+08:00 a kernel:  neigh_resolve_output+0x147/0x320
2024-11-15T22:17:33.588710+08:00 a kernel:  ip_finish_output2+0x1c8/0x810
2024-11-15T22:17:33.588711+08:00 a kernel:  __ip_finish_output+0xd9/0x280
2024-11-15T22:17:33.588713+08:00 a kernel:  ? vprintk+0x41/0x80
2024-11-15T22:17:33.588715+08:00 a kernel:  ip_finish_output+0x60/0x280
2024-11-15T22:17:33.588717+08:00 a kernel:  ip_output+0x9a/0x260
2024-11-15T22:17:33.588719+08:00 a kernel:  ? __pfx_ip_finish_output+0x10/0x10
2024-11-15T22:17:33.588720+08:00 a kernel:  ip_local_out+0x17d/0x1f0
2024-11-15T22:17:33.588722+08:00 a kernel:  __ip_queue_xmit+0x1bd/0x8b0
2024-11-15T22:17:33.588724+08:00 a kernel:  ip_queue_xmit+0x5b/0x180
2024-11-15T22:17:33.588725+08:00 a kernel:  __tcp_transmit_skb+0xf19/0x1400
2024-11-15T22:17:33.588728+08:00 a kernel:  __tcp_send_ack+0x10c/0x300
2024-11-15T22:17:33.588731+08:00 a kernel:  tcp_send_ack+0x104/0x250
2024-11-15T22:17:33.588732+08:00 a kernel:  __tcp_ack_snd_check+0x95/0x3a0
2024-11-15T22:17:33.588734+08:00 a kernel:  tcp_rcv_established+0x318/0x8a0
2024-11-15T22:17:33.588735+08:00 a kernel:  tcp_v4_do_rcv+0x1d9/0x430
2024-11-15T22:17:33.588737+08:00 a kernel:  tcp_v4_rcv+0x1093/0x1120
2024-11-15T22:17:33.588739+08:00 a kernel:  ? raw_local_deliver+0x194/0x3b0
2024-11-15T22:17:33.588758+08:00 a kernel:  ip_protocol_deliver_rcu+0x8e/0x280
2024-11-15T22:17:33.588762+08:00 a kernel:  ip_local_deliver_finish+0xac/0x1f0
2024-11-15T22:17:33.588765+08:00 a kernel:  ip_local_deliver+0xa3/0x260
2024-11-15T22:17:33.588766+08:00 a kernel:  ip_sublist_rcv_finish+0xbb/0x1e0
2024-11-15T22:17:33.588768+08:00 a kernel:  ip_sublist_rcv+0x16d/0x330
2024-11-15T22:17:33.588770+08:00 a kernel:  ? prb_read_valid+0x1c/0x30
2024-11-15T22:17:33.588781+08:00 a kernel:  ? printk_get_next_message+0x96/0x2b0
2024-11-15T22:17:33.588784+08:00 a kernel:  ip_list_rcv+0x138/0x280
2024-11-15T22:17:33.588794+08:00 a kernel:  __netif_receive_skb_list_core+0x37e/0x3a0
2024-11-15T22:17:33.588808+08:00 a kernel:  netif_receive_skb_list_internal+0x213/0x400
2024-11-15T22:17:33.588810+08:00 a kernel:  ? tcp4_gro_complete+0xbf/0x1f0
2024-11-15T22:17:33.588820+08:00 a kernel:  napi_gro_complete.constprop.0+0x1a1/0x480
2024-11-15T22:17:33.588831+08:00 a kernel:  dev_gro_receive+0x544/0x990
2024-11-15T22:17:33.588841+08:00 a kernel:  napi_gro_receive+0xb4/0x4e0
2024-11-15T22:17:33.590083+08:00 a kernel:  e1000_receive_skb+0xbc/0x1f0 [e1000]
2024-11-15T22:17:33.590183+08:00 a kernel:  e1000_clean_rx_irq+0x334/0xb60 [e1000]
2024-11-15T22:17:33.590271+08:00 a kernel:  e1000_clean+0x35e/0xe10 [e1000]
2024-11-15T22:17:33.590339+08:00 a kernel:  __napi_poll+0x6a/0x490
2024-11-15T22:17:33.590400+08:00 a kernel:  net_rx_action+0x16d/0x3f0
2024-11-15T22:17:33.590402+08:00 a kernel:  handle_softirqs+0x124/0x4d0
2024-11-15T22:17:33.590403+08:00 a kernel:  __do_softirq+0x3f/0x18c
2024-11-15T22:17:33.590404+08:00 a kernel:  __irq_exit_rcu+0xd0/0xf0
2024-11-15T22:17:33.590405+08:00 a kernel:  irq_exit_rcu+0xe/0x20
2024-11-15T22:17:33.590405+08:00 a kernel:  sysvec_apic_timer_interrupt+0x44/0xc0
2024-11-15T22:17:33.590406+08:00 a kernel: [net/ipv4/tcp.c tcp_recvmsg 2651] source ip: 192.168.16.132: 80, dest ip: 101.6.15.130: 80, family: 2,  state: 1
2024-11-15T22:17:33.590409+08:00 a kernel:  asm_sysvec_apic_timer_interrupt+0x1b/0x20
2024-11-15T22:17:33.590410+08:00 a kernel: RIP: 0033:0x7f372e2df6de
2024-11-15T22:17:33.590411+08:00 a kernel: Code: fc ff 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 55 48 89 e5 41 55 41 54 49 89 f4 53 48 89 fb 48 83 ec 08 0f b7 57 08 48 8b 3f <48> 89 d0 83 c2 01 48 85 ff 74 3b 39 57 fc 72 32 f3 41 0f 6f 04 24
2024-11-15T22:17:33.590412+08:00 a kernel: RSP: 002b:00007ffe99698f00 EFLAGS: 00000206
2024-11-15T22:17:33.590413+08:00 a kernel: RAX: 0000000000000036 RBX: 00005fb41ed20e48 RCX: 0000000000000000
2024-11-15T22:17:33.590414+08:00 a kernel: RDX: 0000000000000036 RSI: 00007ffe99698fb0 RDI: 00005fb41f22abb4
2024-11-15T22:17:33.590415+08:00 a kernel: RBP: 00007ffe99698f20 R08: 00005fb41e98631b R09: 0000000000000000
2024-11-15T22:17:33.590416+08:00 a kernel: R10: 0000000000000000 R11: 0000000000000000 R12: 00007ffe99698fb0
2024-11-15T22:17:33.590417+08:00 a kernel: R13: 00005fb41ed20dd8 R14: 00005fb41e986318 R15: 0000000000001ab6
2024-11-15T22:17:33.590417+08:00 a kernel:  </TASK>
2024-11-15T22:17:33.590418+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202] [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202]  ens33
2024-11-15T22:17:33.590419+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3217] name: ens33
2024-11-15T22:17:33.590420+08:00 a kernel: [include/linux/etherdevice.h eth_skb_pad 645]  
2024-11-15T22:17:33.590420+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_tso 2790]  

2024-11-15T22:17:38.621067+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_clean_rx_irq 4650] netdev->stats.rx_packets: 33624, netdev->stats.rx_bytes: 50527630
2024-11-15T22:17:38.621069+08:00 a kernel: [net/ipv4/tcp_output.c tcp_send_delayed_ack 4226] source ip: 192.168.16.132: 443, dest ip: 185.125.188.55: 443, family: 2,  state: 8
2024-11-15T22:17:38.621080+08:00 a kernel: [net/ipv4/tcp.c tcp_recvmsg 2651] source ip: 192.168.16.132: 443, dest ip: 185.125.188.55: 443, family: 2,  state: 8
2024-11-15T22:17:38.623876+08:00 a kernel: [net/ipv4/tcp.c tcp_sendmsg 1364] source ip: 192.168.16.132: 443, dest ip: 185.125.188.55: 443, family: 2,  state: 8
2024-11-15T22:17:38.623896+08:00 a kernel: [net/ipv4/tcp_output.c __tcp_transmit_skb 1460] source ip: 192.168.16.132: 443, dest ip: 185.125.188.55: 443, family: 2,  state: 8
2024-11-15T22:17:38.623898+08:00 a kernel: [net/ipv4/tcp_output.c tcp_event_ack_sent 192] source ip: 192.168.16.132: 443, dest ip: 185.125.188.55: 443, family: 2,  state: 8
2024-11-15T22:17:38.623899+08:00 a kernel: [net/ipv4/tcp_output.c tcp_event_data_sent 173] source ip: 192.168.16.132: 443, dest ip: 185.125.188.55: 443, family: 2,  state: 8
2024-11-15T22:17:38.623900+08:00 a kernel: [net/ipv4/ip_output.c ip_local_out 131] 1
2024-11-15T22:17:38.623901+08:00 a kernel: [net/ipv4/ip_output.c __ip_local_out 107] 1
2024-11-15T22:17:38.623901+08:00 a kernel: [include/linux/netdevice.h dev_queue_xmit 3092]  
2024-11-15T22:17:38.623902+08:00 a kernel: [net/core/dev.c __dev_queue_xmit 4378]  
2024-11-15T22:17:38.623903+08:00 a kernel: [net/core/dev.c __dev_xmit_skb 3855]  
2024-11-15T22:17:38.623903+08:00 a kernel: [net/sched/sch_generic.c sch_direct_xmit 322]  
2024-11-15T22:17:38.623904+08:00 a kernel: [net/core/dev.c dev_hard_start_xmit 3648]  
2024-11-15T22:17:38.623905+08:00 a kernel: [net/core/dev.c xmit_one 3631]  
2024-11-15T22:17:38.623906+08:00 a kernel: [include/linux/netdevice.h netdev_start_xmit 4922]  
2024-11-15T22:17:38.623906+08:00 a kernel: [include/linux/netdevice.h __netdev_start_xmit 4905] ops->ndo_start_xmit(skb, dev);
2024-11-15T22:17:38.623907+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3200]  
2024-11-15T22:17:38.623908+08:00 a kernel: CPU: 0 PID: 804 Comm: snapd Not tainted 6.9.0+ #3
2024-11-15T22:17:38.623909+08:00 a kernel: Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
2024-11-15T22:17:38.623910+08:00 a kernel: Call Trace:
2024-11-15T22:17:38.623911+08:00 a kernel:  <TASK>
2024-11-15T22:17:38.623912+08:00 a kernel:  dump_stack_lvl+0x76/0xa0
2024-11-15T22:17:38.623913+08:00 a kernel:  dump_stack+0x10/0x20
2024-11-15T22:17:38.623913+08:00 a kernel:  e1000_xmit_frame+0x53/0x1ba0 [e1000]
2024-11-15T22:17:38.623914+08:00 a kernel:  ? vprintk_default+0x1d/0x30
2024-11-15T22:17:38.623915+08:00 a kernel:  ? vprintk+0x41/0x80
2024-11-15T22:17:38.623915+08:00 a kernel:  ? _printk+0x60/0x90
2024-11-15T22:17:38.623916+08:00 a kernel:  netdev_start_xmit+0xdd/0x340
2024-11-15T22:17:38.623917+08:00 a kernel:  dev_hard_start_xmit+0x9a/0x450
2024-11-15T22:17:38.623918+08:00 a kernel:  sch_direct_xmit+0xea/0x450
2024-11-15T22:17:38.623919+08:00 a kernel:  __dev_queue_xmit+0xb40/0x1090
2024-11-15T22:17:38.623919+08:00 a kernel:  ? _printk+0x60/0x90
2024-11-15T22:17:38.623920+08:00 a kernel:  ip_finish_output2+0x35d/0x810
2024-11-15T22:17:38.623921+08:00 a kernel:  __ip_finish_output+0xd9/0x280
2024-11-15T22:17:38.623922+08:00 a kernel:  ? vprintk+0x41/0x80
2024-11-15T22:17:38.623923+08:00 a kernel:  ip_finish_output+0x60/0x280
2024-11-15T22:17:38.623923+08:00 a kernel:  ip_output+0x9a/0x260
2024-11-15T22:17:38.623924+08:00 a kernel:  ? __pfx_ip_finish_output+0x10/0x10
2024-11-15T22:17:38.623925+08:00 a kernel:  ip_local_out+0x17d/0x1f0
2024-11-15T22:17:38.623925+08:00 a kernel:  __ip_queue_xmit+0x1bd/0x8b0
2024-11-15T22:17:38.623926+08:00 a kernel:  ip_queue_xmit+0x5b/0x180
2024-11-15T22:17:38.623927+08:00 a kernel:  __tcp_transmit_skb+0xf19/0x1400
2024-11-15T22:17:38.623927+08:00 a kernel:  ? vsnprintf+0x40f/0x590
2024-11-15T22:17:38.623928+08:00 a kernel:  tcp_transmit_skb+0x63/0x190
2024-11-15T22:17:38.623929+08:00 a kernel:  tcp_write_xmit+0x543/0x1700
2024-11-15T22:17:38.623929+08:00 a kernel:  __tcp_push_pending_frames+0x7b/0x3a0
2024-11-15T22:17:38.623930+08:00 a kernel:  tcp_push+0x188/0x400
2024-11-15T22:17:38.623931+08:00 a kernel:  tcp_sendmsg_locked+0xd43/0x10c0
2024-11-15T22:17:38.623931+08:00 a kernel:  tcp_sendmsg+0x118/0x270
2024-11-15T22:17:38.623932+08:00 a kernel:  inet_sendmsg+0x7c/0x1f0
2024-11-15T22:17:38.623933+08:00 a kernel:  sock_sendmsg_nosec+0x18e/0x220
2024-11-15T22:17:38.623933+08:00 a kernel:  sock_write_iter+0x15d/0x280
2024-11-15T22:17:38.623934+08:00 a kernel:  vfs_write+0x2d1/0x6d0
2024-11-15T22:17:38.623935+08:00 a kernel:  ksys_write+0xc9/0x100
2024-11-15T22:17:38.623936+08:00 a kernel:  __x64_sys_write+0x19/0x30
2024-11-15T22:17:38.623936+08:00 a kernel:  x64_sys_call+0x7e/0x25c0
2024-11-15T22:17:38.623937+08:00 a kernel:  do_syscall_64+0x7e/0x180
2024-11-15T22:17:38.623938+08:00 a kernel:  ? wake_up_q+0x83/0x1e0
2024-11-15T22:17:38.623938+08:00 a kernel:  ? futex_wake+0x1b2/0x2e0
2024-11-15T22:17:38.623939+08:00 a kernel:  ? do_futex+0x337/0x3c0
2024-11-15T22:17:38.623940+08:00 a kernel:  ? __do_sys_futex+0x13e/0x2f0
2024-11-15T22:17:38.623940+08:00 a kernel:  ? syscall_exit_to_user_mode+0x72/0x360
2024-11-15T22:17:38.623941+08:00 a kernel:  ? do_syscall_64+0x8b/0x180
2024-11-15T22:17:38.623942+08:00 a kernel:  ? syscall_exit_to_user_mode+0x72/0x360
2024-11-15T22:17:38.623942+08:00 a kernel:  ? do_syscall_64+0x8b/0x180
2024-11-15T22:17:38.623943+08:00 a kernel:  ? do_syscall_64+0x8b/0x180
2024-11-15T22:17:38.623946+08:00 a kernel:  ? clear_bhb_loop+0x15/0x70
2024-11-15T22:17:38.623948+08:00 a kernel: message repeated 2 times: [  ? clear_bhb_loop+0x15/0x70]
2024-11-15T22:17:38.623949+08:00 a kernel:  entry_SYSCALL_64_after_hwframe+0x76/0x7e
2024-11-15T22:17:38.623952+08:00 a kernel: RIP: 0033:0x55a41718252e
2024-11-15T22:17:38.623954+08:00 a kernel: Code: 48 83 ec 38 e8 13 00 00 00 48 83 c4 38 5d c3 cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48
2024-11-15T22:17:38.623955+08:00 a kernel: RSP: 002b:000000c000389740 EFLAGS: 00000216 ORIG_RAX: 0000000000000001
2024-11-15T22:17:38.623955+08:00 a kernel: RAX: ffffffffffffffda RBX: 0000000000000012 RCX: 000055a41718252e
2024-11-15T22:17:38.623956+08:00 a kernel: RDX: 0000000000000018 RSI: 000000c00003e480 RDI: 0000000000000012
2024-11-15T22:17:38.623957+08:00 a kernel: RBP: 000000c000389780 R08: 0000000000000000 R09: 0000000000000000
2024-11-15T22:17:38.623958+08:00 a kernel: R10: 0000000000000000 R11: 0000000000000216 R12: 000000c0003898b0
2024-11-15T22:17:38.623958+08:00 a kernel: R13: 000000000000000e R14: 000000c000785340 R15: 0000000000006099
2024-11-15T22:17:38.623959+08:00 a kernel:  </TASK>
2024-11-15T22:17:38.623960+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202] [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3202]  ens33
2024-11-15T22:17:38.623961+08:00 a kernel: [drivers/net/ethernet/intel/e1000/e1000_main.c e1000_xmit_frame 3217] name: ens33
2024-11-15T22:17:38.623961+08:00 a kernel: [include/linux/etherdevice.h eth_skb_pad 645]  

这里要注意,调用栈不一定完全按照函数调用关系打印的。

这个函数对于分析内核源代码执行流程是相当有用的。


原文地址:https://blog.csdn.net/r77683962/article/details/143808911

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!