aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-devtools/codexl/codexl/codexl_remote_agent.sh
blob: 3fc74e52b0af32bebd7369e4df8bc40455a18daf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

ACTION=$1

function start_remote_agent {
	if [ -z "`cat /proc/modules | grep amdtPwrProf`" ]; then
		insmod /opt/codexl/amdtPwrProf.ko
	fi
	export DISPLAY=:0
	/opt/codexl/CodeXLRemoteAgent
}

function stop_remote_agent {
	killall -q CodeXLRemoteAgent-bin
	if [ -n "`cat /proc/modules | grep amdtPwrProf`" ]; then
		rmmod amdtPwrProf
	fi
}

if [ $ACTION = "start" ]; then
	echo "START the remote agent"
	stop_remote_agent
	start_remote_agent
else
	echo "STOP the remote agent"
	stop_remote_agent
fi