interactive performance profiling and debugging
play

Interactive Performance Profiling and Debugging Kevin Pouget - PowerPoint PPT Presentation

Interactive Performance Profiling and Debugging Kevin Pouget Jean-Fran cois M ehaut, Miguel Santana Universit e Grenoble Alpes / LIG, STMicroelectronics, France Nano2017-DEMA project Nano2017/Dema Meeting, Grenoble June 24 th , 2016


  1. Interactive Performance Profiling and Debugging Kevin Pouget Jean-Fran¸ cois M´ ehaut, Miguel Santana Universit´ e Grenoble Alpes / LIG, STMicroelectronics, France Nano2017-DEMA project Nano2017/Dema Meeting, Grenoble June 24 th , 2016 Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 1 / 9

  2. Introduction Introduction Profiling today gprof ◮ compile-time instrumentation of function calls ◮ whole execution perf stat ◮ OS hooks for hardware counters ◮ whole execution or attach/detach papi ◮ OS hooks for hardware counters ◮ manual code instrumentation trace-based post-mortem analyzers ◮ runtime library instrumentation Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  3. Introduction Introduction Profiling today gprof ◮ compile-time instrumentation of function calls ◮ whole execution perf stat ◮ OS hooks for hardware counters ◮ whole execution or attach/detach papi ◮ OS hooks for hardware counters ◮ manual code instrumentation trace-based post-mortem analyzers ◮ runtime library instrumentation Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  4. Introduction Introduction Profiling today gprof ◮ compile-time instrumentation of function calls ◮ whole execution perf stat ◮ OS hooks for hardware counters ◮ whole execution or attach/detach papi ◮ OS hooks for hardware counters ◮ manual code instrumentation trace-based post-mortem analyzers ◮ runtime library instrumentation No efficient way to interactively profile regions of interest Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  5. Introduction Introduction Profiling today No efficient way to interactively profile regions of interest Source-level interactive debuggers Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  6. Introduction Introduction Profiling today No efficient way to interactively profile regions of interest Source-level interactive debuggers Extensive control over the process execution Powerful (and intuitive ?) command-line user interface Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  7. Introduction Introduction Profiling today No efficient way to interactively profile regions of interest Source-level interactive debuggers Extensive control over the process execution Powerful (and intuitive ?) command-line user interface Ability to dynamically compile and insert code in the process Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  8. Introduction Introduction Profiling today No efficient way to interactively profile regions of interest Source-level interactive debuggers Extensive control over the process execution Powerful (and intuitive ?) command-line user interface Ability to dynamically compile and insert code in the process Let’s combine them into an interactive profiling tool! Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  9. Introduction Introduction Profiling today No efficient way to interactively profile regions of interest Source-level interactive debuggers Extensive control over the process execution Powerful (and intuitive ?) command-line user interface Ability to dynamically compile and insert code in the process Let’s combine them into an interactive profiling tool! a a only sequential executions / at language-level for now. Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 2 / 9

  10. Functional and Performance Source-level Debugging Functional and Performance Source-level Debugging Functional Interactive debugging Navigate in the application execution Study its current memory state and execution paths Test and verify debugging hypothesis Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 3 / 9

  11. Functional and Performance Source-level Debugging Functional and Performance Source-level Debugging Functional Interactive debugging Navigate in the application execution Study its current memory state and execution paths Test and verify debugging hypothesis Performance Interactive Debugging Navigate in the application execution Profile specific function/region execution Test and verify debugging hypothesis Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 3 / 9

  12. Functional and Performance Source-level Debugging Functional and Performance Source-level Debugging Functional Interactive debugging Navigate in the application execution Study its current memory state and execution paths Test and verify debugging hypothesis Performance Interactive Debugging Navigate in the application execution Profile specific function/region execution Test and verify debugging hypothesis Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 3 / 9

  13. Functional and Performance Source-level Debugging Functional and Performance Source-level Debugging Functional Interactive debugging Navigate in the application execution Study its current memory state and execution paths Test and verify debugging hypothesis Performance Interactive Debugging Navigate in the application execution Profile specific function/region execution Test and verify debugging hypothesis Experimentation prototype developed as a GDB Python extension Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 3 / 9

  14. Interactive Code Profiling Interactive Code Profiling What to profile? During the normal execution: ◮ the whole ◮ a function execution ◮ a region (from line ... to line ... — breakpoints involved) ◮ manual start and stops Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 4 / 9

  15. Interactive Code Profiling Interactive Code Profiling What to profile? During the normal execution: ◮ the whole ◮ a function execution ◮ a region (from line ... to line ... — breakpoints involved) ◮ manual start and stops Outside of the normal execution: ◮ we’ll discuss it a bit later Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 4 / 9

  16. Interactive Code Profiling Interactive Code Profiling What to profile? During the normal execution Outside of the normal execution What is measured? /proc/PID/... values ( mem usage, context switches, ... ) perf stat counters ◮ LD PRELOAD patch to support on-demand counter dump ◮ task-clock, context-switches, cpu-migrations, page-faults, cycles, instructions, branches, ... gprof counters ◮ preliminary and on-going (inspection of glibc profiling counters) ◮ call-graph, time per function, ... function/address execution count (breakpoints involved) Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 4 / 9

  17. Interactive Code Profiling Interactive Code Profiling What to profile? During the normal execution Outside of the normal execution What is measured? /proc/PID/... values ( mem usage, context switches, ... ) perf stat counters gprof counters function/address execution count (breakpoints involved) What to do with nesting? Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 4 / 9

  18. Interactive Code Profiling Interactive Code Profiling What to do with nesting? Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 5 / 9

  19. Interactive Code Profiling Interactive Code Profiling What to do with nesting? Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 5 / 9

  20. Interactive Code Profiling Interactive Code Profiling What to do with nesting? Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 5 / 9

  21. Interactive Code Profiling Interactive Code Profiling What to do with nesting? Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 5 / 9

  22. Interactive Code Profiling Interactive Code Profiling What to do with nesting? ... and multiple hits ? Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 5 / 9

  23. Interactive Code Profiling Interactive Code Profiling What to do with nesting? ... and multiple hits ? ... and concurrent hits ? Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 5 / 9

  24. Interactive Code Profiling Interactive Code Profiling Profiling outside of the normal execution based on GDB/GCC dynamic compilation feature Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 6 / 9

  25. Interactive Code Profiling Interactive Code Profiling Profiling outside of the normal execution based on GDB/GCC dynamic compilation feature (gdb) profile interactive ◮ -repeat:10 ◮ -code: fct(param1, param2, ...) = ⇒ generates: /* start profiling */ for(int i = 0; i < 10; i++) fct(param1, param2, ...); /* stop profiling */ Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 6 / 9

  26. Interactive Code Profiling Interactive Code Profiling Profiling outside of the normal execution based on GDB/GCC dynamic compilation feature (gdb) profile interactive ◮ -repeat:10 ◮ -code: fct(param1, param2, ...) ◮ -app : runs the whole app, with same command-line args Kevin Pouget Interactive Performance Profiling and Debugging Dema Meeting 6 / 9

Recommend


More recommend