1 / 26

SIF: A Selective Instrumentation Framework for Mobile Apps

SIF: A Selective Instrumentation Framework for Mobile Apps. Shuai Hao , Ding Li, William G.J. Halfond Ramesh Govindan. Background. App Behaviors are Complex. Source: www.zdnet.com , 3/7/2013. , 2/9/2013. Source: www.zdnet.com , 6/6/2012. Motivation Design Implementation Evaluation.

colby
Download Presentation

SIF: A Selective Instrumentation Framework for Mobile Apps

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SIF: A Selective Instrumentation Framework for Mobile Apps ShuaiHao, Ding Li, William G.J. Halfond Ramesh Govindan

  2. Background App Behaviors are Complex Source: www.zdnet.com, 3/7/2013 , 2/9/2013 Source: www.zdnet.com, 6/6/2012

  3. Motivation Design ImplementationEvaluation Motivation Many Studies on App Behavior AppInsight [OSDI’12] AppInsight [OSDI’12]

  4. Motivation Design ImplementationEvaluation Motivation Many Studies on App Behavior FreeMarket [NDSS’12] FreeMarket [NDSS’12] AppInsight [OSDI’12]

  5. Motivation Design ImplementationEvaluation Motivation Many Studies on App Behavior Dr. Android [SPSM’12] FreeMarket [NDSS’12] Dr. Android [SPSM’12] AppInsight [OSDI’12] All use app instrumentation

  6. Motivation Design ImplementationEvaluation Motivation App Instrumentation Process is Complex FreeMarket Server 1 2 3 4 App Cloud Phone 6 5 Original In-App Billing Client App In-App Billing Instrumented API

  7. Goal Instrumentation Framework for Mobile Apps It raises the level of abstraction for performing app instrumentation.

  8. Approach Instrumentation Framework for Mobile Apps App Instrumentation Framework Instrumented App High-level Instrumentation Specification

  9. Requirements Survey of Recent Research Instrument Modify app Binary? what? functionality? Task Find critical paths to debug slow apps AppInsight bytecode , method, path Study vulnerability of In - App Billing service FreeMarket bytecode Support fine - grained permissions Dr. Android bytecode AdCleaner Remove ads from app bytecode Location Auditor Trace apps’ access to both user location and Internet path R2: Instrument at different levels of granularity: bytecode, method, path R1: Instrument binary R3: Permit user-specified instrumentation

  10. Requirements Survey of Recent Research R1: Instrument binary R2: Instrument at different levels of granularity: bytecode, method, path R3: Permit user-specified instrumentation

  11. Challenges Finding the Right Abstractions How to succinctly specify code paths of interest? R2: Instrument at different levels of granularity: bytecode, method, path Involves ~150,000 path! How to find the high-level abstractions for what to instrument? Gmail

  12. Challenges Providing Overhead Feedback 1 1 1 How to provide quick offline overhead feedback? 2 2 2 R3: Provide user-specified instrumentation GOOD Instr. Spec. BAD Instr. Spec. 3 3 3 4 4 4 5 5 5 Arbitrary user-level instrumentation can change execution time of instrumented app 6 6 6 CFG

  13. Novel and flexible abstractions for specifying instrumentation points Support for user-specified instrumentation with quick overhead feedback Extensive evaluation that demonstrates expressivity and efficiency Contributions SIF: Selective Instrumentation Framework

  14. Motivation Design ImplementationEvaluation SIF Workflow SIF Instrumenter App SIFScript Overhead Estimator Instrumented App High execution time Refine Overhead Feedback User

  15. Motivation Design ImplementationEvaluation SIF Abstractions Survey of Recent Research Insert before/after Replace Track paths code point code point A B à Task AppInsight FreeMarket Dr. Android AdCleaner Location Auditor Set of dynamic traces between two user-specified codepoints Operations on set of instructions that share common attributes Codepoint Set Abstraction Path Set Abstraction

  16. Motivation Design ImplementationEvaluation SIFScript AdCleaner Specify codepoint filter Instrumentation code Select target codepoints Hook with user defined code Place instrumentation User-specified instrumentation Before After

  17. Motivation Design ImplementationEvaluation SIFScript A Location Auditor 1 1 1 1 1 1 1 2 2 2 2 2 2 D C 2 2 3 3 Find API invokes to GPS 3 3 4 4 4 3 3 4 B GPS GPS 4 4 5 5 Find API invokes to INTERNET Internet Internet Internet Internet 5 5 5 Place instrumen-tation 6

  18. Motivation Design ImplementationEvaluation Realizing Path Set Abstraction A Reachability Analysis 1 • Find potential set of methods M • Invoke instructions • Class hierarchy 1 1 1 2 2 2 C D 2 4 5 3 3 3 4 4 3 4 B GPS 4 5 Internet Internet 4 5 5 5 6 M = {A, B, C, D}

  19. Motivation Design ImplementationEvaluation Realizing Path Set Abstraction Path Profiling 1 1 1 • Ball-Larus approach • Extension to inter-procedural profiler Call Site 1 2 2 2 3 3 3 Runtime Statistics - Path 1: 3 times - Path 2: 5 times 4 4 5 5 Call Site 2 6 6 6 Control Flow Graph Path 1 Path 2 Unfolding path statistics P1,P2,P2,P1,P2,P2,P1,P2 P1,CS1,CS2,P2,CS1,… Record call-site info

  20. Motivation Design ImplementationEvaluation Realizing Path Set Abstraction A A Path Stitching 1 1 1 1 1 1 1 1 Reproduce inter-procedural paths by simulated call stack analysis 2 2 2 2 2 2 D C D C 2 2 3 3 3 3 3 3 4 4 4 4 3 3 4 4 B B GPS GPS 4 4 5 5 Internet Internet Internet Internet 5 5 5 5 5 5 6 6 4 5 A: P2, CS2 C: P2, CS2 D: P1

  21. Motivation Design ImplementationEvaluation Estimating Overhead Feedback • Overhead • Instructions inserted by SIF • User-specified instrumentation code 1 User Code 6 2 3 4 Introduced Overhead User Code 6 and instruction i in 5 CFG Dynamic execution statistics e.g. by workload generator Profiled estimates for instruction execution time

  22. Motivation Design Implementation Evaluation Evaluation Overview Classical tasks: e.g. timing profiler Completeness Conciseness #Source lines of code Recent research: e.g. AppInsight , FreeMarket Instrumentation time Efficiency Runtime overhead Accuracy of overhead feedback

  23. Motivation Design Implementation Evaluation Evaluation Conciseness of SIF SIF abstractions permit concise specifications

  24. Motivation Design Implementation Evaluation Evaluation Efficiency of SIF: Runtime Overhead 0.8 4.4 0.6 1.3 1.0 0.4 SIF introduces <5% runtime overhead

  25. Motivation Design Implementation Evaluation Evaluation Efficiency of SIF: Accuracy of Overhead Feedback SIF’s estimation error is within 7%

  26. Conclusion SIF: A Selective Instrumentation Framework • Abstractions for specifying instrumentation points • Support for user-specified instrumentation with quick overhead feedback • Extensive evaluations that demonstrates expressivity and efficiency Future Work • Port SIF to other platforms • Use SIF to study various kinds of app behaviors • Extend overhead estimator to support more sophisticated instrumentation

More Related