Replace the existing Apache 2.0 boilerplate header with an SPDX tag throughout the zephyr code tree. This patch was generated via a script run over the master branch. Also updated doc/porting/application.rst that had a dependency on line numbers in a literal include. Manually updated subsys/logging/sys_log.c that had a malformed header in the original file. Also cleanup several cases that already had a SPDX tag and we either got a duplicate or missed updating. Jira: ZEP-1457 Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c Signed-off-by: David B. Kinder <david.b.kinder@intel.com> Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
103 lines
2.3 KiB
Bash
Executable File
103 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
#
|
|
# Copyright (c) 2016 Intel Corporation.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
function usage() {
|
|
echo "Usage: ./profile <options> [profiler log] [ELF file]"
|
|
echo " Post-process profiler output. matplotlib is required for graphical output"
|
|
echo ""
|
|
echo " Type:"
|
|
echo " default Text output"
|
|
echo " -r|--run Running task view (running context over time)"
|
|
echo " -t|--total Display total CPU load per context"
|
|
echo " -s|--slice Timeslice graph (Context load average per period)"
|
|
echo ""
|
|
echo " Options:"
|
|
echo " -c|--clock [ticks_per_sec] HW cycle period (system timer)"
|
|
echo " Only applicable for graphical output:"
|
|
echo " -b|--begin [time_ms] Start timestamp (ms since boot)"
|
|
echo " -e|--end [time_ms] End time (ms since boot)"
|
|
echo " Only applicable for slice:"
|
|
echo " -p|--period [period_ms] Timeslice average period"\
|
|
"(for timeslice graph only)"
|
|
}
|
|
|
|
TEXT=0
|
|
RUN=1
|
|
TOTAL=2
|
|
SLICE=3
|
|
|
|
TYPE=$TEXT
|
|
|
|
PERIOD=500
|
|
|
|
TS_START=0
|
|
TS_END=0
|
|
|
|
NO_PARAM=0
|
|
|
|
SOURCE="${BASH_SOURCE[0]}"
|
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
|
TOP_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|
|
|
while [ -n "$1" ]; do
|
|
case "$1" in
|
|
-h|--help)
|
|
usage
|
|
exit
|
|
;;
|
|
|
|
-r|--run) TYPE=$RUN ;;
|
|
-t|--total) TYPE=$TOTAL ;;
|
|
-s|--slice) TYPE=$SLICE ;;
|
|
-b|--begin) shift; TS_START=$1 ;;
|
|
-e|--end) shift; TS_END=$1 ;;
|
|
-p|--period) shift; PERIOD=$1 ;;
|
|
-c|--clock) shift; TICKS_PER_SEC="-c "$1 ;;
|
|
*)
|
|
case "$NO_PARAM" in
|
|
0) LOG_FILE=$1 ;;
|
|
1) ELF_FILE=$1 ;;
|
|
esac
|
|
NO_PARAM=$(($NO_PARAM+1))
|
|
;;
|
|
|
|
esac
|
|
shift
|
|
done
|
|
|
|
if [ -z $LOG_FILE ] || [ -z $ELF_FILE ]; then
|
|
usage
|
|
exit
|
|
fi
|
|
|
|
if [ "$TYPE" == "$TEXT" ]; then
|
|
$TOP_DIR/profile_kernel.py $TICKS_PER_SEC $LOG_FILE $ELF_FILE
|
|
exit
|
|
else
|
|
$TOP_DIR/profile_kernel.py --ftrace $TICKS_PER_SEC $LOG_FILE $ELF_FILE > tmp1.txt
|
|
fi
|
|
|
|
$TOP_DIR/contextswitch_parse.py tmp1.txt > tmp2.txt
|
|
|
|
if [ "$TS_END" -gt "$TS_START" ] ; then
|
|
ARG1="-s "$TS_START" -e "$TS_END
|
|
else
|
|
ARG1=""
|
|
fi
|
|
|
|
if [ "$TYPE" == "$RUN" ]; then
|
|
$TOP_DIR/contextswitch_run.py $ARG1 --nocoreload tmp2.txt
|
|
elif [ "$TYPE" == "$TOTAL" ]; then
|
|
$TOP_DIR/contextswitch_totals.py $ARG1 tmp2.txt
|
|
elif [ "$TYPE" == "$SLICE" ]; then
|
|
ARG2="-t "$PERIOD
|
|
$TOP_DIR/contextswitch_timeslice.py $ARG1 $ARG2 tmp2.txt
|
|
fi
|
|
|
|
rm -rf tmp1.txt tmp2.txt
|