Update the profiler to allow for different level of profiling

This commit is contained in:
2023-07-23 16:36:21 +01:00
parent 0e973feb38
commit 19c02b4e99
4 changed files with 56 additions and 46 deletions

View File

@@ -12,8 +12,12 @@ while [[ $# > 0 ]];do
RELEASE=true
shift
;;
--enable-profiling)
ENABLE_PROFILING=true
--basic-profiling)
BASIC_PROFILING=true
shift
;;
--full-profiling)
FULL_PROFILING=true
shift
;;
*|-*|--*)
@@ -46,11 +50,11 @@ echo
# PROFILER
PROFSRC="../src/profiler/timer.c"
PROFFLAGS="-c"
PROFFLAGS="-c "
PROF_BUILD_DIR=prof_build
# PROCESSOR
JSONSRC="../src/json/*.c"
JSONSRC="../src/json/*.c "
JSONFLAGS="-c "
JSON_BUILD_DIR=json_build
@@ -61,10 +65,18 @@ PROCSRC="./$JSON_BUILD_DIR/*.o \
./src/processor/main.cpp "
PROCOUT=prochavr
if [[ $ENABLE_PROFILING == true ]]; then
JSONFLAGS+="-DENABLE_PROFILING"
PROCSRC+="./$PROF_BUILD_DIR/*.o"
PROCFLAGS="-DENABLE_PROFILING"
if [[ $BASIC_PROFILING == true ]] || [[ $FULL_PROFILING == true ]]; then
if [[ $FULL_PROFILING == true ]]; then
JSONFLAGS+="-DFULL_PROFILING"
PROCFLAGS="-DFULL_PROFILING"
PROFFLAGS+="-DFULL_PROFILING"
elif [[ $BASIC_PROFILING == true ]]; then
JSONFLAGS+="-DBASIC_PROFILING"
PROCFLAGS="-DBASIC_PROFILING"
PROFFLAGS+="-DBASIC_PROFILING"
fi
PROCSRC+=./$PROF_BUILD_DIR/*.o
mkdir $PROF_BUILD_DIR
cd $PROF_BUILD_DIR