You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
856 B
30 lines
856 B
#!/bin/bash
|
|
|
|
WINDOW=$1
|
|
PERIOD=$2
|
|
|
|
if [[ -z $WINDOW ]] || [[ -z $PERIOD ]]; then
|
|
echo "Window or Period not specified!"
|
|
echo "Example usage: ./set_strobing.sh <WINDOW VALUE> <PERIOD VALUE>"
|
|
echo "Example usage: ./set_strobing.sh 5000 10000"
|
|
exit -1
|
|
fi
|
|
|
|
|
|
if [[ $EUID != 0 ]]; then
|
|
echo "Please run as root"
|
|
exit -1
|
|
fi
|
|
|
|
for e in /sys/bus/coresight/devices/etm*/; do
|
|
printf "%x" $WINDOW | tee $e/strobe_window > /dev/null
|
|
printf "%x" $PERIOD | tee $e/strobe_period > /dev/null
|
|
echo "Strobing period for $e set to $((`cat $e/strobe_period`))"
|
|
echo "Strobing window for $e set to $((`cat $e/strobe_window`))"
|
|
done
|
|
|
|
## Shows the user a simple usage example
|
|
echo ">> Done! <<"
|
|
echo "You can now run perf to trace your application, for example:"
|
|
echo "perf record -e cs_etm/@tmc_etr0/u -- <your app>"
|