#!/bin/bash

if [ $# -eq 1 ]; then
  SUFFIX=".$1"
fi
 
touch $TMPDIR/profilers_running

if [ -e /proc/schedstat ]; then # schedstat
  schedstathelper 30 $SUFFIX & # schedstat
  echo $! > $TMPDIR/schedstat.pid # schedstat
fi # schedstat
PATH=$AUTODIR/sources/sysstat:$PATH # sar
sar -o "$LOGDIR/analysis/sar.bin.$RUN_NUMBER$SUFFIX" 5 100000 & # sar
if grep -iq " profile=2 " /proc/cmdline; then # readprofile
  $AUTODIR/sources/readprofile/readprofile -r # readprofile
fi # readprofile
