diff --git a/Performance-Analysis-setup.md b/Performance-Analysis-setup.md index 866cac9..667951d 100644 --- a/Performance-Analysis-setup.md +++ b/Performance-Analysis-setup.md @@ -1,2 +1,107 @@ # Performance with Vtune: +## Use Vtunes for Hotspot profiling: + +1. With GUI: + + From terminal open with vtune-gui and open your project for analysis. + At first this will generate a flat profile where you can choose the hotspot options. + +2. In Terminal: + + from terminal use the command: + + vtunne -collect hotspots ./ + + +# Performance with Gprof: + +## Use Gprof for Flat and Function Call Graph profiling: + +### SETUP + + Compile and build the project in terminal with this line of code before make: + + + cmake -DCMAKE_CXX_FLAGS=-pg -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg + + + The directory should be where you have the Cmake file for the project. + +### ANALYSIS + + After this, this will generate a gmon.out file: + + Go to the directory where gmon.out file is located and analyse with: + + + gprof -p ./ >[outputfilename with directory] + + + for a flat profiling of times. + + And for a call graph: + + + gprof -q ./ >[outputfilename with directory] + + +### Visualisation: + + The output files can be opened with any text editor. + + +# Performance with Valgrind: + +## Use Gprof for Cache and Call Graph analysis: + +### SETUP + + + Build with RelWithDebInfo option so that SIGILL does not appear (illegal opcode) + + +### ANALYSIS + + + Go to the build you want to analyse with cd + + + Cache Analysis: + + + valgrind --tool=cachegrind ./bin/ + + + this will generate a cachegrind.out. file in the directory where you analysed, which you can annotate using. + + + Cache Analysis Presentation: + + + cg_annotate cachegrind.out. + + + Function Call Analysis: + + + valgrind --tool=callgrind ./bin/ + + + this will generate a cachegrind.out. file in the directory where you analysed, which you can annotate using. + + + Cache Analysis Presentation: + + + cg_annotate cachegrind.out. + +### GUI Presentation: + + + All the .out files can be presented through KCachegrind. Open it from the GUI. Errors may appear if you want to open them directly from terminal. + + + + +