armbian-next: call trace analyzer and call-graph generator

This commit is contained in:
Ricardo Pardini
2022-11-02 17:07:49 +01:00
parent b2d02071bd
commit 578b21922e
3 changed files with 325 additions and 1 deletions

View File

@@ -6,7 +6,8 @@ function cli_entrypoint() {
set -T # inherit return/debug traps
mkdir -p "${SRC}"/output/call-traces
echo -n "" > "${SRC}"/output/call-traces/calls.txt
trap 'echo "${BASH_LINENO[@]}|${BASH_SOURCE[@]}|${FUNCNAME[@]}" >> ${SRC}/output/call-traces/calls.txt ;' RETURN
# See https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html
trap 'echo "${FUNCNAME[*]}|${BASH_LINENO[*]}|${BASH_SOURCE[*]}|${LINENO}" >> ${SRC}/output/call-traces/calls.txt ;' RETURN
fi
# @TODO: allow for a super-early userpatches/config-000.custom.conf.sh to be loaded, before anything else.