How to improve your Tizen native program
-
Upload
ryo-jin -
Category
Technology
-
view
896 -
download
0
description
Transcript of How to improve your Tizen native program
How to improve the quality of your
tizen applications and platform
Introduction of Tizen SDK Dynamic Analyzer
S-Core Juyoung Kim ([email protected])
Co-worker: Jooyoul Lee, Jaewon Lim,
Sanghyun Lee, Woojin Jung, Hyunjong Park, Yeongtaik Byeon
and Hyungoo Kang
2 2
Why we want to improve …
Because we are not satisfied …
The improvement starts from the dissatisfaction.
Then what’s next…? Take the steps to find the solution
3 3
The Step of finding solution
Define the problem Analyze the cause Find a solution Dissatisfaction
I am not satisfied with the speed.
Where is the problem: engine or tire?
Why the engine is not fast enough?
4 4
The Step of finding solution
Define the problem Analyze the cause Find a solution Dissatisfaction
What is the cause of tilt: GOD or The ground?
5 5
The key of improvement
Define the problem Analyze the cause Find a solution Dissatisfaction
You need a Tool!!!
The Dynamic Analyzer
6
• Define the problem: Finding the optimization points
• The bottleneck point
• The waiting state
• Analyze the cause: Finding the mistake
• Leaks
• Function usage bugs
• Additional Support for
• Network programming
• OpenGL ES programming
• Demonstration
• Summary
Contents
Define the problem:
Finding the optimization points
8
• The bottleneck point
• Bottleneck: core routine, the busiest part
• Optimizing the bottleneck is one of the most effective way to make you
program fast
Finding the optimization points (1/4)
High CPU load area
1. high exclusive
CPU time
2. high exclusive
elapsed time
4. Frequently
called functions
3. high inclusive
time
9
• The bottleneck point: Multi-Thread case
• The critical path : The longest serialized path
• Optimizing the routine in this path is more effective than the other path
Finding the optimization points (2/4)
Critical Path
10
• the waiting state
• The waiting state makes your program slow when need to be fast
Finding the optimization points (3/4)
Low CPU load area
File IO wait time
Network IO wait time
Low CPU time and
high elapsed time
11
• the waiting state point: Multi-Thread case
• Waiting for critical section
Finding the optimization points (4/4)
lock waiting
Not related to this mutex
Critical section
Analyze the cause:
Finding the mistake
13
• How can I find the Leaks
• Heap chart
• Leak (candidate)
• Range based analysis
Analyzing the cause of mistake (1/2)
Valgrind in Tizen SDK IDE
• Overrunning and underrunning heap blocks.
• Overrunning the top of the stack.
• Accessing memory after it has been freed.
• Using undefined values.
• Double-freeing heap blocks.
• Mismatch of malloc/new/new[] versus free/delete/delete[].
• Overlapping src and dst pointers in memcpy-like
• Memory leaks.
See the trend
Set the range
14
• How can I find the bugs
• Failed API List
• Call trace: Function’s parameter and return value
Analyzing the cause of mistake (2/2)
Additional Support for
Network & OpenGL ES programming
16
• What is important in OpenGL
• Need to keep up a certain amount of frame rate
Support for OpenGL ES Programming (1/2)
low frame rate
long elapsed time Check unnecessary/erroneous
state changing
17
• What is important in OpenGL
• Error handling per frame
Support for OpenGL ES Programming (2/2)
Failed api existed
Error Description
Error code
18
• The pain point of network program
• Additional problems in network environment
Support for network programming (1/2)
Connection state
Connection failed
Check error code
Destination address
19
• The pain point of network program
• The miss-match of the protocol
Support for network programming (2/2)
Check the protocol
order Check the payload
contents
Demonstration
Summary
22
• Timeline Chart
• CPU load, Heap/Memory usage, Process size, UI event, File usage
• Tizen application’s lifetime, Custom chart
• Summary:
• Failed API, Leak, Function profiling, Warning
• Analysis components
• File: file lifetime analysis
• Thread: thread & synchronization analysis
• UI: Tizen UI Controls, Scene Transition History
• Others
• Call trace, Callstack
• Record & replay, Save the trace
• Source code link
• Range based analysis
• Screenshot
• New in Tizen 3.0
• Network Analysis: Connection state, Transmitted data
• OpenGL ES Analysis: Frame rate, Context Navigation
• No more build option
• Scheduling & System call information
• Support Tizen service/hybrid applications, platform libary, multi-process
The Tizen SDK Dynamic Analyzer supports...
23
• To make your program better
• The Dynamic Analyzer is indispensable
• To be continued…
• Advanced Thread Analysis
Auto detecting critical path
Concurrency level information
Thread load balancing
Deadlock detection
• Advanced OpenGL Analysis
Multi-thread/multi-context profiling
Pause and Dump
Auto detecting of wasteful and inefficient 3D operation
• Detailed profiling of Application’s launch time
• Support more for debugging
• And more …
The Next Dynamic Analyzer