Error while running xperfasm JMH profiler on windows: xperf: error: NT Kernel Logger: Invalid flags. (0x3ec)

Viewed 2268

I'm adding microbenchmark to my JAVA application thanks to JMH.

I'm running the benchmarks on windows 10:

The stack profiler works well:

java -jar target/benchmarks.jar -prof stack

Secondary result "benchmark.ValueExtractorBench.cleanValue_Benchmark:·stack": Stack profiler:

....[Thread state distributions]....................................................................

99.7%         RUNNABLE
 0.3%         WAITING

....[Thread state: RUNNABLE]........................................................................

 26.6%  26.7% java.lang.String.regionMatches
 23.2%  23.2% blabla...

But the xperfasm fails at init:

java -jar target/benchmarks.jar -prof xperfasm

# Run progress: 0.00% complete, ETA 00:00:00 # Fork: 1 of 5 # Preparing profilers: WinPerfAsmProfiler Exception in thread "main" java.lang.IllegalStateException: Failed to start xperf: [xperf: error: NT Kernel Logger: Invalid flags. (0x3ec). ]

at org.openjdk.jmh.profile.WinPerfAsmProfiler.beforeTrial(WinPerfAsmProfiler.java:129)
at org.openjdk.jmh.runner.Runner.runSeparate(Runner.java:649)
at org.openjdk.jmh.runner.Runner.runBenchmarks(Runner.java:561)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:320)
at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
at org.openjdk.jmh.Main.main(Main.java:71)

Note: xperfasm is well listed in the available profilers (-lprof)

I'd like to be able to profile my microbenchmarks with more complete data than those given by the stack profiler.

Thank you :)

1 Answers

I observed exactly this exact error-code when i tried to run this from a console without admin privileges.

Related