how to improve your tizen native program

24
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

Upload: ryo-jin

Post on 15-May-2015

895 views

Category:

Technology


0 download

DESCRIPTION

The Dynamic Analyzer in Tizen SDK, helps the developers to improve the performance and stability of their application easily. With the following demo, you can find the bottleneck point, unstable usage of memory, file, thread, network, openGL and functions of application and library. Some of them are done by automatically and some are by manually but easily. With the debugger, you must pause the application at a certain point to analyze, and it is still hard to get statistical and analytic information. This tool will resolve these regret, and make yourselves experience wider view of application analysis. For the more, this tool have the potential to add more applicable ideas of analysis.

TRANSCRIPT

Page 1: 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

Page 2: How to improve your Tizen native program

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

Page 3: How to improve your Tizen native program

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?

Page 4: How to improve your Tizen native program

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?

Page 5: How to improve your Tizen native program

5 5

The key of improvement

Define the problem Analyze the cause Find a solution Dissatisfaction

You need a Tool!!!

The Dynamic Analyzer

Page 6: How to improve your Tizen native program

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

Page 7: How to improve your Tizen native program

Define the problem:

Finding the optimization points

Page 8: How to improve your Tizen native program

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

Page 9: How to improve your Tizen native program

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

Page 10: How to improve your Tizen native program

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

Page 11: How to improve your Tizen native program

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

Page 12: How to improve your Tizen native program

Analyze the cause:

Finding the mistake

Page 13: How to improve your Tizen native program

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

Page 14: How to improve your Tizen native program

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)

Page 15: How to improve your Tizen native program

Additional Support for

Network & OpenGL ES programming

Page 16: How to improve your Tizen native program

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

Page 17: How to improve your Tizen native program

17

• What is important in OpenGL

• Error handling per frame

Support for OpenGL ES Programming (2/2)

Failed api existed

Error Description

Error code

Page 18: How to improve your Tizen native program

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

Page 19: How to improve your Tizen native program

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

Page 20: How to improve your Tizen native program

Demonstration

Page 21: How to improve your Tizen native program

Summary

Page 22: How to improve your Tizen native program

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...

Page 23: How to improve your Tizen native program

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

Page 24: How to improve your Tizen native program