-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common: a complete stack analysis toolchain
A comprehensive analysis of stack sizes requires several steps. To facilitate this process, these steps have been aggregated into a single script run_call_stacks_analysis.sh. In addition, it is possible to perform this operation based on the set of functions used in the DAOS project. The cflow program, a key component of stack analysis, is not available by default on Linux. The install_cflow.sh script solves this problem by downloading the sources, compiling and then installing the cflow program on the system. Both scripts has been integrated into their respective GHA workflows to avoid code redundancy. Scan GHA workflow shall be run every PR to detect an issue before it is integrated into main branch of PMDK source code. Signed-off-by: Tomasz Gromadzki <[email protected]>
- Loading branch information
Showing
8 changed files
with
121 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
schedule: | ||
# run this job at 00:00 UTC every day | ||
- cron: '0 0 * * *' | ||
pull_request: | ||
|
||
permissions: {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright 2025, Hewlett Packard Enterprise Development LP | ||
# | ||
# | ||
# Install cflow tool | ||
# | ||
|
||
function main() { | ||
if which "cflow" >/dev/null 2>&1; then | ||
echo "cflow already installed" | ||
#return 0 | ||
fi | ||
wget "https://mirror.easyname.at/gnu/cflow/cflow-latest.tar.gz" && \ | ||
tar -xvzf cflow-latest.tar.gz && \ | ||
rm cflow-latest.tar.gz | ||
echo $? | ||
if [ $? != 0 ]; then | ||
echo "Can not download cflow source code" | ||
return 1 | ||
fi | ||
pushd cflow-* | ||
./configure && make && sudo make install | ||
if [ $? != 0 ]; then | ||
popd | ||
echo "Can not install cflow" | ||
return 1 | ||
fi | ||
popd | ||
rm -rf cflow-* | ||
return 0 | ||
} | ||
|
||
main | ||
|
||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright 2025, Hewlett Packard Enterprise Development LP | ||
# | ||
# | ||
# Execute complete call stack analysis based on API subset defined in examples/api_filter.txt. | ||
# | ||
# Update the examples/api_filter.txt file based on the actual DAOS source code. (Optional) | ||
# | ||
|
||
function help() { | ||
echo "usage:" | ||
echo " $0 [-h|--help] [-d|--daos]" | ||
echo | ||
echo " -h/--help print help" | ||
echo " -d/--daos use the actual pmemobj API calls from the DAOS source code" | ||
echo | ||
} | ||
|
||
function main() { | ||
local update=$1 | ||
local filter_name="examples/api_filter.txt" | ||
|
||
if [ $update == 1 ]; then | ||
wget -q https://github.com/daos-stack/daos/archive/refs/heads/master.zip -O daos.zip | ||
unzip -q -o daos.zip | ||
rm daos.zip | ||
grep -r -E -h -o 'pmemobj_[^(]*\(' 'daos-master/src' | sed 's/(.*$//' | \ | ||
sort | uniq > $filter_name | ||
rm -rf daos-master | ||
fi | ||
|
||
# The lower limit comes up from the DAOS memory requirements. | ||
# 16kB - 4kB - 720B = 11568B | ||
# 16kB = Stack allocated for a single Argobot's ULT | ||
# 4kB = a maximum DAOS' stack usage up to calling a PMDK API calls | ||
# 720B = safety margin | ||
# ~ = Some OSes, e.g. Ubuntu 22.04, generate call stacks of size | ||
# a little bit over the exact limit which is not deemed a problem at the moment. | ||
|
||
./make_stack_usage.sh && \ | ||
./make_api.sh && \ | ||
./make_extra.py && \ | ||
./make_cflow.sh && \ | ||
./make_call_stacks.py --filter-api-file $filter_name --filter-lower-limit 11568 \ | ||
--dump-all-stacks | ||
return $? | ||
} | ||
|
||
if [[ "$1" == "-h" || "$1" == "--help" ]]; then | ||
help | ||
exit 1 | ||
fi | ||
|
||
if [[ "$1" == "-d" || "$1" == "--daos" ]]; then | ||
daos=1 | ||
else | ||
daos=0 | ||
fi | ||
|
||
main $daos | ||
|
||
exit $? |