H a r d w a r e - a s s i s t e d s o f t w a r e t r a c i n g A d r i e n V e r g é a d r i e n v e r g e @ g m a i l . c o m
t a l k a b o u t t r a c i n g
i m p r o v e t r a c i n g u s i n g h a r d w a r e
1 T r a c i n g 2 H a r d w a r e 3 I m p r o v e m e n t s
1 T r a c i n g
“ a t e c h n i q u e u s e d t o u n d e r s t a n d w h a t i s g o i n g o n i n a s y s t e m i n o r d e r t o d e b u g o r m o n i t o r i t ”
r e c o r d i n g e v e n t s I R Q h a n d l e r s , s y s t e m c a l l s , f r o m t h e k e r n e l : s c h e d u l i n g a c t i v i t y , n e t w o r k a c t i v i t y , e t c . i n u s e r - s p a c e : t r a c e p o i n t s i n s i d e y o u r a p p l i c a t i o n
W h y i s m y s o f t w a r e c r a s h i n g ? W h e r e a r e t h e b o t t l e n e c k s ? H o w t o i m p r o v e p e r f o r m a n c e ? u s e l e s s r e s o u r c e s r u n f a s t e r s a v e b a t t e r y
e l p a p r o c e s s s p a w n s 2 t h r e a d s : m a # 1 p r o d u c e s c h u n k s o f d a t a x e t h a t # 2 c o n s u m e s p r o c e s s p r o c e s s t h r e a d 1 t h r e a d 1 t h r e a d 2 t h r e a d 2 t i m e
e x a m p l e : L T T n g + T M F 12:40:48.500 12:40:48.600 12:40:48.700 Process TID PTID bottleneck 26242 26226 bottleneck 26243 26242 bottleneck 26244 26242 12:40:48.500 12:40:48.600 12:40:48.700 CPU 0 CPU 1 CPU 2 CPU 3 CPU 4 CPU 5 CPU 6 CPU 7 IRQ 44 IRQ 46 IRQ 43 WAIT_BLOCKED SOFT_IRQ 9 WAIT_FOR_CPU SOFT_IRQ 4 USERMODE SOFT_IRQ 1 SYSCALL SOFT_IRQ 7 INTERRUPTED
e x a m p l e : L T T n g + T M F 12:40:48.500 12:40:48.600 12:40:48.700 Process TID PTID bottleneck 26242 26226 bottleneck 26243 26242 bottleneck 26244 26242 e execve c c m m WAIT_BLOCKED WAIT_FOR_CPU USERMODE SYSCALL INTERRUPTED
e x a m p l e : L T T n g + T M F 12:40:48.500 12:40:48.600 12:40:48.700 Process TID PTID bottleneck 26242 26226 bottleneck 26243 26242 bottleneck 26244 26242 exec read WAIT_BLOCKED WAIT_FOR_CPU USERMODE SYSCALL INTERRUPTED
e x a m p l e : L T T n g + T M F 12:40:48.500 12:40:48.600 12:40:48.700 Process TID PTID bottleneck 26242 26226 bottleneck 26243 26242 bottleneck 26244 26242 exec read write wri read write WAIT_BLOCKED WAIT_FOR_CPU USERMODE SYSCALL INTERRUPTED
t r a c i n g : r e c o r d i n g e v e n t s f o r u s e i n f u r t h e r a n a l y s i s
t r a c i n g : r e c o r d i n g e v e n t s f o r u s e i n f u r t h e r a n a l y s i s S o i t ' s j u s t l o g g i n g ?
t r a c i n g l o g g i n g v s . c o m p a c t b i n a r y t r a c e f o r m a t b u f f e r i n g — a v o i d d i s k I O l o c k l e s s a l g o r i t h m s l o w - l e v e l o p t i m i z a t i o n s r e s u l t : ~ 2 0 0 µ s v s . ~ 2 0 0 n s / e v e n t
s r d d i n a a t r o o u l l s i o k k n e r r o o s s r r w w d e e e t y y v v e c v v r r t s i a a e e o n e e s s h h u eI B M G o o g l g n i c A u t o d e s k a r O P A L - R T C A E t r e a l - t i m e
s r d d i n a a t r o o u l l s i o k k n e r r o o s s r r w w d e e e t y y v v e c v v r r t s i a a e e o n e e s s h h u eI B M G o o g l g S i e m e n s S T M i c r o e l e c t r o n i c s n i F r e e s c a l e W i n d R i v e r c A u t o d e s k M o n t a v i s t a a r O P A L - R T E r i c s s o n C A E t d e d N o k i a d e r b e a s l - t m i m m e e e t s y s
s r d d i n a a t r o o u l l s i o k k n e r r o o s s r r w w d e e e t y y v v e c v v r r t s i a a e e o n e e s s h h u eI B M G o o g l g S i e m e n s S T M i c r o e l e c t r o n i c s n i F r e e s c a l e W i n d R i v e r c A u t o d e s k Y O U ! M o n t a v i s t a a r O P A L - R T E r i c s s o n C A E t d e d N o k i a d e r b e a s l - t m i m m e e e t s y s
B e y o n d H e i s e n b e r g : o b s e r v e w i t h o u t a l t e r i n g s d l i g h t f a s t — p e r f o r m ( s i z e ) a n d ( t i m e ) e e m e m o r y — d o n ' t p o l l u t e s p a c e n t h o u s a n d s — o f e v e n t s / s
2 H a r d w a r e
n o l o n g e r M i c r o c h i p s a r e C P U j u s t s credit: ARM
l o t s o f t r a c i n g u n i t s F r e e s c a l e ( P o w e r P C ) N e x u s P r o g r a m T r a c e , A R M D a t a A c q u i s i t i o n . . . C o r e S i g h t I n t e l ( x 8 6 ) E T M , E T B , S T M . . . B T S , L B R , P T . . .
l o t s o f t r a c i n g u n i t s S T M ( e v e n t t r a c i n g ) E T M ( e x e c u t i o n t r a c i n g ) B T S ( e x e c u t i o n t r a c i n g )
l o t s o f t r a c i n g u n i t s s u p p o r t e d b y ( p r o b a b l y g o o d ) p r o p r i e t a r y s o f t w a r e
D o y o w u i h d a e v l e y o s n p e r o e f a t d h e s e ? credit: Samsung, tabletolic.com, player.de, digitaltrends.com
w i d e l y s p r e a d credit: Intel I s y o u r I n t e l C P U n e w e r t h a n t h i s o n e ?
3 I m p r o v e m e n t s
3 I m p r o v e m e n t s 1 / 3 S T M o n A R M
S y s t e m T r a c e M o d u l e ( S T M ) h e l p s o f t w a r e G o a l : r e c o r d i n g e v e n t s
S y s t e m T r a c e M o d u l e ( S T M ) P r o v i d e s d e d i c a t e d r e s o u r c e s b u s , b u f f e r , t i m e s t a m p i n g N e e d t o i n s t r u m e n t s o f t w a r e
S y s t e m T r a c e M o d u l e ( S T M ) system bus STM ETB ETM CPU timestamping system-on-chip
n o i “ L T T n g - e q u i v a l e n t ” t a t n T h e t r a c e d p r o c e s s i s i n s t r u m e n t e d : e c a l l i n g t r a c e p o i n t ( ) w r i t e s t o t h e S T M . m e l E m b e d d i n g p a y l o a d i s p o s s i b l e . p A c o n s u m e r p r o c e s s r e t r i e v e s m i g e n e r a t e d t r a c e s a n d s t o r e s t h e m .
n o i T r a c e s a r e S T P t a t e n c o d e d i n . n e m e l o p t i m i z e d , c o m p a c t b u t p p r o p r i e t a r y f o r m a t m i
s t l i n d i c a t i v e b e n c h m a r k : o v e r h e a d m o s t l y d e p e n d s o n t h e t r a c e d a p p l i c a t i o n ! u 20 s no tracing e LTTng-UST r STM + ETB 15 time per iteration (µs) 10 5 0 only tracepoints computation + tracepoints
s t l u 20 s no tracing e LTTng-UST r STM + ETB 15 time per iteration (µs) 10 5 0 only tracepoints computation + tracepoints
3 I m p r o v e m e n t s 2 / 3 E T M o n A R M
E m b e d d e d T r a c e M a c r o c e l l ( E T M ) t r a c e G o a l : e x e c u t i o n
E m b e d d e d T r a c e M a c r o c e l l ( E T M ) t r a c e G o a l : e x e c u t i o n i . e . s a v e e v e r y e x e c u t e d i n s t r u c t i o n a d d r e s s
E m b e d d e d T r a c e M a c r o c e l l ( E T M ) P r o v i d e s d e d i c a t e d r e s o u r c e s a d d r e s s c o m p a r a t o r s , b u f f e r , t i m e s t a m p i n g
Recommend
More recommend