+if [ -n "$OUTPUT_DIR" ]; then
+ OUTDIR=$OUTPUT_DIR
+else
+ DATESTRING="$(hostname)-$(date +%Y%m%d%H%M%S%N)"
+ OUTDIR="$BASE_TRACE_DIR/$DATESTRING"
+fi
+
+# Check if directory exist
+if [ ! -d "$OUTDIR" ]; then
+ mkdir -p $OUTDIR
+ if [ $? -eq 1 ]; then
+ exit 1
+ fi
+fi