-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Script to check profiling symbols Signed-off-by: Md Rahman <[email protected]> * Removed recursive rm * Added a comment on the so file requirement * Added a check for grep in case profiling is not enabled
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
# Simple script to check for missing profiling symbols in | ||
# SHMEM library. The readelf tool requires the library to | ||
# be a shared object. | ||
# | ||
# Example usage: pshmem_symbol_check.sh <path to SHMEM library> | ||
# | ||
# Exit if any command fails | ||
set -e | ||
|
||
if [ $# != 1 ] ; then | ||
echo "Usage: $0 SHMEM_LIBRARY" | ||
exit 1 | ||
fi | ||
|
||
SHMEM_LIB=$1 | ||
|
||
readelf --syms --wide $SHMEM_LIB | grep 'shmem_' | awk '{print $8}' > symbols | ||
cat symbols | sort | uniq -d > shmem_symbols | ||
|
||
if grep -q -R "pshmem_" shmem_symbols | ||
then | ||
grep -R "pshmem_" shmem_symbols > pshmem_symbols_uniq | ||
echo "Number of pshmem symbols found: `wc -l pshmem_symbols_uniq | awk '{print $1}'`" | ||
else | ||
echo "No PSHMEM symbols found" | ||
exit 0 | ||
fi | ||
|
||
sed -n '/^pshmem_/d' shmem_symbols | ||
|
||
for i in $(cat ./pshmem_symbols_uniq) | ||
do | ||
search_str=$(echo $i | cut -c 2-) | ||
sed "/${search_str}/d" -i ./shmem_symbols | ||
done | ||
|
||
rm symbols | ||
rm pshmem_symbols_uniq | ||
|
||
echo "APIs that dont have profiling symbols:" | ||
echo "--------------------------------------" | ||
cat shmem_symbols | ||
|
||
rm shmem_symbols |