Fixing ROCProfiler V1 Tests & V1 Tests Packaging

Change-Id: I741e29b8fbce9d4643c4f13afafd7d4fd648094b


[ROCm/rocprofiler commit: 19e3253049]
This commit is contained in:
Ammar ELWazir
2023-06-06 21:41:47 +00:00
parent 8bd2cf2405
commit b78efe35b4
52 changed files with 166 additions and 88 deletions
@@ -0,0 +1,4 @@
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)
@@ -0,0 +1 @@
pmc: SQ_WAVES GRBM_COUNT GRBM_GUI_ACTIVE SQ_INSTS_VALU
@@ -0,0 +1,9 @@
#!/bin/bash
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
@@ -0,0 +1,4 @@
leak:amd_comgr
leak:hsa-runtime
leak:amdhip
leak:python
@@ -0,0 +1,22 @@
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!")