Fixing Memory Leak Test

Change-Id: I8446f2789adfbb07ea5f8925e7b2ae2bc5cdd468
Este commit está contenido en:
Ammar ELWazir authored and Ammar Elwazir committed 2023-06-21 12:46:26 -04:00
1 padre 93c28b5d39
commit 5987bc375b
3 files changed
+1 -26

No files matched your search

-1
Ver fichero
@@ -1,4 +1,3 @@
configure_file(run_asan_tests.sh ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY)
configure_file(suppr.txt ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY)
configure_file(test_mem.py ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY)
configure_file(input.txt ${PROJECT_BINARY_DIR}/tests-v2/memorytests COPYONLY)
+1 -3
Ver fichero
@@ -4,6 +4,4 @@ CURRENT_DIR="$( dirname -- "$0"; )";
export PATH=$rocprofilerdir:$PATH
echo -e "Running Memory Leaks Check From ${CURRENT_DIR}"
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.6 ASAN_OPTIONS=detect_leaks=1 LSAN_OPTIONS=suppressions=$CURRENT_DIR/suppr.txt ${CURRENT_DIR}/../../rocprofv2 -i $CURRENT_DIR/input.txt $1 > /tmp/rocprofv2-temp 2> $2
echo -e "Log with all detected leaks is available at build/memleaks.log"
eval python3 $CURRENT_DIR/test_mem.py $2
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.6 ASAN_OPTIONS=detect_leaks=1 LSAN_OPTIONS=suppressions=$CURRENT_DIR/suppr.txt ${CURRENT_DIR}/../../rocprofv2 -i $CURRENT_DIR/input.txt --sys-trace $*
-22
Ver fichero
@@ -1,22 +0,0 @@
import sys
file = open(sys.argv[1], 'r')
Lines = file.readlines()
count = 0
flag = 0
print("Leaks Detected:")
for line in Lines:
if "object(s) allocated from" in line:
flag = 0
if "rocprofiler/src" in line and flag == 0:
print(line)
count+=1
flag = 1
if count == 0:
print("No Leaks were found!")
else:
print("Warning: Found (" + str(count) + ") Memory Leaks related to rocprofiler project!")