Issues with dtraceasm, and a workaround
Henri Tremblay
henri.tremblay at gmail.com
Tue Feb 23 14:42:28 UTC 2021
Seems to work perfectly. As I said, I can't get hsdis to work but I see the
normal address output so it looks good to me.
I tried with 1.8.0_275, 11.0.9 and 16-ea-30. I also tried GraalVM CE
20.1.0. It works as well. The funny part is that it resolves the addresses
a bit more. Here are the outputs:
Hotspot:
Perf output processed (skipped 1.364 seconds):
Column 1: sampled_pc (837 events)
Hottest code regions (>10.00% "sampled_pc" events):
....[Hottest Region
1]..............................................................................
0x107740320, [unknown] (18 bytes)
<no assembly is recorded, native region>
....................................................................................................
99.40% <total for region 1>
....[Hottest
Regions]...............................................................................
99.40% 0x107740320 [unknown] (18 bytes)
0.24% 0x10588fcd8 [unknown] (0 bytes)
0.12% 0x10551e39e [unknown] (0 bytes)
0.12% 0x105888c4e [unknown] (0 bytes)
0.12% 0x1058907fb [unknown] (0 bytes)
....................................................................................................
100.00% <totals>
....[Hottest Methods (after
inlining)]..............................................................
99.40% 0x107740320 [unknown]
0.24% 0x10588fcd8 [unknown]
0.12% 0x105888c4e [unknown]
0.12% 0x1058907fb [unknown]
0.12% 0x10551e39e [unknown]
....................................................................................................
100.00% <totals>
....[Distribution by
Source]........................................................................
99.40% 0x107740320
0.24% 0x10588fcd8
0.12% 0x105888c4e
0.12% 0x10551e39e
0.12% 0x1058907fb
....................................................................................................
100.00% <totals>
WARNING: The perf event count is suspiciously low (837). The performance
data might be
inaccurate or misleading. Try to do the profiling again, or tune up the
sampling frequency.
With some profilers on Mac OS X, System Integrity Protection (SIP) may
prevent profiling.
In such case, temporarily disabling SIP with 'csrutil disable' might help.
# Run complete. Total time: 00:00:02
REMEMBER: The numbers below are just data. To gain reusable insights, you
need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof),
design factorial
experiments, perform baseline and negative tests that provide experimental
control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews
from the domain experts.
Do not assume the numbers tell you what you want them to tell.
Benchmark Mode Cnt Score
Error Units
JMHSample_01_HelloWorld.wellHelloThere thrpt 3960115374.548
ops/s
JMHSample_01_HelloWorld.wellHelloThere:·asm thrpt NaN
---
GraalVM:
Hottest code regions (>10.00% "sampled_pc" events):
....[Hottest Region
1]..............................................................................
0x11e7581c0, [unknown] (20 bytes)
<no assembly is recorded, native region>
....................................................................................................
98.19% <total for region 1>
....[Hottest
Regions]...............................................................................
98.19% 0x11e7581c0 [unknown] (20 bytes)
0.36% libjvm.dylib outputStream::update_position(char
const*, unsigned long) (3 bytes)
0.12% libjvm.dylib SpinPause (0 bytes)
0.12% libjvm.dylib LIRGenerator::do_getClass(Intrinsic*)
(0 bytes)
0.12% libjvm.dylib
G1BarrierSetRuntime::write_ref_array_post_entry(HeapWord*,
unsigned long) (0 bytes)
0.12% libjvm.dylib jni_GetArrayLength (0 bytes)
0.12% libjvm.dylib Arena::Amalloc(unsigned long,
AllocFailStrategy::AllocFailEnum) (0 bytes)
0.12% libjvm.dylib nmethod::print_nmethod(bool) (0 bytes)
0.12% libjvm.dylib
AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<802934ull,
G1BarrierSet>, (AccessInternal::BarrierType)1,
802934ull>::oop_access_barrier(oopDesc*, long, oopDesc*) (0 bytes)
0.12% libjvm.dylib VMThread::execute(VM_Operation*) (0
bytes)
0.12% 0x116c71ca2 [unknown] (0 bytes)
0.12% libsystem_c.dylib DYLD-STUB$$pthread_mutex_unlock (0
bytes)
0.12% libsystem_platform.dylib _platform_strlen (0 bytes)
....................................................................................................
99.88% <totals>
....[Hottest Methods (after
inlining)]..............................................................
98.19% 0x11e7581c0 [unknown]
0.36% libjvm.dylib outputStream::update_position(char
const*, unsigned long)
0.12% libjvm.dylib
AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<802934ull,
G1BarrierSet>, (AccessInternal::BarrierType)1,
802934ull>::oop_access_barrier(oopDesc*, long, oopDesc*)
0.12% libjvm.dylib VMThread::execute(VM_Operation*)
0.12% libjvm.dylib Arena::Amalloc(unsigned long,
AllocFailStrategy::AllocFailEnum)
0.12% 0x116c71ca2 [unknown]
0.12% libjvm.dylib jni_GetArrayLength
0.12% libjvm.dylib nmethod::print_nmethod(bool)
0.12% libjvm.dylib SpinPause
0.12% libjvm.dylib LIRGenerator::do_getClass(Intrinsic*)
0.12% libsystem_c.dylib DYLD-STUB$$pthread_mutex_unlock
0.12% libsystem_platform.dylib _platform_strlen
0.12% libjvm.dylib
G1BarrierSetRuntime::write_ref_array_post_entry(HeapWord*,
unsigned long)
....................................................................................................
99.88% <totals>
....[Distribution by
Source]........................................................................
98.19% 0x11e7581c0
1.33% libjvm.dylib
0.12% 0x116c71ca2
0.12% libsystem_platform.dylib
0.12% libsystem_c.dylib
....................................................................................................
99.88% <totals>
On Tue, 23 Feb 2021 at 06:02, Aleksey Shipilev <shade at redhat.com> wrote:
> On 2/23/21 5:27 AM, Henri Tremblay wrote:
> > Yes. This looks fine:
> >
> > Collection<String> messages
> =Utils.tryWith("sudo","kill","-TERM",Long.toString(dtraceProcess.pid()));
> > if (!messages.isEmpty()) {
> > throw new IllegalStateException(messages.toString());
> > }
> >
> > However, Paul is right, the pid() method doesn't exist so you will need
> something like this:
>
> Yes. In fact, there is already a similar code in the Utils that does
> similar thing. The additional
> wrinkle is that the code is supposed to compile and run on JDK 7 and JDK
> 8, which requires a bit
> more fiddling.
>
> I have updated the PR with the latest version, please try it?
> https://github.com/openjdk/jmh/pull/22
>
> --
> Thanks,
> -Aleksey
>
>
More information about the jmh-dev
mailing list