RFR: CODETOOLS-7903215: JMH: xperfasm throws incorrect error when xperf is not available

Aleksey Shipilev shade at openjdk.org
Wed Jun 22 10:11:17 UTC 2022


On Mon, 16 May 2022 09:49:09 GMT, XIACYBING <duke at openjdk.org> wrote:

> When Windows Performance Toolkit is not installed in Windows environment, WinPerAsmProfiler will start abnormally and throw wrong message due to wrong operation.

Ah, good find. Let's not rely on `Utils.tryWith` returning the `ArrayList`, because that would shun the messages on some failure paths. Instead, let's do this:


        Collection<String> errsStop = Utils.tryWith(path, "-stop");
        if (!errsStop.isEmpty()) {
            throw new ProfilerException(MSG_UNABLE_STOP + ": " + errsStop.toString());
        }

-------------

Changes requested by shade (Committer).

PR: https://git.openjdk.org/jmh/pull/72


More information about the jmh-dev mailing list