前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >又一次性能测试

又一次性能测试

作者头像
Taishan3721
发布2024-03-25 15:15:39
1430
发布2024-03-25 15:15:39
举报
文章被收录于专栏:这里只有VxWorks

如转发 请标明出处!

刚刚发布的VxWorks 7 24.03集成了一个Benchmark Suite:rtos-benchmark。这个测试涵盖了Task/Thread、Mutex、Semaphore、Message queue等领域,并支持VxWorks API和POSIX API两种标准。今天把它跑了跑,步骤如下

先在VSB里包含BENCHMARKS和BENCHMARKS_RTOS_BENCHMARK

然后修改VIP。添加组件INCLUDE_STANDALONE_SYM_TBL。为了方便操作,(公众号VxWorks567)还添加了INCLUDE_SHELL。为了减少干扰,建议去掉组件INCLUDE_NETWORK。为了提高精度,建议设置HIGH_RES_POSIX_CLOCK为TRUE

接下来就是测试用例了,如果使用的命令行,那直接add INCLUDE_RTOS_BENCHMARK_NONPOSIX或INCLUDE_RTOS_BENCHMARK_POSIX。这俩组件是互斥的,分别用于测试VxWorks API和POSIX API

如果使用Workbench创建的VIP,24.03自带的cdf有点小问题,需要在$(vsb)\krnl\cdf\20rtosBenchmark.cdf里手动添加一下这俩组件所在的folder,例如下图,是(公众号VxWorks567)刚刚添加的

添加ROMFS到VIP,并包含$(vsb)\usr\root\llvm\bin里的文件:rtos_benchmark_posix.vxe和rtos_benchmark_non_posix.vxe

参数RTOS_BENCHMARK_OPTIONS如果修改为1,ROMFS里的测试用例就会自启动;否则可以手动执行rtosBenchmarkRun()

这是VxWorks API的测试报告

代码语言:javascript
复制
-> rtosBenchmarkRun
->
Rtos-benchmark Testing for non-POSIX APIs:
Platform information:
x86_64 Processor (ACPI_BOOT_OP) SMP/SMT
VxWorks (for x86_64 Processor (ACPI_BOOT_OP) SMP/SMT) version SMP 64-bit
Kernel: Core Kernel version: 3.2.3.6
Made on Mar 21 2024 15:59:00
->
System Configurations:
    - System tick clock frequency: 60 Hz
    - Task CPU affinity on core: 1
    - Main task priority: 50
    - POSIX high-res clock timer resolution: 16666666 ns
        - Timer frequency from clock_gettime(): 1000000000 Hz

 *** Starting! ***

** Thread stats [avg, min, max] in nanoseconds **
 Spawn (no context switch)               :  83333,      0, 16666667
 Create (no context switch)              : 100000,      0, 16666667
 Start  (no context switch)              :      0,      0,      0
 Suspend (no context switch)             :      0,      0,      0
 Resume (no context switch)              :      0,      0,      0
 Spawn (context switch)                  : 100000,      0, 16666667
 Start  (context switch)                 :      0,      0,      0
 Suspend (context switch)                :      0,      0,      0
 Resume (context switch)                 :      0,      0,      0
 Terminate (context switch)              : 216666,      0, 16666667
** Mutex Stats [avg, min, max] in nanoseconds **
 Lock (no owner)                         :      0,      0,      0
 Unlock (no waiters)                     :      0,      0,      0
 Recursive lock                          :      0,      0,      0
 Recursive unlock                        :      0,      0,      0
 Unlock with unpend (no context switch)  :      0,      0,      0
 Unlock with unpend (context switch)     :      0,      0,      0
 Pend (no priority inheritance)          :      0,      0,      0
 Pend (priority inheritance)             :      0,      0,      0
** Semaphore stats [avg, min, max] in nanoseconds **
 Take (context switch)                   :      0,      0,      0
 Give (context switch)                   :      0,      0,      0
** Semaphore stats [avg, min, max] in nanoseconds **
 Give (no context switch)                :      0,      0,      0
 Take (no context switch)                :      0,      0,      0
** Yield stats [avg, min, max] in nanoseconds **
 Yield (no context switch)               :      0,      0,      0
 Yield (context switch)                  :      0,      0,      0
** Allocation stats [avg, min, max] in nanoseconds **
 Malloc                                  :      0,      0,      0
 Free                                    :      0,      0,      0
** Message queue stats [avg, min, max] in nanoseconds **
 Create                                  :      0,      0,      0
 Send (no context switch)                :      0,      0,      0
 Receive (no context switch)             :      0,      0,      0
 Send (context switch)                   :      0,      0,      0
 Receive (context switch)                :      0,      0,      0

 *** Done! ***

这是POSIX API的测试报告

代码语言:javascript
复制
-> rtosBenchmarkRun
->
Rtos-benchmark Testing for POSIX APIs:
Platform information:
x86_64 Processor (ACPI_BOOT_OP) SMP/SMT
VxWorks (for x86_64 Processor (ACPI_BOOT_OP) SMP/SMT) version SMP 64-bit
Kernel: Core Kernel version: 3.2.3.6
Made on Mar 21 2024 16:04:48
->
System Configurations:
    - System tick clock frequency: 60 Hz
    - Task CPU affinity on core: 1
    - Main task priority: 50
    - POSIX high-res clock timer resolution: 16666666 ns
        - Timer frequency from clock_gettime(): 1000000000 Hz

 *** Starting! ***

** Thread stats [avg, min, max] in nanoseconds **
 Spawn (no context switch)               : 133333,      0, 16666667
 Create (no context switch)              :    n/a,    n/a,    n/a
 Start (no context switch)               :    n/a,    n/a,    n/a
 Suspend (no context switch)             :    n/a,    n/a,    n/a
 Resume (no context switch)              :    n/a,    n/a,    n/a
 Spawn (context switch)                  : 116666,      0, 16666667
 Start  (context switch)                 :    n/a,    n/a,    n/a
 Suspend (context switch)                :    n/a,    n/a,    n/a
 Resume (context switch)                 :    n/a,    n/a,    n/a
 Terminate (context switch)              : 199999,      0, 16666667
** Mutex Stats [avg, min, max] in nanoseconds **
 Lock (no owner)                         :      0,      0,      0
 Unlock (no waiters)                     :      0,      0,      0
 Recursive lock                          :      0,      0,      0
 Recursive unlock                        :      0,      0,      0
 Unlock with unpend (no context switch)  :      0,      0,      0
 Unlock with unpend (context switch)     :      0,      0,      0
 Pend (no priority inheritance)          :      0,      0,      0
 Pend (priority inheritance)             :      0,      0,      0
** Semaphore stats [avg, min, max] in nanoseconds **
 Take (context switch)                   :      0,      0,      0
 Give (context switch)                   :      0,      0,      0
** Semaphore stats [avg, min, max] in nanoseconds **
 Give (no context switch)                :      0,      0,      0
 Take (no context switch)                :      0,      0,      0
** Yield stats [avg, min, max] in nanoseconds **
 Yield (no context switch)               :      0,      0,      0
 Yield (context switch)                  :      0,      0,      0
** Allocation stats [avg, min, max] in nanoseconds **
 Malloc                                  :      0,      0,      0
 Free                                    :  16666,      0, 16666666
** Message queue stats [avg, min, max] in nanoseconds **
 Create                                  :      0,      0,      0
 Send (no context switch)                :      0,      0,      0
 Receive (no context switch)             :      0,      0,      0
 Send (context switch)                   :      0,      0,      0
 Receive (context switch)                :      0,      0,      0

 *** Done! ***

因为Target CPU的性能太高,所以测试报告看上去精度不够。简单看了看源码,有时间可以再优化一下。

另外,这个测试用例应该与VxWorks的版本没什么关系,而且也不限于User mode。有时间试试把它移植到低版本的Kernel mode

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2024-03-21,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 这里只有VxWorks 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
腾讯云服务器利旧
云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档