diff options
| author | jchipmunk <andrey.pustovetov@gmail.com> | 2018-06-04 01:31:24 +0300 |
|---|---|---|
| committer | Kevin Daudt <kdaudt@alpinelinux.org> | 2019-05-14 04:39:30 +0000 |
| commit | e1b5f46e28dc2f9b2dba2ea04a9c5fc9fe49ff22 (patch) | |
| tree | 859c2bd538bc04eb5c540ece7ec41a6902543e19 /testing/async-profiler | |
| parent | b8d47cee2d5e792741b323a4563e78e43120c810 (diff) | |
| download | aports-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')
| -rw-r--r-- | testing/async-profiler/APKBUILD | 41 | ||||
| -rw-r--r-- | testing/async-profiler/thread-smoke-test_should_do_some_real_work.patch | 32 |
2 files changed, 73 insertions, 0 deletions
diff --git a/testing/async-profiler/APKBUILD b/testing/async-profiler/APKBUILD new file mode 100644 index 0000000000..84c9c6bb51 --- /dev/null +++ b/testing/async-profiler/APKBUILD @@ -0,0 +1,41 @@ +# Contributor: Andrey Pustovetov <andrey.pustovetov@gmail.com> +# Maintainer: Andrey Pustovetov <andrey.pustovetov@gmail.com> +pkgname=async-profiler +pkgver=1.5 +pkgrel=0 +pkgdesc="Sampling CPU and HEAP profiler for Java featuring AsyncGetCallTrace + perf_events" +url="https://github.com/jvm-profiling-tools/async-profiler" +arch="all" +depends="bash" +license="Apache-2.0" +options="!checkroot" # due to fakeroot the test suite fails +makedepends="linux-headers openjdk8" +checkdepends="bash openjdk8-dbg" +source="$pkgname-$pkgver.tar.gz::https://github.com/jvm-profiling-tools/async-profiler/archive/v$pkgver.tar.gz + thread-smoke-test_should_do_some_real_work.patch + " + +build() { + make +} + +check() { + # exclude tests depended to modify /proc/sys/kernel/perf_event_paranoid + JAVA_HOME="/usr/lib/jvm/default-jvm" \ + test/alloc-smoke-test.sh + echo "All tests passed" +} + +package() { + local homedir="/usr/share/$pkgname" + local destdir="$pkgdir/$homedir" + mkdir -p "$destdir" + install -Dm0644 "$builddir"/build/libasyncProfiler.so "$destdir"/build/libasyncProfiler.so + install -Dm0755 "$builddir"/build/jattach "$destdir"/build/jattach + install -Dm0755 "$builddir"/profiler.sh "$destdir"/profiler.sh + mkdir -p "$pkgdir"/usr/bin + ln -sf "$homedir"/profiler.sh "$pkgdir"/usr/bin/profiler.sh +} + +sha512sums="a127f6c676e2f06c2690ea04da660e36a5c127dc22b9f2edec801bd1829bcd3fb608572a8e38fcfa1e27067da27b16f77d2cb1fa7848e6afdf4bdda361f47e86 async-profiler-1.5.tar.gz +180d5a4231eab62399888491ae80338f38f0ebbfbd1157bea2d58bfc1f6c344d9ba144aa87deb11c2143a9df5dd21531fdcf98f2d5d9ce8f715e8caeb2b2ac2e thread-smoke-test_should_do_some_real_work.patch" 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(); + } + } + } |
