From 80d89f5a3f5be4a684b0b633e52932d584807802 Mon Sep 17 00:00:00 2001 From: Peter Bain Date: Wed, 6 Mar 2019 10:24:24 -0500 Subject: [PATCH] Add diagnostics output Signed-off-by: Peter Bain --- fvtest/porttest/si.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fvtest/porttest/si.cpp b/fvtest/porttest/si.cpp index 7e67d694328..0309c23d20b 100644 --- a/fvtest/porttest/si.cpp +++ b/fvtest/porttest/si.cpp @@ -835,6 +835,7 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_set_limit_CORE_FILE) intptr_t rc = -1; uint64_t originalSoftLimit = 0; uint64_t finalSoftLimit = 0; + uint64_t softSetToHardLimit = 0; uint64_t originalHardLimit = 0; uint64_t currentLimit = 0; const uint64_t descriptorLimit = 256; @@ -848,6 +849,7 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_set_limit_CORE_FILE) reportTestExit(OMRPORTLIB, testName); return; } + portTestEnv->log(LEVEL_ERROR, "originalSoftLimit=%llu\n", originalSoftLimit); finalSoftLimit = originalSoftLimit; rc = omrsysinfo_set_limit(OMRPORT_RESOURCE_FILE_DESCRIPTORS, descriptorLimit); @@ -880,6 +882,7 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_set_limit_CORE_FILE) reportTestExit(OMRPORTLIB, testName); return; } + portTestEnv->log(LEVEL_ERROR, "originalHardLimit=%llu\n", originalHardLimit); /* set soft limit to hard limit */ rc = omrsysinfo_set_limit(OMRPORT_RESOURCE_FILE_DESCRIPTORS, originalHardLimit); @@ -889,6 +892,15 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_set_limit_CORE_FILE) return; } + /* get new soft limit */ + rc = omrsysinfo_get_limit(OMRPORT_RESOURCE_FILE_DESCRIPTORS, &softSetToHardLimit); + if (OMRPORT_LIMIT_UNKNOWN == rc) { + outputErrorMessage(PORTTEST_ERROR_ARGS, "omrsysinfo_get_limit FAILED: OMRPORT_LIMIT_UNKNOWN\n"); + reportTestExit(OMRPORTLIB, testName); + return; + } + portTestEnv->log(LEVEL_ERROR, "soft set to hard limit=%llu\n", softSetToHardLimit); + /* set soft limit to old value */ rc = omrsysinfo_set_limit(OMRPORT_RESOURCE_FILE_DESCRIPTORS, originalSoftLimit); if (0 != rc) { @@ -910,11 +922,11 @@ TEST(PortSysinfoTest, sysinfo_test_sysinfo_set_limit_CORE_FILE) * the actual value may be much smaller than requested. * In that case, just try setting it to the same value. */ - uint64_t newHardLimit = (OMRPORT_LIMIT_UNLIMITED == rc) ? originalHardLimit: originalHardLimit - 1; + uint64_t newHardLimit = (OMRPORT_LIMIT_UNLIMITED == rc) ? softSetToHardLimit: softSetToHardLimit - 1; rc = omrsysinfo_set_limit(OMRPORT_RESOURCE_FILE_DESCRIPTORS | OMRPORT_LIMIT_HARD, newHardLimit); if (0 != rc) { - outputErrorMessage(PORTTEST_ERROR_ARGS, "omrsysinfo_set_limit set hard limit FAILED rc=%d\n", rc); + outputErrorMessage(PORTTEST_ERROR_ARGS, "omrsysinfo_set_limit set hard limit=%lld FAILED rc=%d\n", rc, newHardLimit); reportTestExit(OMRPORTLIB, testName); return; }