1 / 23

Run-time Component memory analysis

Run-time Component memory analysis. Project members: Gati Michael Johan Muskens Merijn de Jong Michel Chaudron. 26 Sept 2003. Content. Project Introduction (goals, idea and assumptions) Problem analysis

kairos
Download Presentation

Run-time Component memory analysis

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. Run-time Component memory analysis Project members: Gati Michael Johan Muskens Merijn de Jong Michel Chaudron 26 Sept 2003

  2. Content • Project Introduction • (goals, idea and assumptions) • Problem analysis • Why use AspectC++ Approach • Analysis of AspectC++ • Modeling • Problems with AspectC++ • Current status of the project

  3. Project Introduction Assumptions Goals Main Idea • Flexible and extendible design • Reusable extensions (implementation) • Investigate the use of aspect orientation • Validate the results of the tool with Chat application Main goal is to build a software tool to measure dynamic memory use of component based system

  4. Project context & scope Project Introduction Robocop component Functional model Resource estimation model Software Tool Resource Measurement Source code model Document model

  5. GoalsMain Idea Project Introduction Assumptions AC++ Dynamic memory information C++ Component Code Other Measurement Tool

  6. Project Introduction GoalsMain Idea Assumptions Domain Linux development environment (G++/Ac++ compiler) C/C++ Implementation language Component design and development Aspect oriented programming (AspectC++) Mysql++ ( C++API) Assumptions &Constraints • Software tool should handle any generic c/c++ component • Software tool should be implemented in C/C++ under Linux environment

  7. Chat Application Know the design and dynamic behaviour of the system Techniques used – function library modification Existing debugging tools Most tools analyze memory use by functions, call stack, block sizes Problem analysisExisting analysis work

  8. Problem analysisChat application Idea • Relied on the knowledge of the component code Automatic instrumentation?

  9. Transform CPU Unparsed C++ Parser C++’ Transform memory Compile Info Program Run Problem analysisTechniques of automatic instrumentation • Traditional way Extendibility Build multiple transforms (CPU, Memory ) Reuse the parser

  10. Problem analysisTechniques of automatic instrumentation What is Aspect Oriented Programming? Goal of AOP -> separation of concerns Weaver takes the required input and process it into new program Aspect 1 Aspect2 Extendibility C++’ C++ Weaver A A Easy to add new Aspect B C Reusability B C Easy to reuse the code

  11. Problem AnalysisProblems of Instrumentation techniques • Traditional way –parsing C++is difficult. • Aspect approach-alreadyexistsweaver for C++ -> but It is a prototype

  12. What Profiling Aspect Extensibility Yes Yes High level of Abstraction/ Reusability No Yes Linux Platform Yes Yes Time of preparation Not feasible Feasible Build C++ parser Time of preparation - Feasible Aspect code Instrumentation Difficult Simple mechanism Why use AspectC++ Approach OPTIONS

  13. Analysis of AspectC++Four Main questions • How to identify the patterns to instrument? • Which code to add to which pattern? • How to collect the reported data? • How to analyze the reported data?

  14. Analysis of AspectC++How to identify the patterns to instrument? • Join points !! It is a place in the component code where an aspect code can interfere(function, a class, an attribute..) • Examples-join points for memory analysis

  15. Analysis of AspectC++Which code to add to which pattern? We are interested in getting the following information • Size(allocated memory block) • Address of allocation • Address of deallocation • Time spent from allocation to deallocation • The name of the objects and class names

  16. Analysis of AspectC++Which code to add to which pattern? advice code: You can specify when the join point should be called or executed by writing an advice code. Syntax: advice call (“joint point”):after(){ A} advice call (“joint point”):before(){ A} advice call (“joint point”):around(){ A} Join points can be combined with logical operators (||),(&&), or (!=)

  17. Collecting data using AspectC++

  18. Analysis of AspectC++ Example • Measure the size allocated by malloc() Advice call ("void * malloc (...)") && args (size): around (size_t size) { printf ("Memory size%ld: \n", size); tjp->proceed (); printf ("Pointer allocated: %p\n", *tjp->result ()); } Note: tjp==JoinPoint

  19. Model 1-Mapping the measured data to different aggregation level Analysis: How to analyze data Application Total components Components Total classes/ component Classes Total objects /class Objects Each object

  20. ModelingHow to analyze Model 2- ER- model – (Database)

  21. C/C++ Input code Aspect code Ac++ weaving Other profiler C’/C’++ G. program g++ compiling C/C++Program Instrumentation Data Collection MYSQL server DB(3-tables) DB connector Data Retrieval tables graphs Analyzer Architecture What is not instrumented? Class names & object names Which data is collected? The 3 tables-> but thee are some problems of skipping rows Which analysis is displayed? Memory use over time

  22. Problems of Aspect++ • Compiler problems • some files in the gcc 3.x header files cannot be parsed byac++ • But it works for g++ 2.9x- Take the headers from another machine and adapt the working environment for ac++ • Unable to instrument operators new & delete • Pre-processor • Use aspect to instruct where to put overloaded operators

  23. Next plan • Implementation –> 1 Nov(25 Nov for improvement) • Technical problems- >5-Oct-2003 1. Get all data from program to database 2. Perform experiments on: ->Chat application with aspect code under g++2.9x ->Pre-processor • Extract tables from Db and make different analysis- 1 November • Writing report->20 -Jan-2004 • Modeling chapter ->architecture and design- 17-Oct-2003 • Implementation chapter -> 27 –Nov-2003 • Verification & validation->12-Dec-2003 • Management -> 20 Jan 2004

More Related