小樱 发表于 2024/12/20 22:30

Linux docker运行程序空载CPU吃满的原因wxWidgets程序框架

Linux docker运行程序空载CPU吃满的原因wxWidgets程序框架

gdb分析线程情况
warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable.Connect to gdbserver inside the container.
0x00007f8c6799d68e in ?? ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.el7_9.3.x86_64
(gdb) bt
#00x00007f8c6799d68e in ?? ()
#10x00007fff63852200 in ?? ()
#20x00000017638521f0 in ?? ()
#30x00007fff638523e0 in ?? ()
#40x0000000000000010 in ?? ()
#50x00007fff63852200 in ?? ()
#60x00005600d3a5fb3a in wxEpollDispatcher::DoPoll(epoll_event*, int, int) const ()
#70x00005600d3a6060e in wxEpollDispatcher::Dispatch(int) ()
#80x00005600d39e5858 in wxConsoleEventLoop::DispatchTimeout(unsigned long) ()
#90x00005600d39e5591 in wxConsoleEventLoop::Dispatch() ()
#10 0x00005600d39405f2 in wxEventLoopManual::ProcessEvents() ()
#11 0x00005600d39406a5 in wxEventLoopManual::DoRun() ()
#12 0x00005600d39403bd in wxEventLoopBase::Run() ()
#13 0x00005600d3918ced in wxAppConsoleBase::OnRun() ()
#14 0x00005600d397ab82 in wxEntry(int&, wchar_t**) ()
#15 0x00005600d327ff98 in main ()
(gdb) t 1

#00x00007f8c6799d68e in ?? ()
(gdb) bt
#00x00007f8c6799d68e in ?? ()
#10x00007fff63852200 in ?? ()
#20x00000017638521f0 in ?? ()
#30x00007fff638523e0 in ?? ()
#40x0000000000000010 in ?? ()
#50x00007fff63852200 in ?? ()
#60x00005600d3a5fb3a in wxEpollDispatcher::DoPoll(epoll_event*, int, int) const ()
#70x00005600d3a6060e in wxEpollDispatcher::Dispatch(int) ()
#80x00005600d39e5858 in wxConsoleEventLoop::DispatchTimeout(unsigned long) ()
#90x00005600d39e5591 in wxConsoleEventLoop::Dispatch() ()
#10 0x00005600d39405f2 in wxEventLoopManual::ProcessEvents() ()
#11 0x00005600d39406a5 in wxEventLoopManual::DoRun() ()
#12 0x00005600d39403bd in wxEventLoopBase::Run() ()
#13 0x00005600d3918ced in wxAppConsoleBase::OnRun() ()
#14 0x00005600d397ab82 in wxEntry(int&, wchar_t**) ()
#15 0x00005600d327ff98 in main ()

warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable.Connect to gdbserver inside the container.
0x00007f8c6799d68e in ?? ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.el7_9.3.x86_64
(gdb) bt
#00x00007f8c6799d68e in ?? ()
#10x00062964bb0d0442 in ?? ()
#20x0000001705e15b00 in ?? ()
#30x00007fff6385250c in ?? ()
#40x0000000000000001 in ?? ()
#50x00005600d4637090 in wxTimerUnixModule::ms_classInfo ()
#60x00005600d3a5fb3a in wxEpollDispatcher::DoPoll(epoll_event*, int, int) const ()
#70x00005600d3a5fbc5 in wxEpollDispatcher::HasPending() const ()
#80x00005600d39e5690 in wxConsoleEventLoop::Pending() const ()
#90x00005600d3940657 in wxEventLoopManual::DoRun() ()
#10 0x00005600d39403bd in wxEventLoopBase::Run() ()
#11 0x00005600d3918ced in wxAppConsoleBase::OnRun() ()
#12 0x00005600d397ab82 in wxEntry(int&, wchar_t**) ()
#13 0x00005600d327ff98 in main ()
(gdb) t 1

#00x00007f8c6799d68e in ?? ()
(gdb) bt
#00x00007f8c6799d68e in ?? ()
#10x00062964bb0d0442 in ?? ()
#20x0000001705e15b00 in ?? ()
#30x00007fff6385250c in ?? ()
#40x0000000000000001 in ?? ()
#50x00005600d4637090 in wxTimerUnixModule::ms_classInfo ()
#60x00005600d3a5fb3a in wxEpollDispatcher::DoPoll(epoll_event*, int, int) const ()
#70x00005600d3a5fbc5 in wxEpollDispatcher::HasPending() const ()
#80x00005600d39e5690 in wxConsoleEventLoop::Pending() const ()
#90x00005600d3940657 in wxEventLoopManual::DoRun() ()
#10 0x00005600d39403bd in wxEventLoopBase::Run() ()
#11 0x00005600d3918ced in wxAppConsoleBase::OnRun() ()
#12 0x00005600d397ab82 in wxEntry(int&, wchar_t**) ()
#13 0x00005600d327ff98 in main ()
(gdb)

perf
Samples: 33K of event 'cycles', Event count (approx.): 5778034374                                                         
Children      SelfCommand    Shared Object      Symbol                                                               
+   85.76%   0.00%bitcometd             0x0000000000000017
+   84.70%   0.00%bitcometdlibc-2.31.so         [.] 0x00007f8c6799d68e
+   70.81%   0.15%bitcometd    tracesys
+   66.68%   0.36%bitcometd    syscall_trace_enter
+   65.62%   0.56%bitcometd    __secure_computing
+   64.84%   0.55%bitcometd    __seccomp_filter
+   58.51%    57.81%bitcometd    sk_run_filter
+    8.17%   0.00%bitcometd            [.] 0000000000000000
+    6.36%   6.36%bitcometd    retint_userspace_restore_args
+    5.27%   0.00%bitcometd            [.] 0x000001e805480789
+    5.27%   0.00%bitcometdbitcometd            [.] 0x00005600d3905240
+    4.88%   4.88%bitcometd    __x86_indirect_thunk_r8
+    3.67%   3.67%bitcometd    system_call_after_swapgs
+    2.43%   0.40%bitcometd    sys_epoll_wait
+    2.29%   2.29%bitcometdlibc-2.31.so         [.] 0x000000000011f68e
+    1.94%   0.02%bitcometd    int_check_syscall_exit_work
+    1.94%   0.22%bitcometd    syscall_trace_leave
+    1.71%   0.00%bitcometd            [.] 0xfbbdcf7705e15b00
+    1.66%   1.64%bitcometd               [.] __vdso_gettimeofday
+    1.36%   0.76%bitcometd    __audit_syscall_exit
+    1.31%   0.00%bitcometd            [.] 0x0000000000000001
+    1.24%   0.21%bitcometd    ep_poll
+    1.21%   0.00%bitcometd            [.] 0xcde907894810c083
+    1.21%   0.00%bitcometdbitcometd            [.] 0x00005600d39e6280
+    1.15%   0.00%bitcometdbitcometd            [.] 0x00005600d39b597e
+    1.12%   1.12%bitcometd    seccomp_bpf_load
+    1.08%   0.02%bitcometd    apic_timer_interrupt
+    1.04%   0.01%bitcometd    smp_apic_timer_interrupt
+    1.03%   0.94%bitcometd    __audit_syscall_entry
+    0.97%   0.01%bitcometd    do_softirq
+    0.96%   0.00%bitcometd    call_softirq
+    0.87%   0.02%bitcometd    irq_exit
+    0.86%   0.01%bitcometd    __do_softirq
+    0.76%   0.00%bitcometdbitcometd            [.] 0x00005600d39e3019
+    0.74%   0.74%bitcometdbitcometd            [.] 0x0000000000989019
+    0.69%   0.00%bitcometd            [.] 0x4800217f8010c083
+    0.69%   0.00%bitcometdbitcometd            [.] 0x00005600d39f0620
+    0.69%   0.00%bitcometd            [.] 0x00005600d5ef78a0
+    0.66%   0.02%bitcometd    net_rx_action
+    0.64%   0.00%bitcometd            [.] 0x0000004d0000002d
+    0.57%   0.56%bitcometd    _raw_spin_lock_irqsave
+    0.54%   0.54%bitcometd    fget_light
+    0.54%   0.00%bitcometdbitcometd            [.] 0x00005600d391349c
+    0.52%   0.01%bitcometd    virtnet_poll
   0.49%   0.00%bitcometd    __netif_receive_skb
   0.48%   0.04%bitcometd    __netif_receive_skb_core
   0.47%   0.00%bitcometd            [.] 0x0000441f0f000000
   0.47%   0.01%bitcometd    local_apic_timer_interrupt
   0.47%   0.00%bitcometd    netif_receive_skb_internal

得知原因
是wxWidgets 在Linux下控制台程序框架的问题

页: [1]
查看完整版本: Linux docker运行程序空载CPU吃满的原因wxWidgets程序框架