« UNDERSTANDING EMBEDDED LINUX BENCHMARKING USING KERNEL TRACE ANALYSIS »
ALEXIS MARTIN
INRIA / LIG / UNIV. GRENOBLE, FRANCE
alexis.martin@inria.fr
U NDERSTANDING E MBEDDED L INUX B ENCHMARKING U SING K ERNEL T RACE - - PowerPoint PPT Presentation
U NDERSTANDING E MBEDDED L INUX B ENCHMARKING U SING K ERNEL T RACE A NALYSIS A LEXIS M ARTIN I NRIA / LIG / U NIV . G RENOBLE , F RANCE alexis.martin@inria.fr We do Need Benchmarking ! Benchmark : a standard or point of reference
alexis.martin@inria.fr
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
compared or assessed.
(new Oxford American Dictionary)
➜ Critical step in system design
2
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
3
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
➜ Help to chose the right benchmark
4
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
5
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
(openbenchmarking.org)
comparisons
6
System Processor Network Memory Graphics Disk # tests 6 79 1 2 53 12
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
system : idle, pybench, phpbench processor : scimark2, ffmpeg, compress-gzip network : network-loopback memory : stream, ramspeed disk : dbench
7
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
(Cortex-M3)
8
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
9
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
10
Number of events (in Million) 0M 1M 10M 100M 1000M Duration (in minutes) 0' 4' 8' 12' 16' 20' 24' 28' 32' 36' 40'
system processor network memory disk
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
10
Number of events (in Million) 0M 1M 10M 100M 1000M Duration (in minutes) 0' 4' 8' 12' 16' 20' 24' 28' 32' 36' 40'
system processor network memory disk
10', 45M
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
➜ We want to check if the announced family corresponds
to the computed one
11
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
12
Kernel memory system disk processor network
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
12
Kernel memory system disk processor network
mm_page_alloc mm_page_free kmem_cache_alloc …
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
12
Kernel memory system disk processor network
mm_page_alloc mm_page_free kmem_cache_alloc … rpc_bind_status sock_rcvqueue_full net_dev_xmit … scsi_eh_wakeup jbd2_commit_locking block_rq_insert … workqueue_activate_work sched_switch rcu_utilization … power_cpu_idle timer_init htimer_expire …
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
13
Event distribution % 10 20 30 40 50 60
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
13
Event distribution % 10 20 30 40 50 60
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
13
Event distribution % 10 20 30 40 50 60
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
13
Event distribution % 10 20 30 40 50 60
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015 Event distribution % 10 20 30 40 50 60
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
13
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
13
Event distribution % 10 20 30 40 50 60
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
13
Event distribution % 10 20 30 40 50 60
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
✔ ✔ ✔ ✔ ✔
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
14
benchmark
families
➜ Check the distribution of time during which the
kernel is used
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
15
✔ ✔ ✔ ✔ ✔
Time spent in kernel mode
Time distribution % 25 50 75 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
15
✔ ✔ ✔ ✔ ✔
Time spent in kernel mode
Time distribution % 25 50 75 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
65 78 63
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
15
✔ ✔ ✔ ✔ ✔
Time spent in kernel mode
Time distribution % 25 50 75 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
7 65 78 31 29 63 2
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
15
Long time spent in kernel mode ➜ Right computed family Short time spent in kernel mode ➜ Wrong computed family
✔ ✔ ✔ ✔ ✔
Time spent in kernel mode
Time distribution % 25 50 75 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
7 65 78 31 29 63 2
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
15
Long time spent in kernel mode ➜ Right computed family Short time spent in kernel mode ➜ Wrong computed family
✔ ✔ ✔ ✔ ✔
Time spent in kernel mode
Time distribution % 25 50 75 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
7 65 78 31 29 63 47 48 49 2
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
➜ Observe events by processes
16
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
17
Time distribution % 20 40 60 80 100
idle pybench phpbench scimark2 ffmpeg compress-gzip network-loopback stream ramspeed dbench
Application Phoronix LTTng Swapper Other
✔ ✔ ✔ ✔ ✔
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
17
Time distribution % 20 40 60 80 100
idle pybench phpbench scimark2 ffmpeg compress-gzip network-loopback stream ramspeed dbench
Application Phoronix LTTng Swapper Other
✔ ✔ ✔ ✔ ✔
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
17
Time distribution % 20 40 60 80 100
idle pybench phpbench scimark2 ffmpeg compress-gzip network-loopback stream ramspeed dbench
Application Phoronix LTTng Swapper Other
✔ ✔ ✔ ✔ ✔
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
17
✔ ✔ ✔ ✔ ✔
Time distribution % 20 40 60 80 100
idle pybench phpbench scimark2 ffmpeg compress-gzip network-loopback stream ramspeed dbench
Application Phoronix LTTng Swapper Other
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
17
Swapper = idle Phoronix: low intrusion ✔ ✔ ✔ ✔ ✔
Time distribution % 20 40 60 80 100
idle pybench phpbench scimark2 ffmpeg compress-gzip network-loopback stream ramspeed dbench
Application Phoronix LTTng Swapper Other
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
18
✔ ✔ ✔ ✔ ✔
Event distribution % 20 40 60 80 100
idle pybench phpbench scimark2 ffmpeg compress-gzip network-loopback stream ramspeed dbench
Application Phoronix LTTng Swapper Other
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
18
LTTng produces a huge number of events ✔ ✔ ✔ ✔ ✔
Event distribution % 20 40 60 80 100
idle pybench phpbench scimark2 ffmpeg compress-gzip network-loopback stream ramspeed dbench
Application Phoronix LTTng Swapper Other
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
➜ Overhead removed, we observe only the benchmark
19
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
20
Event distribution % 20 40 60 80 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
✔ ✔ ✔ ✔ ✔
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
20
Event distribution % 20 40 60 80 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
Stable using of kernel events ✔ ✔ ✔ ✔ ✔
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
21
Event distribution % 20 40 60 80 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
✔ ✔ ✔ ✔ ✔
Event distribution % 20 40 60 80 100
i d l e p y b e n c h p h p b e n c h s c i m a r k 2 f f m p e g c
p r e s s
z i p n e t w
k
b a c k s t r e a m r a m s p e e d d b e n c h
System Processor Network Memory Disk
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
analysis
➜ Generic way to analyze benchmarks
22
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
(soctrace-inria.github.io/framesoc/)
23
Understanding Embedded Linux Benchmarking Using Kernel Trace Analysis - Alexis Martin, ELC 2015
24