• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sys_load_monitor: 一款轻量级的系统负荷监视器,用户可以在必要的时候 dump 出来,系 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

一款轻量级的系统负荷监视器

what

本软件包是一款轻量级的系统负荷监视器,用户可以在必要的时候 dump 出来,系统的历史负荷情况,方便进行性能分析

how

STEP1 启用并配置软件包

参考 menuconfig 配置描述

STEP2 始化软件包

软件包默认使用 RT-Thread 自带的系统初始化方式,进行自动初始化( sys_load_monitor_init )。如果系统已经开启了自动初始化功能,那么无需再调用初始化代码。

STEP3 dump 历史负荷统计

可以通过下面两种方式进行 dump:

  • 调用 sys_load_monitor_dump 函数
  • shell 中执行 sys_load 命令

执行后,近期的系统负荷将会被输出到控制台中,大致情况如下:

msh />sys_load                                                                                   RUNNING  | 31      23      15      7      0 | ready thread list..                                -------- | -------------------------------- | -------------------                                thread-j |    * * *   * $                   | thread-k(20) thread-m(24) thread-n(26) thread-o(28)thread-e |        * *             $         | thread-l(22) thread-m(24)                          thread-h |    * * * * *     $               | thread-k(20) thread-l(22) thread-m(24) thread-n(26)thread-b |    *     *   *               $   | thread-j(18) thread-l(22) thread-o(28)             thread-d |    * * * * *           * $       | thread-e(08) utest   (20) thread-l(22) thread-m(24)thread-f |    * * * * *     * * $           | thread-g(12) thread-h(14) utest   (20) thread-l(22)thread-a |    * * * * * *                 $ | thread-j(18) thread-k(20) utest   (20) thread-l(22)thread-b |    * * * * *                 $   | utest   (20) thread-l(22) thread-m(24) thread-n(26)thread-g |    * * * * *       $             | utest   (20) thread-l(22) thread-m(24) thread-n(26)thread-h |    * * * * * * * $               | thread-i(16) thread-j(18) utest   (20) thread-l(22)thread-f |    * * * *     *     $           | thread-i(16) thread-l(22) thread-m(24) thread-n(26)thread-i |    *           $                 | thread-o(28)                                       thread-k |    * * * * $                     | thread-l(22) thread-m(24) thread-n(26) thread-o(28)thread-b |      * * * * *               $   | thread-j(18) tshell  (20) thread-l(22) thread-m(24)thread-e |    * * * * *           $         | thread-k(20) thread-l(22) thread-m(24) thread-n(26)thread-l |    * * * $                       | thread-m(24) thread-n(26) thread-o(28)             thread-m |        $                         |                                                    thread-h |    *             $               | thread-o(28)                                       tshell   |    * * *   $                     | thread-k(20) thread-m(24) thread-n(26) thread-o(28)msh />                                                                                           

每行记录了一条系统的历史线程运行情况

  • 第一列:当前执行线程的名称
  • 中间列:当前线程的调用状态,按照优先级进行排列。
    • $ : 代表当前正在运行线程的优先级
    • * : 代表处于就绪状态的线程优先级
  • 第三列:就绪列表中的线程列表

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap