8309048: Remove malloc locker test case
Reviewed-by: dholmes, tschatzl, coleenp, lmesnik
This commit is contained in:
parent
927a9ed683
commit
88236263dc
@ -99,11 +99,6 @@ NSK_GC_LOCK_JVMTI_INCLUDES := \
|
||||
-I$(VM_TESTBASE_DIR)/nsk/share/native \
|
||||
-I$(VM_TESTBASE_DIR)/nsk/share/jni
|
||||
|
||||
NSK_GC_LOCK_MALLOC_INCLUDES := \
|
||||
-I$(VM_TESTBASE_DIR)/nsk/share/gc/lock/malloc \
|
||||
-I$(VM_TESTBASE_DIR)/nsk/share/native \
|
||||
-I$(VM_TESTBASE_DIR)/nsk/share/jni
|
||||
|
||||
NSK_GC_LOCK_JNI_INCLUDES := \
|
||||
-I$(VM_TESTBASE_DIR)/nsk/share/gc/lock/jni \
|
||||
-I$(VM_TESTBASE_DIR)/nsk/share/native \
|
||||
@ -179,8 +174,6 @@ BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libnativeAndMH := $(MLVM_STRESS_INCLUDES)
|
||||
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libJVMTIAllocLocker := $(NSK_GC_LOCK_JVMTI_INCLUDES)
|
||||
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libMallocLocker := $(NSK_GC_LOCK_MALLOC_INCLUDES)
|
||||
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libBooleanArrayCriticalLocker := $(NSK_GC_LOCK_JNI_INCLUDES)
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libByteArrayCriticalLocker := $(NSK_GC_LOCK_JNI_INCLUDES)
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libCharArrayCriticalLocker := $(NSK_GC_LOCK_JNI_INCLUDES)
|
||||
|
@ -1492,8 +1492,7 @@ vmTestbase_vm_gc_quick = \
|
||||
vmTestbase/gc/gctests/ReferencesGC/ReferencesGC.java \
|
||||
vmTestbase/gc/lock/jni/jnilock001/TestDescription.java \
|
||||
vmTestbase/gc/lock/jniref/jnireflock01/TestDescription.java \
|
||||
vmTestbase/gc/lock/jvmti/alloc/jvmtialloclock01/TestDescription.java \
|
||||
vmTestbase/gc/lock/malloc/malloclock01/TestDescription.java
|
||||
vmTestbase/gc/lock/jvmti/alloc/jvmtialloclock01/TestDescription.java
|
||||
|
||||
vmTestbase_vm_compiler_quick = \
|
||||
vmTestbase/vm/compiler/jbe/constprop/constprop01/constprop01.java \
|
||||
|
@ -1,23 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
exclusiveAccess.dirs=.
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @key stress randomness
|
||||
*
|
||||
* @summary converted from VM Testbase gc/lock/malloc/malloclock01.
|
||||
* VM Testbase keywords: [gc, stress, stressopt, nonconcurrent]
|
||||
*
|
||||
* @library /vmTestbase
|
||||
* /test/lib
|
||||
* @build jdk.test.whitebox.WhiteBox
|
||||
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
|
||||
* @run main/othervm/native -Xbootclasspath/a:. -Xlog:gc=debug:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI gc.lock.LockerTest -lockers malloc -t 1
|
||||
*/
|
||||
|
@ -25,7 +25,6 @@ package nsk.share.gc.lock;
|
||||
|
||||
import nsk.share.TestBug;
|
||||
import nsk.share.gc.lock.jni.JNILockers;
|
||||
import nsk.share.gc.lock.malloc.MallocLockers;
|
||||
import nsk.share.gc.lock.jvmti.JVMTIAllocLockers;
|
||||
import nsk.share.gc.lock.jniref.*;
|
||||
|
||||
@ -52,8 +51,6 @@ public class LockerUtils {
|
||||
return new JNIRefLockers();
|
||||
else if (id.equals("jniWeakGlobalRef"))
|
||||
return new JNIWeakGlobalRefLockers();
|
||||
else if (id.equals("malloc"))
|
||||
return new MallocLockers();
|
||||
else if (id.equals("jvmtiAlloc"))
|
||||
return new JVMTIAllocLockers();
|
||||
else
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
#include <jni.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include "jni_tools.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
* Class: nsk_share_gc_lock_malloc_MallocLocker
|
||||
* Method: mallocSection
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_nsk_share_gc_lock_malloc_MallocLocker_mallocSection
|
||||
(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
|
||||
void *ptr;
|
||||
time_t current_time, old_time;
|
||||
old_time = time(NULL);
|
||||
enterTime /= 1000;
|
||||
current_time = 0;
|
||||
while (current_time - old_time < enterTime) {
|
||||
ptr = malloc(1);
|
||||
mssleep((long) sleepTime);
|
||||
free(ptr);
|
||||
mssleep((long) sleepTime);
|
||||
current_time = time(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package nsk.share.gc.lock.malloc;
|
||||
|
||||
import nsk.share.TestBug;
|
||||
import nsk.share.gc.lock.Locker;
|
||||
import nsk.share.gc.lock.CriticalSectionTimedLocker;
|
||||
|
||||
/**
|
||||
* Malloc locker tries to hold malloc lock (if there is any)
|
||||
* by calling malloc() and free() in a loop.
|
||||
*/
|
||||
public class MallocLocker extends CriticalSectionTimedLocker {
|
||||
static {
|
||||
System.loadLibrary("MallocLocker");
|
||||
}
|
||||
|
||||
public MallocLocker() {
|
||||
}
|
||||
|
||||
public MallocLocker(long enterTime, long sleepTime) {
|
||||
super(enterTime, sleepTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* This native method does malloc() / free() in a loop
|
||||
* while java field locked is set to true, sleeping
|
||||
* for sleepTime between malloc() and free() and after
|
||||
* free().
|
||||
*/
|
||||
private native void mallocSection(long enterTime, long sleepTime);
|
||||
|
||||
protected void criticalSection(long enterTime, long sleepTime) {
|
||||
mallocSection(enterTime, sleepTime);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package nsk.share.gc.lock.malloc;
|
||||
|
||||
import nsk.share.TestBug;
|
||||
import nsk.share.gc.lock.Lockers;
|
||||
import nsk.share.gc.lock.Locker;
|
||||
|
||||
public class MallocLockers implements Lockers {
|
||||
public Locker createLocker(Object obj) {
|
||||
return new MallocLocker();
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include "MallocLocker.cpp"
|
||||
#include "jni_tools.cpp"
|
||||
#include "nsk_tools.cpp"
|
Loading…
Reference in New Issue
Block a user