aboutsummaryrefslogtreecommitdiffstats
path: root/testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch
diff options
context:
space:
mode:
authorjchipmunk <andrey.pustovetov@gmail.com>2018-06-04 01:31:24 +0300
committerKevin Daudt <kdaudt@alpinelinux.org>2019-05-14 04:39:30 +0000
commite1b5f46e28dc2f9b2dba2ea04a9c5fc9fe49ff22 (patch)
tree859c2bd538bc04eb5c540ece7ec41a6902543e19 /testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch
parentb8d47cee2d5e792741b323a4563e78e43120c810 (diff)
downloadaports-e1b5f46e28dc2f9b2dba2ea04a9c5fc9fe49ff22.tar.bz2
aports-e1b5f46e28dc2f9b2dba2ea04a9c5fc9fe49ff22.tar.xz
testing/async-profiler: new aport
https://github.com/jvm-profiling-tools/async-profiler Sampling CPU and HEAP profiler for Java featuring AsyncGetCallTrace + perf_events Closes GH-4435
Diffstat (limited to 'testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch')
-rw-r--r--testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch b/testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch
new file mode 100644
index 0000000000..3f0e4e83aa
--- /dev/null
+++ b/testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch
@@ -0,0 +1,32 @@
+diff --git a/test/ThreadsTarget.java b/test/ThreadsTarget.java
+index cc6289c..89b2ba9 100644
+--- a/test/ThreadsTarget.java
++++ b/test/ThreadsTarget.java
+@@ -1,3 +1,5 @@
++import java.math.BigInteger;
++
+ public class ThreadsTarget {
+ public static void main(String[] args) {
+ new Thread(new Runnable() {
+@@ -17,17 +19,17 @@ public class ThreadsTarget {
+
+ static void methodForThreadEarlyEnd() {
+ long now = System.currentTimeMillis();
+- long counter = 0;
++ BigInteger counter = BigInteger.ZERO;
+ while (System.currentTimeMillis() - now < 300) {
+- counter++;
++ counter = counter.nextProbablePrime();
+ }
+ }
+
+ static void methodForRenamedThread() {
+ long now = System.currentTimeMillis();
+- long counter = 0;
++ BigInteger counter = BigInteger.ZERO;
+ while (System.currentTimeMillis() - now < 1000) {
+- counter++;
++ counter = counter.nextProbablePrime();
+ }
+ }
+ }