Bug in Utils.tryWith
Aleksey Shipilev
aleksey.shipilev at oracle.com
Tue May 26 06:34:39 UTC 2015
Hi,
Hi,
On 05/24/2015 05:40 PM, Aleksandr Dubinsky wrote:
> Firstly, I must say, you are very brave to be using raw Runtime.exec! In
> any case, there is a simple bug at line 340. `if (err > 0)` should be `if
> (err != 0)`.
Yes, thanks, fixed:
https://bugs.openjdk.java.net/browse/CODETOOLS-7901434
We should probably switch to ProcessBuilders as well.
> I would also modify WinPerfAsmProfiler line 161 to say "Failed to start
> xperf: " + errs + "\nEnsure that you are running this profiling session as
> an administrator." or similar.
Nope. That line is the part of sanity testing, assuming we have checked
the profiler is available. We "just" need to get better at figuring out
if xperf is available under current privileges, see
WinPerfAsmProfiler::<clinit>.
> There is something hugely difficult in trying to get HSDIS for Windows,
> with copyright nazis and other idiots getting in the way. It's good that
> you link to the Oracle wiki, although it isn't very helpful. This
> StackOverflow discussion (to which I've contributed the best I could) is
> more helpful
> http://stackoverflow.com/questions/1503479/how-to-see-jit-compiled-code-in-jvm/15146962#15146962
> (and expands on the same solutions that are found in the comments to the
> Oracle wiki). Might make sense linking here until the Oracle wiki improves,
> you write a dedicated help page, or someone just publishes a windows binary
> that works.
Nope again. The link points to the PrintAssembly description, and any
hassle with building the actual hsdis can be resolved with a tiny bit of
following up from there and/or Googling.
> Lastly, I beg you to document all of the system properties referenced in
> WinPerfAsmProfiler AND AbstractPerfAsmProfiler as a TABLE in the
> WinPerfAsmProfiler javadoc comment.
You have to understand these options are not stable, and cannot be a
part of documentation. You use these options at your own risk, and
should consult with the (authoritative) source code to make sure it does
what you want. Not every tuning knob is going to be documented.
The only UX improvement we can do is to make profilers accept these
options through regular means, e.g. -prof perfasm:events=cycles,insns;
which will allow, among other things, using -prof perfasm:help.
Thanks,
-Aleksey
More information about the jmh-dev
mailing list