#!/bin/bash
# Copyright 2015 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; version 2.1.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see .
#
# Author: Benjamin Zeller
# Zoltán Balogh &2
exit
esac
done
if [ ${URL} == local ]; then
echo ${PASSWORD}|sudo -S lttng create
else
nc -z ${URL} 5343
if [ $? -eq 0 ]; then
echo "The lttng server ${URL} is listening on 5343"
echo ${PASSWORD}|sudo -S bash -c "lttng create --set-url net://${URL}"
else
echo "The lttng server is not accesible. Check lttng-relayd or firewall policies."
echo "Falling back to local"
URL="local"
echo ${PASSWORD}|sudo -S lttng create
fi
fi
echo ${PASSWORD}|sudo -S bash -c 'lttng enable-event --userspace qtmir:firstFrameDrawn'
echo ${PASSWORD}|sudo -S bash -c 'lttng enable-event --userspace app:*'
echo ${PASSWORD}|sudo -S bash -c 'lttng start'
for x in $(seq 1 ${COUNT}); do
echo ${PASSWORD}|sudo -S bash -c 'echo 1 > /proc/sys/vm/drop_caches'
sleep 5
echo "x - $x"
if [[ $WITH_CACHE == false ]]; then
# Cleaning QML cache
rm -rf ~/.cache/QML/Apps/${APP_NAME}
fi
echo ${PASSWORD}|sudo -S /usr/bin/lomiri-app-launch-tracepoints
lomiri-app-launch ${APP_NAME}
sleep ${SLEEP_TIME}
lomiri-app-stop ${APP_NAME}
done
echo ${PASSWORD}|sudo -S bash -c 'lttng stop'