kfdtest: Implement SuspendAndWakeUp()
Change-Id: I16384cd0ca35f15841344ded4d4237a0a862a934 Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
|
||||
# Power management tests
|
||||
PM_TESTS=\
|
||||
"KFDPMTest.SuspendWithActiveProcess:"\
|
||||
"KFDPMTest.SuspendWithIdleQueue:"\
|
||||
"KFDPMTest.SuspendWithIdleQueueAfterWork:"\
|
||||
|
||||
# Permanent exclusions
|
||||
# These tests are included for debugging, but are not executed in normal execution on any ASIC:
|
||||
# PM_TESTS need human intervention, so put it here. Developers can run them
|
||||
# manually through "-p pm" option.
|
||||
#
|
||||
# Fragmentation test fails intermittently on different systems (see KFD-344). It
|
||||
# stresses memory management in unusual ways by having lots of memory allocated but
|
||||
@@ -12,6 +21,7 @@
|
||||
# clears memory at allocation time.
|
||||
PERMANENT_BLACKLIST_ALL_ASICS=\
|
||||
"-KFDEventTest.MeasureInterruptConsumption:"\
|
||||
"$PM_TESTS:"\
|
||||
"KFDLocalMemoryTest.Fragmentation:"\
|
||||
"KFDQMTest.BasicCuMaskingLinear:"\
|
||||
"RDMATest.GPUDirect:"\
|
||||
@@ -24,15 +34,11 @@ PERMANENT_BLACKLIST_ALL_ASICS=\
|
||||
# failures can be found
|
||||
# NOTE: If you update this alphabetical listing, add the corresponding JIRA ticket for reference
|
||||
#
|
||||
# KFDPMTest.SuspendWith[ActiveProcess|IdleQueue|IdleQueueAfterWork] (KFD-326|327|328)
|
||||
# KFDPNPTest.DisableAndCreateQueue (KFD-329)
|
||||
# KFDQMTest.GPUDoorbellWrite fails intermittently (KFD-318)
|
||||
# KFDQMTest.mGPUShareBO (KFD-334)
|
||||
# KFDHWSTest.* (SWDEV-193035)
|
||||
TEMPORARY_BLACKLIST_ALL_ASICS=\
|
||||
"KFDPMTest.SuspendWithActiveProcess:"\
|
||||
"KFDPMTest.SuspendWithIdleQueue:"\
|
||||
"KFDPMTest.SuspendWithIdleQueueAfterWork:"\
|
||||
"KFDPNPTest.DisableAndCreateQueue:"\
|
||||
"KFDQMTest.GPUDoorbellWrite:"\
|
||||
"KFDQMTest.mGPUShareBO:"\
|
||||
|
||||
@@ -51,7 +51,7 @@ printUsage() {
|
||||
echo
|
||||
echo "Gtest arguments will be forwarded to the app"
|
||||
echo
|
||||
echo "Valid platform options: polaris10, vega10, vega20, all, and so on"
|
||||
echo "Valid platform options: pm, core, polaris10, vega10, vega20, all, and so on"
|
||||
echo "'all' option runs all tests"
|
||||
|
||||
return 0
|
||||
@@ -76,6 +76,7 @@ getFilter() {
|
||||
arcturus ) FILTER="--gtest_filter=$ARCT_TESTS_BLACKLIST" ;;
|
||||
navi10 ) FILTER="--gtest_filter=$NAVI10_TESTS_BLACKLIST" ;;
|
||||
core ) FILTER="--gtest_filter=$CORE_TESTS" ;;
|
||||
pm ) FILTER="--gtest_filter=$PM_TESTS" ;;
|
||||
all ) FILTER="" ;;
|
||||
*) die "Unsupported platform $platform. Exiting" ;;
|
||||
esac
|
||||
|
||||
@@ -87,8 +87,22 @@ HSAuint64 GetSystemTickCountInMicroSec() {
|
||||
}
|
||||
|
||||
bool SuspendAndWakeUp() {
|
||||
// TODO: Implement
|
||||
return false;
|
||||
printf("Please press any key after the system suspends....\n");
|
||||
|
||||
// Use "sudo apt install pm-utils" to install the "pm-suspend"
|
||||
int ret = system("sudo pm-suspend");
|
||||
|
||||
if (ret == -1) {
|
||||
printf("The system linux command could not be run!\n");
|
||||
return false;
|
||||
} else {
|
||||
if (WEXITSTATUS(ret)) {
|
||||
printf("Use 'sudo apt install pm-utils' to install 'pm-suspend' on Ubuntu\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AcquirePrivilege(OS_PRIVILEGE priv) {
|
||||
|
||||
Reference in New Issue
Block a user