Merge "ART: Revert base/logging conditional hacks"
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index adbf9fd..56a9962 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -595,9 +595,14 @@
: optimizer::DexToDexCompilationLevel::kRequired);
}
} else if ((access_flags & kAccNative) != 0) {
- // Are we extracting only and have support for generic JNI down calls?
- if (!driver->GetCompilerOptions().IsJniCompilationEnabled() &&
- InstructionSetHasGenericJniStub(driver->GetInstructionSet())) {
+ const InstructionSet instruction_set = driver->GetInstructionSet();
+ const bool use_generic_jni =
+ // Are we extracting only and have support for generic JNI down calls?
+ (!driver->GetCompilerOptions().IsJniCompilationEnabled() &&
+ InstructionSetHasGenericJniStub(instruction_set)) ||
+ // Always punt to generic JNI for MIPS because of no support for @CriticalNative. b/31743474
+ (instruction_set == kMips || instruction_set == kMips64);
+ if (use_generic_jni) {
// Leaving this empty will trigger the generic JNI version
} else {
// Look-up the ArtMethod associated with this code_item (if any)
diff --git a/runtime/base/logging.h b/runtime/base/logging.h
index 26ab1f9..5f84204 100644
--- a/runtime/base/logging.h
+++ b/runtime/base/logging.h
@@ -26,8 +26,8 @@
namespace art {
// Make libbase's LogSeverity more easily available.
-using LogSeverity = ::android::base::LogSeverity;
-using ScopedLogSeverity = ::android::base::ScopedLogSeverity;
+using ::android::base::LogSeverity;
+using ::android::base::ScopedLogSeverity;
// The members of this struct are the valid arguments to VLOG and VLOG_IS_ON in code,
// and the "-verbose:" command line argument.
diff --git a/runtime/jni_env_ext-inl.h b/runtime/jni_env_ext-inl.h
index 5967eee..685b056 100644
--- a/runtime/jni_env_ext-inl.h
+++ b/runtime/jni_env_ext-inl.h
@@ -33,8 +33,8 @@
size_t entry_count = locals.Capacity();
if (entry_count > 16) {
locals.Dump(LOG_STREAM(WARNING) << "Warning: more than 16 JNI local references: "
- << entry_count << " (most recent was a "
- << PrettyTypeOf(obj) << ")\n");
+ << entry_count << " (most recent was a "
+ << PrettyTypeOf(obj) << ")\n");
// TODO: LOG(FATAL) in a later release?
}
}
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 7091e79..45a9be7 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -2786,7 +2786,7 @@
GetThread()->Dump(LOG_STREAM(FATAL_WITHOUT_ABORT));
space->AsImageSpace()->DumpSections(LOG_STREAM(FATAL_WITHOUT_ABORT));
LOG(FATAL_WITHOUT_ABORT) << "Method@" << method->GetDexMethodIndex() << ":" << method
- << " klass@" << klass;
+ << " klass@" << klass;
// Pretty info last in case it crashes.
LOG(FATAL) << "Method " << PrettyMethod(method) << " klass " << PrettyClass(klass);
}
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 0754640..03b03de 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -828,8 +828,8 @@
if (total_delay >= MsToNs(kThreadSuspendTimeoutMs)) {
ThreadSuspendByPeerWarning(self,
::android::base::FATAL,
- "Thread suspension timed out",
- peer);
+ "Thread suspension timed out",
+ peer);
if (suspended_thread != nullptr) {
CHECK_EQ(suspended_thread, thread);
suspended_thread->ModifySuspendCount(soa.Self(), -1, nullptr, debug_suspension);
diff --git a/tools/jfuzz/README.md b/tools/jfuzz/README.md
index 3eb41cf..c107db1 100644
--- a/tools/jfuzz/README.md
+++ b/tools/jfuzz/README.md
@@ -62,6 +62,18 @@
--report_script : path to script called for each divergence
--jfuzz_arg : argument for jfuzz
+How to start JFuzz nightly testing
+==================================
+
+ run_jfuzz_test_nightly.py
+ [--num_proc NUM_PROC]
+
+where
+
+ --num_proc : number of run_jfuzz_test.py instances to run (8 by default)
+
+Remaining arguments are passed to run\_jfuzz_test.py.
+
How to start J/DexFuzz testing (multi-layered)
==============================================
diff --git a/tools/jfuzz/run_jfuzz_test_nightly.py b/tools/jfuzz/run_jfuzz_test_nightly.py
new file mode 100755
index 0000000..cd338fb
--- /dev/null
+++ b/tools/jfuzz/run_jfuzz_test_nightly.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python3.4
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import os
+import subprocess
+import sys
+
+from tempfile import TemporaryFile
+
+# Default arguments for run_jfuzz_test.py.
+DEFAULT_ARGS = ['--num_tests=20000']
+
+# run_jfuzz_test.py success string.
+SUCCESS_STRING = 'success (no divergences)'
+
+# Constant returned by string find() method when search fails.
+NOT_FOUND = -1
+
+def main(argv):
+ cwd = os.path.dirname(os.path.realpath(__file__))
+ cmd = [cwd + '/run_jfuzz_test.py'] + DEFAULT_ARGS
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--num_proc', default=8,
+ type=int, help='number of processes to run')
+ # Unknown arguments are passed to run_jfuzz_test.py.
+ (args, unknown_args) = parser.parse_known_args()
+ output_files = [TemporaryFile('wb+') for _ in range(args.num_proc)]
+ processes = []
+ for output_file in output_files:
+ processes.append(subprocess.Popen(cmd + unknown_args, stdout=output_file,
+ stderr=subprocess.STDOUT))
+ try:
+ # Wait for processes to terminate.
+ for proc in processes:
+ proc.wait()
+ except KeyboardInterrupt:
+ for proc in processes:
+ proc.kill()
+ # Output results.
+ for i, output_file in enumerate(output_files):
+ output_file.seek(0)
+ output_str = output_file.read().decode('ascii')
+ output_file.close()
+ print('Tester', i)
+ if output_str.find(SUCCESS_STRING) == NOT_FOUND:
+ print(output_str)
+ else:
+ print(SUCCESS_STRING)
+
+if __name__ == '__main__':
+ main(sys.argv)