Statistical Debugging for Real-World Performance Problems. Linhai Song Advisor: Prof. Shan Lu

Similar documents
Statistical Debugging for Real-World Performance Problems

Diagnosing Production-Run Concurrency-Bug Failures. Shan Lu University of Wisconsin, Madison

Leveraging the Short-Term Memory of Hardware to Diagnose Production-Run Software Failures. Joy Arulraj, Guoliang Jin and Shan Lu

Production-Run Software Failure Diagnosis via Hardware Performance Counters. Joy Arulraj, Po-Chun Chang, Guoliang Jin and Shan Lu

High Performance Computing and Programming, Lecture 3

Automated Adaptive Bug Isolation using Dyninst. Piramanayagam Arumuga Nainar, Prof. Ben Liblit University of Wisconsin-Madison

Understanding, Detecting, and Diagnosing Real-World Performance Bugs

PerfGuard: Binary-Centric Application Performance Monitoring in Production Environments

Understanding and Detecting Real-World Performance Bugs

Chip-Multithreading Systems Need A New Operating Systems Scheduler

Profile-Guided Program Simplification for Effective Testing and Analysis

Production-Run Software Failure Diagnosis via Hardware Performance Counters

Transaction Memory for Existing Programs Michael M. Swift Haris Volos, Andres Tack, Shan Lu, Adam Welc * University of Wisconsin-Madison, *Intel

M2 Instruction Set Architecture

Automated Documentation Inference to Explain Failed Tests

Optimizing Your Android Applications

CFix. Automated Concurrency-Bug Fixing. Guoliang Jin, Wei Zhang, Dongdong Deng, Ben Liblit, and Shan Lu. University of Wisconsin Madison

Do you have to reproduce the bug on the first replay attempt?

Dynamically Detecting and Tolerating IF-Condition Data Races

S/W Programming & Languages

Introduction. CS 2210 Compiler Design Wonsun Ahn

Sequential Consistency & TSO. Subtitle

Fundamentals of Programming

DAVE TM & DAVE TM SDK

ART JIT in Android N. Xueliang ZHONG Linaro ART Team

Advanced RDMA-based Admission Control for Modern Data-Centers

CS 2113 Software Engineering

Processors, Performance, and Profiling

Some possible directions for the R engine

Agile Software Development. Lecture 7: Software Testing

Triangle SQL Server User Group Adaptive Query Processing with Azure SQL DB and SQL Server 2017

Software-Controlled Multithreading Using Informing Memory Operations

Understanding the latent value in all content

DefDroid: Towards a More Defensive Mobile OS Against Disruptive App Behavior

Run-time Environments - 3

Outline EEL 5764 Graduate Computer Architecture. Chapter 3 Limits to ILP and Simultaneous Multithreading. Overcoming Limits - What do we need??

EZY Intellect Pte. Ltd., #1 Changi North Street 1, Singapore

H.-S. Oh, B.-J. Kim, H.-K. Choi, S.-M. Moon. School of Electrical Engineering and Computer Science Seoul National University, Korea

Path-based Macroanalysis for Large Distributed Systems

Using Intel VTune Amplifier XE and Inspector XE in.net environment

Autotuning. John Cavazos. University of Delaware UNIVERSITY OF DELAWARE COMPUTER & INFORMATION SCIENCES DEPARTMENT

Multi-Channel Clustered Web Application Servers

TraceBack: First Fault Diagnosis by Reconstruction of Distributed Control Flow

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

Analysis and Modeling of Evolving Database-centric Web Applications

MULTI-CORE PROGRAMMING. Dongrui She December 9, 2010 ASSIGNMENT

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Protocol Buffers, grpc

Proposal To Include Java. As A Language For The IOI.

Cooperative Bug Isolation

Optimize Data Structures and Memory Access Patterns to Improve Data Locality

CS113: Lecture 7. Topics: The C Preprocessor. I/O, Streams, Files

Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 13, 2012 Managed by UT-Battelle for the Department of Energy

Software Tools for Low-Level Software and Operating Systems Classes. Max Walter & Sven Karlsson Technical University of Denmark

Testing, code coverage and static analysis. COSC345 Software Engineering

C introduction: part 1

CS3350B Computer Architecture CPU Performance and Profiling

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

AMCAT Automata Coding Sample Questions And Answers

for Loop Lesson 3 Outline

Repair & Refactoring

SCALABLE, LOW LATENCY MODEL SERVING AND MANAGEMENT WITH VELOX

CMSC 411 Computer Systems Architecture Lecture 13 Instruction Level Parallelism 6 (Limits to ILP & Threading)

Systems Architecture. Monolithic Systems

Under the Compiler's Hood: Supercharge Your PLAYSTATION 3 (PS3 ) Code. Understanding your compiler is the key to success in the gaming world.

CS2141 Software Development using C/C++ Debugging

Huge market -- essentially all high performance databases work this way

Dynamic Languages Strike Back. Steve Yegge Stanford EE Dept Computer Systems Colloquium May 7, 2008

Oracle Database 12c: Performance Management and Tuning

HPC Lab. Session 4: Profiler. Sebastian Rettenberger, Chaulio Ferreira, Michael Bader. November 9, 2015

CYSE 411/AIT 681 Secure Software Engineering Topic #14. Program Analysis

9/5/17. The Design and Implementation of Programming Languages. Compilation. Interpretation. Compilation vs. Interpretation. Hybrid Implementation

Row Buffer Locality Aware Caching Policies for Hybrid Memories. HanBin Yoon Justin Meza Rachata Ausavarungnirun Rachael Harding Onur Mutlu

Truffle A language implementation framework

Optimization of Vertical and Horizontal Beamforming Kernels on the PowerPC G4 Processor with AltiVec Technology

Project 0: Implementing a Hash Table

COMP-202. Recursion. COMP Recursion, 2011 Jörg Kienzle and others

Performance Profiling

From bottom to top: Exploiting hardware side channels in web browsers

Inner Oracles: Input- Specific Assertions on Internal States

Figure 1 Common Sub Expression Optimization Example

OASIS: Self-tuning Storage for Applications

The new Ehcache and Hibernate Caching SPI Provider

Jazz: A Tool for Demand-Driven Structural Testing

Visualizing the out-of-order CPU model. Ryota Shioya Nagoya University

Manual Trigger Sql Server 2008 Examples Insert Update

Announcements. PS 3 is out (see the usual place on the course web) Be sure to read my notes carefully Also read. Take a break around 10:15am

Top Ten Enterprise Java performance problems. Vincent Partington Xebia

Testing. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 13

SQLite Page Caching Algorithm

Development tools: Version control, build tools, and integrated development environments 1

TERN: Stable Deterministic Multithreading through Schedule Memoization

CSci 4061 Introduction to Operating Systems. Programs in C/Unix

Announcements. Working on requirements this week Work on design, implementation. Types. Lecture 17 CS 169. Outline. Java Types

Array Initialization

Performance Evaluation of Virtualization Technologies

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

High Performance Computing Lecture 1. Matthew Jacob Indian Institute of Science

HW1 due Monday by 9:30am Assignment online, submission details to come

Chapter 11 Introduction to Programming in C

Transcription:

Statistical Debugging for Real-World Performance Problems Linhai Song Advisor: Prof. Shan Lu 1

Software Efficiency is Critical No one wants slow and inefficient software Frustrate end users Cause economic loss Software efficiency is increasingly important Hardware is not getting faster (per-core) Software is getting more complex Energy saving is getting more urgent Still Not Finished?

Performance Bugs Implementation mistakes causing inefficiency An example rows=0 causing no cache allocated MySQL Bug DB void ha_partition::start_bulk_insert(int rows) {. - if (!rows) - DBUG_VOID_RETURN; - rows= rows/m_tot_parts + 1; + rows= rows? rows/m_tot_parts + 1 : 0;. // fast path using caches } MySQL Bug 26527 20 X Slower

How to Diagnose Performance Bugs Difficult to avoid Lack performance documentation for APIs Workloads are quickly changing Diagnosis tools are needed The state of the art is preliminary Profilers void ha_partition::start_bulk_insert(int rows) {. - if (!rows) Not in profiling results - DBUG_VOID_RETURN; - rows= rows/m_tot_parts + 1; + rows= rows? rows/m_tot_parts + 1 : 0;. // fast path using caches } MySQL Bug 26527

How to Diagnose Functional Bugs The state of the art is mature Has been studied for decades Many successful techniques have been proposed Statistical debugging Input: Program: Symptom: Bad Good int i = 0; int j = 10; int k = fopen( ); if (p==null) printf( %s\n, p->str); failure Predicates B: p==null R: k > 0 S: i<j Predicates B: p!=null R: k > 0 S: i<j Statistical Model Rank Predicates Score 1 B:p==NULL

What Can We Learn? How about statistical debugging Input: Program: Symptom: Q1: How to identify failure runs? Q2: How to obtain inputs? Q3: How to design predicates? Q2? Bad int i = 0; int j = 10; int k = fopen( ); if (p==null) printf( %s\n, p->str); failure Good Q1? Predicates B: p==null R: k > 0 S: i<j Predicates B: p!=null R: k > 0 S: i<j Q3? Statistical Model Rank Predicates Score 1 B:p==NULL

Contributions Diagnosis process for performance bugs Performance problems are noticed by comparison Inputs are provided during reporting Statistical in-house performance diagnosis 3 popular predicates 2 widely used statistical models Statistical on-line performance diagnosis Same diagnosis capability with <10% overhead Not sacrifice diagnosis latency

Outline Overview Diagnosis process study In-house diagnosis study On-line diagnosis study Conclusion

Outline Overview Diagnosis process study In-house diagnosis study On-line diagnosis study Conclusion

Outline Overview Diagnosis process study In-house diagnosis study On-line diagnosis study Conclusion

Methodology Application and Bug Source App. Apache Software Type Command-line Utility + Server + Library Language C/Java MLOC 0.45 Bug DB History 13 y Tags N/A # Bugs 25 # Bug User Perceived 16 Chrome GUI Application C/C++ 14.0 4 y N/A 10 5 GCC Compiler C/C++ 5.7 13 y Compiletime-hog 11 9 Mozilla GUI Application C++/JS 4.7 14 y perf 36 19 MySQL Server Software C/C++/C# 1.3 10 y S5 28 17 Total: 110 65

Q1: How to identify failure runs? How about statistical debugging Q1: How to identify failure runs? Input: Program: Bad Good int i = 0; int j = 10; int k = fopen( ); if (p==null) printf( %s\n, p->str); Symptom: failure Q1? Predicates B: p==null R: k > 0 S: i<j Predicates B: p!=null R: k > 0 S: i<j Statistical Model Rank Predicates Score 1 B:p==NULL

How Perf. Bugs are Observed Dominating 40 30 MySQL 20 10 0 within one code base cross multiple code bases Not using comparison Mozilla GCC Chrome Apache

How Perf. Bugs are Observed the same input with different configuration inputs with different sizes inputs with slightly different functionality 40 30 MySQL 20 10 0 within one code base cross multiple code bases Not using comparison Mozilla GCC Chrome Apache

How Perf. Bugs are Observed same applications different versions different applications 40 30 MySQL 20 10 0 within one code base cross multiple code bases Not using comparison Mozilla GCC Chrome Apache

How Perf. Bugs are Observed 40 30 MySQL 20 10 0 within one code base cross multiple code bases Not using comparison Mozilla GCC Chrome Apache

Q2: How to obtain inputs? How about statistical debugging Q1: How to identify failure runs? Q2: How to obtain inputs? Input: Program: Symptom: Q2? Bad int i = 0; int j = 10; int k = fopen( ); if (p==null) printf( %s\n, p->str); failure Good Predicates B: p==null R: k > 0 S: i<j Predicates B: p!=null R: k > 0 S: i<j Statistical Model Rank Predicates Score 1 B:p==NULL

Bad Inputs Provided in Bug Reports Cover all bugs 50 40 30 20 10 0 1/? n/? MySQL Mozilla GCC Chrome Apache

Good Inputs Provided in Bug Reports Good inputs provided 35 30 25 20 15 10 5 0?/0?/1?/n MySQL Mozilla GCC Chrome Apache

Implications Performance bugs are observed differently Noticed through comparison Easy to tell successful runs from failure runs Case 1: through comparison Case 2: symptom is dramatic Statistical debugging is a natural fit

Outline Overview Diagnosis process study In-house diagnosis study On-line diagnosis study Conclusion

Outline Overview Diagnosis process study In-house diagnosis study On-line diagnosis study Conclusion

Design In-house diagnosis Predicate design Branch if (p) else. Predicate

Design In-house diagnosis Predicate design Branch Return if (p) else. n=fprintf( ); Predicate

Design In-house diagnosis Predicate design Branch Return Scalar-pair if (p) else. n=fprintf( ); int i, j, k; i = ; Predicate

Design In-house diagnosis Predicate design Branch Return Scalar-pair if (p) else. Statistical model design n=fprintf( ); int i, j, k; i = ; Predicate Model

Design In-house diagnosis Predicate design Branch Return Scalar-pair Statistical model design Basic model if (p) else. n=fprintf( ); int i, j, k; i = ; Predicate Model

Design In-house diagnosis Predicate design Branch Return Scalar-pair Statistical model design Basic model Delta-LDA if (p) else. n=fprintf( ); int i, j, k; i = ; Predicate Model

Experimental Methodology Benchmark selection 8 C bugs, 8 C++ bugs and 4 Java bugs Input design and other setting 10 failure and 10 successful runs Techniques under comparison CBI for C programs Pin for C++ programs Compared with profiling results from OProfile

Experimental Results Candidate Predicates Basic Model ΔLDA Profiler BugID Branch Return S-pair Branch Return S-pair Branch Mozilla258793 64024 152724 / 1 - / - - Mozilla299742 64089 150973 / 1 - / - - Mozilla347306 6901 6729 30953 - - - 1 1 Mozilla411722 8780 6889 34378 1 - - - - MySQL15811 1198 886 / - - / 1 1 MySQL26527 7443 7631 / 1 - / - - MySQL27287 5377 5762 / - - / 1 1 MySQL40337 7547 8161 / 1 - / - - MySQL42649 15920 11800 / 1 - / - - MySQL44723 10649 9130 / 1 - / - - Apache3278 7 57 102-1 - - - Apache34464 17 23 203 - - - 3 5

Experimental Results Candidate Predicates Basic Model ΔLDA Profiler BugID Branch Return S-pair Branch Return S-pair Branch Mozilla258793 64024 152724 / 1 - / - - Mozilla299742 64089 150973 / 1 - / - - Mozilla347306 6901 6729 30953 - - - 1 1 Mozilla411722 8780 6889 34378 1 - - - - MySQL15811 1198 886 / - - / 1 1 MySQL26527 7443 7631 / 1 - / - - MySQL27287 5377 5762 / - - / 1 1 MySQL40337 7547 8161 / 1 - / - - MySQL42649 15920 11800 / 1 - / - - MySQL44723 10649 9130 / 1 - / - - Apache3278 7 57 102-1 - - - Apache34464 17 23 203 - - - 3 5

Experimental Results Candidate Predicates Basic Model ΔLDA Profiler BugID Branch Return S-pair Branch Return S-pair Branch Mozilla258793 64024 152724 / 1 - / - - Mozilla299742 64089 150973 / 1 - / - - Mozilla347306 6901 6729 30953 - - - 1 1 Mozilla411722 8780 6889 34378 1 - - - - MySQL15811 1198 886 / - - / 1 1 MySQL26527 7443 7631 / 1 - / - - MySQL27287 5377 5762 / - - / 1 1 MySQL40337 7547 8161 / 1 - / - - MySQL42649 15920 11800 / 1 - / - - MySQL44723 10649 9130 / 1 - / - - Apache3278 7 57 102-1 - - - Apache34464 17 23 203 - - - 3 5

Experimental Results Candidate Predicates Basic Model ΔLDA Profiler BugID Branch Return S-pair Branch Return S-pair Branch Mozilla258793 64024 152724 / 1 - / - - Mozilla299742 64089 150973 / 1 - / - - Mozilla347306 6901 6729 30953 - - - 1 1 Mozilla411722 8780 6889 34378 1 - - - - MySQL15811 1198 886 / - - / 1 1 MySQL26527 7443 7631 / 1 - / - - MySQL27287 5377 5762 / - - / 1 1 MySQL40337 7547 8161 / 1 - / - - MySQL42649 15920 11800 / 1 - / - - MySQL44723 10649 9130 / 1 - / - - Apache3278 7 57 102-1 - - - Apache34464 17 23 203 - - - 3 5

Outline Overview Diagnosis process study In-house diagnosis study On-line diagnosis study Conclusion

Outline Overview Diagnosis process study In-house diagnosis study On-line diagnosis study Conclusion

Experimental Methodology Challenges in on-line diagnosis Diagnosis capability Low overhead Benchmarks and inputs Tool implementation CBI in sampling mode for return predicates LBR for branch predicates Rough sampling rate is 1/100

Experimental Results BugID Diagnosis Capability Overhead Requested Failure Runs Mozilla258793 1 1.81% 1000 Mozilla299742 1 7.52% 1000 Mozilla347306 1 3.01% 10 Mozilla411722 1 3.35% 1000 MySQL15811 1 8.58% 10 MySQL26527 1 7.06% 1000 MySQL27287 1 2.62% 10 MySQL40337 1 3.32% 1000 MySQL42649 1 4.67% 1000 MySQL44723 1 0.40% 1000 Apache3278 1 3.22% 1000 Apache34464 1 2.13% 10

Experimental Results BugID Diagnosis Capability Overhead Requested Failure Runs Mozilla258793 1 1.81% 1000 Mozilla299742 1 7.52% 1000 Mozilla347306 1 3.01% 10 Mozilla411722 1 3.35% 1000 MySQL15811 1 8.58% 10 MySQL26527 1 7.06% 1000 MySQL27287 1 2.62% 10 MySQL40337 1 3.32% 1000 MySQL42649 1 4.67% 1000 MySQL44723 1 0.40% 1000 Apache3278 1 3.22% 1000 Apache34464 1 2.13% 10

Conclusion and Future Works Study diagnosis process for perf. bugs Noticed through comparison Good and bad inputs are provided Study statistical debugging on perf. bugs Branch predicates + two statistical models Future works Analyze inefficient loops Provide detailed fix strategies

Thanks a lot! 40