dhrystone测试前系统软件准备与计算

关于介绍:

https://en.wikipedia.org/wiki/Dhrystone

软件准备:

  1. 查看系统interrupt,将系统驱动占用的中断号都关闭,关闭config或者修改dts,减少干扰;
/ # cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
  2:          0          0          0          0     GIC-0  29 Level     arch_timer
  3:       2599       2402       2733       5185     GIC-0  30 Level     arch_timer
  7:          3          0          0          0     GIC-0 192 Level     ffe40000.bifrost
  8:          0          0          0          0     GIC-0 193 Level     ffe40000.bifrost
  9:          0          0          0          0     GIC-0 194 Level     ffe40000.bifrost
 13:          0          0          0          0     GIC-0  62 Level     xhci-hcd:usb1
 17:        275          0          0          0     GIC-0 247 Edge      ffd1d000.i2c
 19:        359          0          0          0     GIC-0  71 Edge      ffd1c000.i2c
 21:        343          0          0          0     GIC-0 113 Level     ffd13000.spi
 22:          0          0          0          0     GIC-0 122 Level     ffd15000.spi
 23:         29          0          0          0     GIC-0 227 Edge      ff805000.i2c
IPI0:       900       2594       1421       2300       Rescheduling interrupts
IPI1:        44        323        299        321       Function call interrupts
IPI2:         0          0          0          0       CPU stop interrupts
IPI3:         0          0          0          0       Timer broadcast interrupts
IPI4:         0          0          0          0       IRQ work interrupts
IPI5:         0          0          0          0       CPU wake-up interrupts
Err:          0
  1. 设置系统主频最高和cpufreq governor为performance
/data # cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
performance
/sys/devices/system/cpu/cpufreq/policy0 # cat scaling_cur_freq
1908000
/sys/devices/system/cpu/cpufreq/policy0 # cat ../../cpu1/cpufreq/scaling_cur_fre
q
1908000
/sys/devices/system/cpu/cpufreq/policy0 # cat ../../cpu2/cpufreq/scaling_cur_fre
q
1908000
/sys/devices/system/cpu/cpufreq/policy0 # cat ../../cpu3/cpufreq/scaling_cur_fre
q
1908000
  1. 关闭irqbalace或者一些其他占用cpu资源的设置,cpu供电电压调整到最高;

Run dhrystone

原则是:几个cpu, 就跑几个单独的dhrystone

/data # ./dhrystone 1410065408 &          
/data #
Dhrystone Benchmark, Version 2.1 (Language: C)

Program compiled without 'register' attribute

Execution starts, 1410065408 runs through Dhrystone
/data # ./dhrystone 1410065408 &
/data #
Dhrystone Benchmark, Version 2.1 (Language: C)

Program compiled without 'register' attribute

Execution starts, 1410065408 runs through Dhrystone
/data # ./dhrystone 1410065408 &
/data #
Dhrystone Benchmark, Version 2.1 (Language: C)

Program compiled without 'register' attribute

Execution starts, 1410065408 runs through Dhrystone
/data # ./dhrystone 1410065408 &
/data #
Dhrystone Benchmark, Version 2.1 (Language: C)

Program compiled without 'register' attribute

Execution starts, 1410065408 runs through Dhrystone
Execution ends

Final values of the variables used in the benchmark:

Int_Glob:            5
        should be:   5
Bool_Glob:           1
        should be:   1
Ch_1_Glob:           A
        should be:   A
Ch_2_Glob:           B
        should be:   B
Arr_1_Glob[8]:       7
        should be:   7
Arr_2_Glob[8][7]:    1410065418
        should be:   Number_Of_Runs + 10
Ptr_Glob->
  Ptr_Comp:          461642560
        should be:   (implementation-dependent)
  Discr:             0
        should be:   0
  Enum_Comp:         2
        should be:   2
  Int_Comp:          17
        should be:   17
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Next_Ptr_Glob->
  Ptr_Comp:          461642560
        should be:   (implementation-dependent), same as above
  Discr:             0
        should be:   0
  Enum_Comp:         1
        should be:   1
  Int_Comp:          18
        should be:   18
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Int_1_Loc:           5
        should be:   5
Int_2_Loc:           13
        should be:   13
Int_3_Loc:           7
        should be:   7
Enum_Loc:            1
        should be:   1
Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
        should be:   DHRYSTONE PROGRAM, 1'ST STRING
Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
        should be:   DHRYSTONE PROGRAM, 2'ND STRING

Microseconds for one run through Dhrystone:    0.1
Dhrystones per Second:                      11321280.0

Execution ends

Final values of the variables used in the benchmark:

Int_Glob:            5
        should be:   5
Bool_Glob:           1
        should be:   1
Ch_1_Glob:           A
        should be:   A
Ch_2_Glob:           B
        should be:   B
Arr_1_Glob[8]:       7
        should be:   7
Arr_2_Glob[8][7]:    1410065418
        should be:   Number_Of_Runs + 10
Ptr_Glob->
  Ptr_Comp:          106289984
        should be:   (implementation-dependent)
  Discr:             0
        should be:   0
  Enum_Comp:         2
        should be:   2
  Int_Comp:          17
        should be:   17
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Next_Ptr_Glob->
  Ptr_Comp:          106289984
        should be:   (implementation-dependent), same as above
  Discr:             0
        should be:   0
  Enum_Comp:         1
        should be:   1
  Int_Comp:          18
        should be:   18
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Int_1_Loc:           5
        should be:   5
Int_2_Loc:           13
        should be:   13
Int_3_Loc:           7
        should be:   7
Enum_Loc:            1
        should be:   1
Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
        should be:   DHRYSTONE PROGRAM, 1'ST STRING
Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
        should be:   DHRYSTONE PROGRAM, 2'ND STRING

Microseconds for one run through Dhrystone:    0.1
Dhrystones per Second:                      11346788.0

Execution ends

Final values of the variables used in the benchmark:

Int_Glob:            5
        should be:   5
Bool_Glob:           1
        should be:   1
Ch_1_Glob:           A
        should be:   A
Ch_2_Glob:           B
        should be:   B
Arr_1_Glob[8]:       7
        should be:   7
Arr_2_Glob[8][7]:    1410065418
        should be:   Number_Of_Runs + 10
Ptr_Glob->
  Ptr_Comp:          984427328
        should be:   (implementation-dependent)
  Discr:             0
        should be:   0
  Enum_Comp:         2
        should be:   2
  Int_Comp:          17
        should be:   17
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Next_Ptr_Glob->
  Ptr_Comp:          984427328
        should be:   (implementation-dependent), same as above
  Discr:             0
        should be:   0
  Enum_Comp:         1
        should be:   1
  Int_Comp:          18
        should be:   18
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Int_1_Loc:           5
        should be:   5
Int_2_Loc:           13
        should be:   13
Int_3_Loc:           7
        should be:   7
Enum_Loc:            1
        should be:   1
Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
        should be:   DHRYSTONE PROGRAM, 1'ST STRING
Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
        should be:   DHRYSTONE PROGRAM, 2'ND STRING

Microseconds for one run through Dhrystone:    0.1
Dhrystones per Second:                      11345875.0

Execution ends

Final values of the variables used in the benchmark:

Int_Glob:            5
        should be:   5
Bool_Glob:           1
        should be:   1
Ch_1_Glob:           A
        should be:   A
Ch_2_Glob:           B
        should be:   B
Arr_1_Glob[8]:       7
        should be:   7
Arr_2_Glob[8][7]:    1410065418
        should be:   Number_Of_Runs + 10
Ptr_Glob->
  Ptr_Comp:          918620992
        should be:   (implementation-dependent)
  Discr:             0
        should be:   0
  Enum_Comp:         2
        should be:   2
  Int_Comp:          17
        should be:   17
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Next_Ptr_Glob->
  Ptr_Comp:          918620992
        should be:   (implementation-dependent), same as above
  Discr:             0
        should be:   0
  Enum_Comp:         1
        should be:   1
  Int_Comp:          18
        should be:   18
  Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
        should be:   DHRYSTONE PROGRAM, SOME STRING
Int_1_Loc:           5
        should be:   5
Int_2_Loc:           13
        should be:   13
Int_3_Loc:           7
        should be:   7
Enum_Loc:            1
        should be:   1
Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
        should be:   DHRYSTONE PROGRAM, 1'ST STRING
Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
        should be:   DHRYSTONE PROGRAM, 2'ND STRING

Microseconds for one run through Dhrystone:    0.1
Dhrystones per Second:                      11346788.0

[4]+  Done                       ./dhrystone 1410065408
[3]+  Done                       ./dhrystone 1410065408
[2]+  Done                       ./dhrystone 1410065408
[1]+  Done                       ./dhrystone 1410065408
/data #

如何计算

**DMIPS/MHz = Dhrystones per Second/1757/cpu主频**

cpu主频的单位是M

以当前的为例:

11321280/1757/1908=3.377
11346788/1757/1908=3.384
11345875/1757/1908=3.384
11346788/1757/1908=3.384

(3.384*3+3.377)/4~3.38

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值