Top Banner
Mobile Software Diagnostics Dmitry Vostokov Software Diagnostics Services Version 1.0 Facebook LinkedIn Twitter
25

Mobile Software Diagnostics

Feb 13, 2017

Download

Documents

Dmitry Vostokov
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mobile Software Diagnostics

Mobile Software

Diagnostics

Dmitry Vostokov Software Diagnostics Services

Version 1.0

Facebook LinkedIn Twitter

Page 2: Mobile Software Diagnostics

Prerequisites Interest in software diagnostics, troubleshooting and debugging

© 2013 Software Diagnostics Services

Page 3: Mobile Software Diagnostics

Audience Desktop/server development and

support

Mobile development and support

© 2013 Software Diagnostics Services

Page 4: Mobile Software Diagnostics

The Current State Diagnostics 20 years ago

© 2013 Software Diagnostics Services

Page 5: Mobile Software Diagnostics

The Trend (Hardware)

© 2013 Software Diagnostics Services

Power

Time

Desktop

Mobile

Page 6: Mobile Software Diagnostics

The Trend (Software)

© 2013 Software Diagnostics Services

Memory

Diagnostics Tools

Trace and Log Analysis Memory Dump Analysis

Trace and Log Analysis Memory Dump Analysis

MessageBox

Page 7: Mobile Software Diagnostics

The Vision Pattern-Oriented Diagnostics Unified Pattern Catalogues

© 2013 Software Diagnostics Services

Page 8: Mobile Software Diagnostics

Software Diagnostics

A discipline studying abnormal software structure and behavior in software execution artifacts (such as memory dumps, software and network traces and logs) using pattern-driven and pattern-based analysis methodologies.

© 2013 Software Diagnostics Services

Page 9: Mobile Software Diagnostics

Diagnostics Pattern

A common recurrent identifiable problem together with a set of recommendations and possible solutions to apply in a specific context.

© 2013 Software Diagnostics Services

Page 10: Mobile Software Diagnostics

Pattern Orientation

© 2013 Software Diagnostics Services

Page 11: Mobile Software Diagnostics

Pattern-Driven

Finding patterns in software artefacts

Using checklists and pattern catalogs

© 2013 Software Diagnostics Services

Page 12: Mobile Software Diagnostics

Pattern-Based Pattern evolution

Catalogue evolution

Catalogue distribution

© 2013 Software Diagnostics Services

Page 13: Mobile Software Diagnostics

Economic Benefits Improved communication of

diagnostics reports using uniform pattern language

Increased productivity by systematic pattern usage

Increased quality by leveraging existing expertise

Support for global teams Quantifiable analysis

© 2013 Software Diagnostics Services

Page 14: Mobile Software Diagnostics

Native/Hybrid/Web Apps

© 2013 Software Diagnostics Services

iOS _______

Mac OS X

Android _______

Linux

WP _______

Windows 8

Pattern Catalogs

Pattern Implementation

Pattern Implementation

Pattern Implementation

Web _______

JS

Pattern Implementation

Page 15: Mobile Software Diagnostics

Stack Trace Collection

© 2013 Software Diagnostics Services

09-08 22:38:11.569: V/AudioHardwareMSM72XX(94): count : 4800 09-08 22:38:11.739: W/AudioFlinger(94): write blocked for 169 msecs, 1549 delayed writes, thread 0xccd0 09-08 22:38:14.309: I/System.out(21804): --- Stack Trace Collection --- 09-08 22:38:14.309: I/System.out(21804): Thread[JDWP,5,system]: 09-08 22:38:14.309: I/System.out(21804): dalvik.system.NativeStart.run(Native Method) 09-08 22:38:14.319: I/System.out(21804): Thread[GC,5,system]: 09-08 22:38:14.319: I/System.out(21804): dalvik.system.NativeStart.run(Native Method) 09-08 22:38:14.319: I/System.out(21804): Thread[Signal Catcher,5,system]: 09-08 22:38:14.319: I/System.out(21804): dalvik.system.NativeStart.run(Native Method) 09-08 22:38:14.319: I/System.out(21804): Thread[main,5,main]: 09-08 22:38:14.319: I/System.out(21804): android.os.MessageQueue.nativePollOnce(Native Method) 09-08 22:38:14.319: I/System.out(21804): android.os.MessageQueue.next(MessageQueue.java:119) 09-08 22:38:14.319: I/System.out(21804): android.os.Looper.loop(Looper.java:117) 09-08 22:38:14.319: I/System.out(21804): android.app.ActivityThread.main(ActivityThread.java:3687) 09-08 22:38:14.319: I/System.out(21804): java.lang.reflect.Method.invokeNative(Native Method) 09-08 22:38:14.319: I/System.out(21804): java.lang.reflect.Method.invoke(Method.java:507) 09-08 22:38:14.319: I/System.out(21804): com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) 09-08 22:38:14.319: I/System.out(21804): com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) 09-08 22:38:14.319: I/System.out(21804): dalvik.system.NativeStart.main(Native Method) 09-08 22:38:14.319: I/System.out(21804): Thread[HeapWorker,5,system]: 09-08 22:38:14.319: I/System.out(21804): dalvik.system.NativeStart.run(Native Method) 09-08 22:38:14.319: I/System.out(21804): Thread[Compiler,5,system]: 09-08 22:38:14.319: I/System.out(21804): dalvik.system.NativeStart.run(Native Method) 09-08 22:38:14.319: I/System.out(21804): Thread[Binder Thread #1,5,main]: 09-08 22:38:14.319: I/System.out(21804): dalvik.system.NativeStart.run(Native Method) 09-08 22:38:14.319: I/System.out(21804): Thread[Thread-10,5,main]: 09-08 22:38:14.319: I/System.out(21804): dalvik.system.VMStack.getThreadStackTrace(Native Method) 09-08 22:38:14.329: I/System.out(21804): java.lang.Thread.getStackTrace(Thread.java:737) 09-08 22:38:14.329: I/System.out(21804): java.lang.Thread.getAllStackTraces(Thread.java:630) 09-08 22:38:14.329: I/System.out(21804): com.example.deadlock.FullscreenActivity$3.run(FullscreenActivity.java:67) 09-08 22:38:14.329: I/System.out(21804): java.lang.Thread.run(Thread.java:1019) 09-08 22:38:14.329: I/System.out(21804): Thread[Binder Thread #2,5,main]: 09-08 22:38:14.329: I/System.out(21804): dalvik.system.NativeStart.run(Native Method) 09-08 22:38:14.329: I/System.out(21804): --- end ---

Android / Java example

Page 16: Mobile Software Diagnostics

Memory Analysis Patterns Not limited to memory dumps

Can be applied to traces / logs

© 2013 Software Diagnostics Services

Memory dumps Scripts Debugger

logs

Page 17: Mobile Software Diagnostics

Problem No / Limited memory dump analysis

Limited OS debugger support

© 2013 Software Diagnostics Services

Page 18: Mobile Software Diagnostics

Solution State Dump trace analysis pattern

Paratext memory analysis pattern

© 2013 Software Diagnostics Services

Page 19: Mobile Software Diagnostics

State Dump

© 2013 Software Diagnostics Services

Time# PID TID Time Message

stack traces variables status reports

Page 20: Mobile Software Diagnostics

Paratext

© 2013 Software Diagnostics Services

$ ps -t ps -t USER PID PPID VSIZE RSS WCHAN PC NAME […] app_42 24101 24100 137696 15756 ffffffff 00000000 S HeapWorker app_42 24102 24100 137696 15756 ffffffff 00000000 S GC app_42 24103 24100 137696 15756 ffffffff 00000000 S Signal Catcher app_42 24104 24100 137696 15756 ffffffff 00000000 S Compiler app_42 24105 24100 137696 15756 ffffffff 00000000 S Binder Thread # app_42 24106 24100 137696 15756 ffffffff 00000000 S Binder Thread # app_42 24107 24100 137696 15756 ffffffff 00000000 S Binder Thread # app_57 24109 93 146876 19268 ffffffff 00000000 S com.example.spikingthread app_57 24110 24109 146876 19268 ffffffff 00000000 S HeapWorker app_57 24111 24109 146876 19268 ffffffff 00000000 S GC app_57 24112 24109 146876 19268 ffffffff 00000000 S Signal Catcher app_57 24113 24109 146876 19268 ffffffff 00000000 S JDWP app_57 24114 24109 146876 19268 ffffffff 00000000 S Compiler app_57 24115 24109 146876 19268 ffffffff 00000000 S Binder Thread # app_57 24116 24109 146876 19268 ffffffff 00000000 S Binder Thread # app_57 24117 24109 146876 19268 ffffffff 00000000 S Thread-10 app_57 24122 24109 146876 19268 ffffffff 00000000 R Thread-11 shell 24123 143 800 336 c00a6fc8 afd0c3bc S /system/bin/sh root 24125 2 0 0 ffffffff 00000000 S flush-138:14 root 24126 2 0 0 ffffffff 00000000 S flush-179:0

Android / Java example

Page 21: Mobile Software Diagnostics

Mobile DA+TA Dump Analysis

Memory analysis patterns

Trace Analysis Trace analysis patterns

© 2013 Software Diagnostics Services

Page 22: Mobile Software Diagnostics

Mobile: Another Meaning

© 2013 Software Diagnostics Services

Page 24: Mobile Software Diagnostics

Q&A

Please send your feedback using the contact form on PatternDiagnostics.com

© 2013 Software Diagnostics Services

Page 25: Mobile Software Diagnostics

Thank you for attendance!

© 2013 Software Diagnostics Services