Linux htop和perf使用

htop

使用:htop -p id

编译:BR2_PACKAGE_HTOP

perf

系统性能分析工具,

使用:perf top -p 589

编译内核工具:linux-4.9.11/tools/perf 或者 BR2_PACKAGE_PERF

make ARCH=arm CROSS_COMPILE=/home/wangyubo/imx6ul-Foton-4GTBOX/logread-build-tools/LGQ-FT02/openwrt/staging_dir/toolchain-arm_gcc-imx6ul/bin/arm-linux-gnueabihf-

top信息:ucand收数据然后群发给basevdr,nev,ifoton

Mem: 98900K used, 151752K free, 0K shrd, 18300K buff, 18680K cached
CPU: 25.0% usr 62.9% sys  0.0% nic 12.0% idle  0.0% io  0.0% irq  0.0% sirq
Load average: 1.96 0.78 0.29 1/124 4878
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
  610     1 root     S     2140  0.8   0 14.8 /usr/sbin/ucand -B
  564     1 root     S    29952 11.8   0 12.0 basevdrd -s /dev/ttymxc1 -B
 2696     1 root     S    21624  8.5   0 12.0 nevd -B
 2773  2767 root     S    13240  5.2   0 11.1 ifotond
 2767     1 root     S    40148 15.9   0  5.5 ifotond
  499     1 root     S     9684  3.8   0  3.7 /usr/sbin/tigerfaced -l 3 -B
  203     1 root     S     1540  0.6   0  3.7 /usr/sbin/uild -s /dev/ttymxc2 -B
  495     1 root     S     1772  0.7   0  1.8 /sbin/ubusd
 4848  4000 root     R     1488  0.5   0  1.8 top -d 1

ucan

   PerfTop:     307 irqs/sec  kernel:87.9%  exact:  0.0% [4000Hz cpu-clock],  (target_pid: 610)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    28.03%  [kernel]              [k] __wake_up_sync_key
    13.57%  [kernel]              [k] finish_task_switch
     4.37%  [kernel]              [k] unix_stream_sendmsg
     1.92%  [kernel]              [k] preempt_count_sub
     1.91%  [kernel]              [k] copy_from_iter
     1.46%  [kernel]              [k] vfs_write
     1.45%  [kernel]              [k] sock_alloc_send_pskb
     1.42%  [kernel]              [k] __kmalloc_track_caller
     1.35%  [kernel]              [k] __memzero
     1.31%  [kernel]              [k] skb_queue_tail
     1.24%  [kernel]              [k] skb_set_owner_w
     1.23%  [kernel]              [k] __slab_free
     1.21%  [kernel]              [k] rcu_read_unlock_special
     1.16%  [kernel]              [k] __vfs_write
     1.11%  [kernel]              [k] __usb_hcd_giveback_urb
     1.10%  [kernel]              [k] kmem_cache_alloc
     1.06%  [kernel]              [k] unix_stream_read_generic
     1.01%  [kernel]              [k] sock_def_readable
     1.00%  [kernel]              [k] __alloc_skb

basevdr

   PerfTop:     251 irqs/sec  kernel:70.5%  exact:  0.0% [4000Hz cpu-clock],  (target_pid: 564)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    10.79%  [kernel]        [k] finish_task_switch
     3.70%  [kernel]        [k] __wake_up_sync_key
     1.99%  [kernel]        [k] hrtimer_start_range_ns
     1.89%  [kernel]        [k] preempt_count_sub
     1.59%  [kernel]        [k] ipt_do_table
     1.24%  [kernel]        [k] hrtimer_try_to_cancel
     1.10%  [kernel]        [k] tcp_transmit_skb
     1.05%  [kernel]        [k] clocksource_mmio_readl_up
     0.98%  [kernel]        [k] tcp_sendmsg
     0.95%  [kernel]        [k] sys_epoll_wait
     0.95%  [kernel]        [k] preempt_count_add
     0.89%  [kernel]        [k] tcp_v4_rcv
     0.88%  [kernel]        [k] unix_stream_read_generic
     0.88%  [kernel]        [k] arm_copy_to_user

nev

   PerfTop:     186 irqs/sec  kernel:65.6%  exact:  0.0% [4000Hz cpu-clock],  (target_pid: 2696)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    15.25%  [kernel]              [k] finish_task_switch
     6.26%  [kernel]              [k] hrtimer_start_range_ns
     3.27%  [kernel]              [k] sys_epoll_wait
     2.97%  [kernel]              [k] clocksource_mmio_readl_up
     1.86%  [kernel]              [k] select_estimate_accuracy
     1.67%  [kernel]              [k] ktime_get_ts64
     1.66%  [kernel]              [k] preempt_count_sub
     1.54%  [kernel]              [k] hrtimer_try_to_cancel
     1.52%  [kernel]              [k] schedule
     1.49%  [kernel]              [k] __wake_up_sync_key
     1.29%  [kernel]              [k] unix_stream_read_generic
     1.02%  [kernel]              [k] set_normalized_timespec64
     1.00%  [kernel]              [k] vector_swi
     0.99%  [kernel]              [k] arm_copy_to_user

ifoton

   PerfTop:     135 irqs/sec  kernel:80.7%  exact:  0.0% [4000Hz cpu-clock],  (target_pid: 2773)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    18.50%  [kernel]       [k] finish_task_switch
     5.52%  [kernel]       [k] hrtimer_start_range_ns
     3.19%  [kernel]       [k] vector_swi
     3.18%  [kernel]       [k] sys_epoll_wait
     2.73%  [kernel]       [k] do_msgsnd
     2.58%  [kernel]       [k] clocksource_mmio_readl_up
     2.53%  [kernel]       [k] select_estimate_accuracy
     2.13%  [kernel]       [k] preempt_count_sub
     2.06%  [kernel]       [k] ktime_get_ts64
     1.51%  [kernel]       [k] __kmalloc
     1.50%  [kernel]       [k] schedule_hrtimeout_range_clock
     1.50%  [kernel]       [k] __usb_hcd_giveback_urb
     1.49%  [kernel]       [k] hrtimer_init

还有其他更多使用方法待挖掘

 

猜你喜欢

转载自blog.csdn.net/TSZ0000/article/details/90769880