RFR: CODETOOLS-7902854: jcstress: Print generated code assembly (optionally)
Aleksey Shipilev
shade at openjdk.java.net
Thu Mar 18 15:43:56 UTC 2021
Following up on test failures is hard without the generated code. Doing -XX:+PrintAssembly would print the generated code for everything, which would be unnecessarily noisy. Luckily, we can now instruct jcstress to dump the generated code for the hot loops only.
Sample output:
$ java -jar tests-custom/target/jcstress.jar -t UnfencedDekker -vv --jvmArgs "-XX:-TieredCompilation"
Java Concurrency Stress Tests
---------------------------------------------------------------------------------
Rev: 728c24c414d9b9c2, built by shade with 11.0.12-testing at 2021-03-18T15:36:51Z
Burning up to figure out the exact CPU count....... done!
Probing the target OS:
(all failures are non-fatal, but may affect testing accuracy)
----- [OK] Trying to set affinity with taskset
Initializing and probing the target VM:
(all failures are non-fatal, but may affect testing accuracy)
----- [OK] Unlocking diagnostic VM options
----- [OK] Trimming down the default VM heap size to 1/64-th of max RAM
----- [OK] Trimming down the number of compiler threads
----- [OK] Trimming down the number of parallel GC threads
----- [OK] Trimming down the number of concurrent GC threads
----- [OK] Trimming down the number of G1 concurrent refinement GC threads
----- [OK] Testing @Contended works on all results and infra objects
----- [OK] Unlocking Whitebox API for online de-optimization: all methods
----- [OK] Unlocking Whitebox API for online de-optimization: selected methods
----- [OK] Unlocking C2 local code motion randomizer
----- [OK] Unlocking C2 global code motion randomizer
----- [OK] Unlocking C2 iterative global value numbering randomizer
----- [OK] Unlocking C2 conditional constant propagation randomizer
----- [OK] Testing allocation profiling
----- [OK] Testing Thread.onSpinWait
----- [OK] Testing PrintAssembly
----- [OK] Testing compiler directives
Probing what VM modes are available:
(failures are non-fatal, but may miss some interesting cases)
----- [OK] [-XX:-TieredCompilation]
Hardware CPUs in use: 64, using Thread.onSpinWait()
Test preset mode: "default"
Writing the test results to "jcstress-results-2021-03-18-16-37-38.bin.gz"
Parsing results to "results/"
Running each test matching "UnfencedDekker" for 1 forks, 5 iterations, 1000 ms each
Solo stride size will be autobalanced within [10, 10000] elements, but taking no more than 100 Mb.
Attached the non-interactive output stream.
Printing the progress line at least every 15000 milliseconds.
[OK] o.o.j.t.fences.UnfencedDekkerTest
(fork: #1, JVM args: [-XX:-TieredCompilation])
Observed state Occurrences Expectation Interpretation
0, 0 8,376,544 ACCEPTABLE_INTERESTING Acceptable with no sequential consistency enforced
0, 1 476,317,773 ACCEPTABLE Acceptable under sequential consistency
1, 0 218,828,395 ACCEPTABLE Acceptable under sequential consistency
1, 1 799 ACCEPTABLE Acceptable under sequential consistency
VM output stream:
============================= C2-compiled nmethod ==============================
----------------------------------- Assembly -----------------------------------
Compiled method (c2) 222 128 % org.openjdk.jcstress.tests.fences.UnfencedDekkerTest_jcstress::run_actor1 @ 12 (55 bytes)
total in heap [0x00007f783863b110,0x00007f783863b7a8] = 1688
relocation [0x00007f783863b270,0x00007f783863b2a0] = 48
main code [0x00007f783863b2a0,0x00007f783863b5e0] = 832
stub code [0x00007f783863b5e0,0x00007f783863b5f8] = 24
oops [0x00007f783863b5f8,0x00007f783863b600] = 8
metadata [0x00007f783863b600,0x00007f783863b630] = 48
scopes data [0x00007f783863b630,0x00007f783863b6f8] = 200
scopes pcs [0x00007f783863b6f8,0x00007f783863b788] = 144
dependencies [0x00007f783863b788,0x00007f783863b790] = 8
nul chk table [0x00007f783863b790,0x00007f783863b7a8] = 24
--------------------------------------------------------------------------------
[Constant Pool (empty)]
--------------------------------------------------------------------------------
[Verified Entry Point]
# {method} {0x00007f7825812658} 'run_actor1' '([Lorg/openjdk/jcstress/tests/fences/UnfencedDekkerTest;[Lorg/openjdk/jcstress/infra/results/II_Result;)V' in 'org/openjdk/jcstress/tests/fences/UnfencedDekkerTest_jcstress'
0x00007f783863b2a0: callq 0x00007f784a5a1120 ; {runtime_call os::breakpoint()}
0x00007f783863b2a5: data16 data16 nopw 0x0(%rax,%rax,1)
0x00007f783863b2b0: mov %eax,-0x14000(%rsp)
0x00007f783863b2b7: push %rbp
0x00007f783863b2b8: sub $0x40,%rsp
0x00007f783863b2bc: mov 0x40(%rsi),%r10
0x00007f783863b2c0: mov %r10,(%rsp)
0x00007f783863b2c4: mov 0x28(%rsi),%rbp
...
-------------
Commit messages:
- Helper class for verbosity levels
- CODETOOLS-7902854: jcstress: Print generated code assembly (optionally)
Changes: https://git.openjdk.java.net/jcstress/pull/14/files
Webrev: https://webrevs.openjdk.java.net/?repo=jcstress&pr=14&range=00
Issue: https://bugs.openjdk.java.net/browse/CODETOOLS-7902854
Stats: 89 lines in 8 files changed: 72 ins; 2 del; 15 mod
Patch: https://git.openjdk.java.net/jcstress/pull/14.diff
Fetch: git fetch https://git.openjdk.java.net/jcstress pull/14/head:pull/14
PR: https://git.openjdk.java.net/jcstress/pull/14
More information about the jcstress-dev
mailing list