You can know time and cpu usage in pipeline using same command './testAll.sh 1'.
Signed-off-by: sewon.oh <sewon.oh@samsung.com>
- Tracing(TBD)
- Debugging
-- Profiling(TBD)
+- Profiling(in progress)
refer: https://github.sec.samsung.net/STAR/nnstreamer/issues/67
## Profiling
-Not implemented yet.
+### Pre-requirements
+
+- autoreconf
+- pkg-config
+- automake
+- libtool
+- gst-instruments
+
+```bash
+$ git clone https://github.com/kirushyk/gst-instruments.git
+$ cd gst-instruments
+$ ./autogen.sh
+$ make
+$ sudo make install
+```
+
+### How to
+
+```bash
+nnstreamer/test$ ./testAll.sh 1
+nnstreamer/test$ cd performance/profile/tensor_convertor
+$ eog ${number_of_test_case}.svg
+```
+
+then, you can see time and cpu usage in pipeline.
log="${log}$RED[FAILED] gst-launch with case $2$NC\n"
fi
if [[ $PERFORMANCE -eq 1 ]]; then
- dot -Tpng $GST_DEBUG_DUMP_DOT_DIR/*.PLAYING_PAUSED.dot > $GST_DEBUG_DUMP_DOT_DIR/$base/$2.png
+ dot -Tpng $GST_DEBUG_DUMP_DOT_DIR/*.PLAYING_PAUSED.dot > $GST_DEBUG_DUMP_DOT_DIR/debug/$base/$2.png
+ gst-report-1.0 --dot $GST_DEBUG_DUMP_DOT_DIR/*.gsttrace | dot -Tsvg > $GST_DEBUG_DUMP_DOT_DIR/profile/$base/$2.svg
rm $GST_DEBUG_DUMP_DOT_DIR/*.dot
+ rm $GST_DEBUG_DUMP_DOT_DIR/*.gsttrace
fi
}
dirpath="$( cd "$( dirname "$0")" && pwd )"
if [[ $1 -eq 1 ]]; then
-export GST_DEBUG_DUMP_DOT_DIR=$dirpath/performance/debug
+export GST_DEBUG_DUMP_DOT_DIR=$dirpath/performance
+export LD_PRELOAD=/usr/local/lib/libgstintercept.so
+export GST_DEBUG_DUMP_TRACE_DIR=$GST_DEBUG_DUMP_DOT_DIR
export PERFORMANCE=1
mkdir -p $GST_DEBUG_DUMP_DOT_DIR
fi
if [[ $PERFORMANCE -eq 1 ]]; then
checkDependency dot
+ checkDependency gst-report-1.0
fi
checkDependency dirname
checkDependency basename
export base=$(basename ${dir})
if [[ $PERFORMANCE -eq 1 ]]; then
- mkdir -p $GST_DEBUG_DUMP_DOT_DIR/$base
+ mkdir -p $GST_DEBUG_DUMP_DOT_DIR/debug/$base
+ mkdir -p $GST_DEBUG_DUMP_DOT_DIR/profile/$base
fi
log="${log}=================================================\n"