Commit 80a68c16 authored by Kai Vogelgesang's avatar Kai Vogelgesang

Add gprof job to ci pipeline

parent 5ae2adab
Pipeline #3072 failed with stages
in 1 minute and 40 seconds
......@@ -79,3 +79,17 @@ deploy:pypi:
- echo "password=$PYPI_PASSWORD" >> ~/.pypirc
- python3 setup.py check sdist bdist upload -r on
- rm -vf ~/.pypirc
deploy:profile:
stage: deploy
tags:
- gprof
script:
- CC=gcc-5 CXX=g++-5 cmake . -DGPROF=1
- make
- bash profiling/profile.sh
artifacts:
paths:
- gprof-send.txt
- gprof-recv.txt
expire_in: 30 days
\ No newline at end of file
......@@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.8.11)
project (PRRT)
option(PRRT_TESTS "Build tests" OFF)
option(GPROF "Compile with profiler" OFF)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
......@@ -13,6 +14,10 @@ set(CMAKE_CXX_FLAGS "-fstack-protector -fstack-protector-all -Wall -std=gnu++11
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -Wall -ggdb -fsanitize=undefined -fsanitize=address -g3" )
set(CMAKE_CXX_FLAGS_RELEASE "-Os -Wall" )
if(GPROF)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
endif()
find_package (Threads)
find_library(M_LIB m)
......
#!/usr/bin/env bash
which gprof
run_in() {
(cd $1; ${@:2})
}
to="timeout -s INT 30 "
mkdir -p gprof_send gprof_recv
run_in gprof_recv $to ../receiver -p 5000 -r 127 -o receiver.csv &
run_in gprof_send $to ../sender -t 127.0.0.1 -p 5000 -r 127 -o sender.csv
wait
gprof ./receiver gprof_recv/gmon.out > gprof-recv.txt
gprof ./sender gprof_send/gmon.out > gprof-send.txt
rm -r gprof_send gprof_recv
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment