Enabling Performance Profiling in GitLab* CI
- Automatic performance analysis:If a performance regression was introduced into the build, setting up a test environment and collecting performance results manually can be monotonous and consumes valuable time of the engineers. Integration ofVTuneinto the testing stage of your GitLab CI pipeline allows you to automatically collect performance data in a predetermined environment and to upload the results automatically as an artifact.ProfilerThis eliminates manual work and lets you focus on determining the cause of the regression by making the performance results data readily available once the build is complete.
- Customized configuration:The Command-Line Interface (CLI) capabilities ofVTuneallow for great flexibility in terms of CI integration. Using the CLI ofProfilerVTune, you can set up a customized process that suits your team, for example, by selecting the necessary analysis types and parameters.ProfilerSome examples of possible configurations are:
- Profile a new build only when a performance regression was detected at the load testing stage of your build system and collect performance data for all the necessary analysis types
- HTML analysis reports:VTuneoffers a command line option that generates a static HTML page with the summary for the collected result. This allows you to view the HTML page using your browser and to determine whether additional analysis is needed. Optionally, you can host these HTML reports as GitLab Pages for convenience.Profiler
- Infrastructure:GitLab repository with a pre-configured GitLab CI pipeline, which includes:
- Makefile for your project
- GitLab Runner with VTune Profiler installed
- Tools:Intel® VTune™2020Profiler
- Starting with the 2020 release, Intel® VTune™ Amplifier has been renamed toIntel® VTune™.Profiler
- Most recipes in theIntel® VTune™Performance Analysis Cookbook are flexible. You can apply them to different versions ofProfilerIntel® VTune™. In some cases, minor adjustments may be required.Profiler
Install GitLab Runner
- Make sure to set/proc/sys/kernel/perf_event_paranoidto 0 to allow hardware event-based sampling collection without root privileges. For more information on profiling without Intel sampling drivers or root privileges, see the Profiling Hardware Without Intel Sampling Drivers Cookbook recipe.
- The performance analysis result may vary depending on the Runner selection and the individual machine running the analysis.
Configure Automatic Data Collection
- Using thevtunecommand, you can specify any options and select any analysis types that are valid for your environment. For more information on how to run an analysis from the command line, see the Run Command Line Analysis page of the online User Guide.
- The graphical user interface ofVTuneoffers a Command Line Configuration Generation feature, which allows you to conveniently pre-configure an analysis in the GUI and to instantly generate and copy a command that includes all the options and parameters that are necessary for your preferred analysis configuration. You can use this feature to quickly generate a command for later use.Profiler
Configure an Automatic Upload of your Results as Artifacts
artifacts: paths: - <relative-path-to-project>/vtune_result.tar - <relative-path-to-project>/hotspots_summary.html
View the Results Data
- On GitLab, navigate to the Pipelines page.
- From this page, you can either download the entire artifact bundle, or browse to the HTML page separately and determine whether downloading the precollected result is necessary based on the summary.
- Navigate to the pipeline stage report page and clickBrowse.
- Navigate to the location of the HTML page and download it.
- Open the summary HTML in your browser of choice and determine whether additional analysis is needed.
- Extract the results files from the.tararchives.
- Launch theVTuneGUI.Profiler
- Click theOpen Resultbutton and browse to the result file. The result data will open in a new tab.