0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 08:29:07 +03:00

Easyprofiler added

This commit is contained in:
Arin Alexander
2018-02-28 23:19:04 +03:00
parent edb89544f8
commit 6ad35d63be
218 changed files with 36639 additions and 17 deletions

View File

@@ -0,0 +1,37 @@
global target_pid
global target_name
probe scheduler.ctxswitch {
if (target_pid != 0
&& next_pid != target_pid
&& prev_pid != target_pid)
next
if (target_name != ""
&& prev_task_name != target_name
&& next_task_name != target_name)
next
//printf("Switch from %d(%s) to %d(%s) at %d\n",prev_tid, prev_task_name,next_tid,next_task_name, gettimeofday_ns())
printf("%d %d %d %s %d\n",gettimeofday_ns(),prev_tid, next_tid, next_task_name,next_pid )
//printf("%d %d %d\n",gettimeofday_ns(),prev_tid, next_tid )
}
probe begin
{
target_pid = 0
target_name = ""
%( $# == 1 || $# > 2 %?
log("Wrong number of arguments, use none, 'pid nr' or 'name proc'")
exit()
%)
%( $# == 2 %?
if(@1 == "pid")
target_pid = strtol(@2, 10)
if(@1 == "name")
target_name = @2
%)
}

19
3rdparty/easyprofiler/scripts/make_style.sh vendored Executable file
View File

@@ -0,0 +1,19 @@
if [ "$#" -ne 1 ]; then
echo -e "Usage: \n$0 DIRECTORY\n\twhere DIRECTORY is a derectory with sources for styling"
exit 1
fi
if ! [ -x "$(command -v clang-format)" ]; then
echo 'Error: clang-format is not installed. Please install clang-format with minimal version 3.8' >&2
exit 1
fi
DIR=$1
FILES=`find $DIR -name "*.h" -or -name "*.cpp"`
for FILE in $FILES
do
echo "Set style for $FILE"
clang-format -i $FILE
done

57
3rdparty/easyprofiler/scripts/test.sh vendored Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
unamestr=`uname`
SUBDIR="./bin"
if [[ ! "$unamestr" == 'Linux' ]]; then
SUBDIR="./bin/Release/"
fi
DISABLED_PROF=$SUBDIR/profiler_sample_disabled_profiler
ENABLED_PROF=$SUBDIR/profiler_sample
TEMP_FILE_ENABLE="enable.info"
TEMP_FILE_DISABLE="disable.info"
RESULT_FILE="result.csv"
RESULT_FILE_TMP="result.csv.tmp"
HEADER="Blocks count, dT prof enabled usec, dT prof disabled usec,delta, usec/block"
#echo "Blocks count, dT prof enabled usec, dT prof disabled usec,delta, usec/block" > $RESULT_FILE
rm -rf $RESULT_FILE
for i in {1..9}
do
OBJECTS_COUNT=$(($i*100))
for j in {10..15}
do
RENDER_COUNT=$(($j*100))
for k in {10..15}
do
MODELLING_COUNT=$(($k*100))
$ENABLED_PROF $OBJECTS_COUNT $RENDER_COUNT $MODELLING_COUNT > $TEMP_FILE_ENABLE
$DISABLED_PROF $OBJECTS_COUNT $RENDER_COUNT $MODELLING_COUNT > $TEMP_FILE_DISABLE
DT_ENA=`cat $TEMP_FILE_ENABLE | grep Elapsed| awk '{print $3}'`
N_ENA=`cat $TEMP_FILE_ENABLE | grep Blocks| awk '{print $3}'`
N_DIS=`cat $TEMP_FILE_DISABLE | grep Elapsed| awk '{print $3}'`
DELTA=$(($DT_ENA-$N_DIS))
USEC_BLOCK=`awk "BEGIN{print $DELTA/$N_ENA}"`
echo $N_ENA,$DT_ENA,$N_DIS,$DELTA,$USEC_BLOCK >> $RESULT_FILE
done
done
echo $i
done
cat $RESULT_FILE | sort > $RESULT_FILE_TMP
echo $HEADER > $RESULT_FILE
cat $RESULT_FILE_TMP >> $RESULT_FILE
rm -rf $TEMP_FILE_ENABLE
rm -rf $TEMP_FILE_DISABLE
rm -rf $RESULT_FILE_TMP
echo "See result in $RESULT_FILE"