From 34910d2bee69125c0c0aa7dadbb25053109705d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Galder=20Zamarre=C3=B1o?= Date: Fri, 30 May 2025 17:27:48 +0200 Subject: [PATCH] Enable BenchmarkParams construction to be overriden * It enables Fibula to construct BenchmarkParams instances with some custom field values that are required for native mode. * Some reflection might still needed to adjust fields. E.g with PGO where the executable to instrument, and the optimized executable are located in different paths. --- jmh-core/src/main/java/org/openjdk/jmh/runner/ActionMode.java | 2 +- jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jmh-core/src/main/java/org/openjdk/jmh/runner/ActionMode.java b/jmh-core/src/main/java/org/openjdk/jmh/runner/ActionMode.java index d496218aa..d2f403ecf 100644 --- a/jmh-core/src/main/java/org/openjdk/jmh/runner/ActionMode.java +++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/ActionMode.java @@ -24,7 +24,7 @@ */ package org.openjdk.jmh.runner; -enum ActionMode { +public enum ActionMode { /** * No action. diff --git a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java index c00bdebb7..b13ecde8b 100644 --- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java +++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java @@ -383,7 +383,7 @@ private Action newAction(BenchmarkListEntry br, ActionMode mode) { return new Action(newBenchmarkParams(br, mode), mode); } - private BenchmarkParams newBenchmarkParams(BenchmarkListEntry benchmark, ActionMode mode) { + protected BenchmarkParams newBenchmarkParams(BenchmarkListEntry benchmark, ActionMode mode) { int[] threadGroups = options.getThreadGroups().orElse(benchmark.getThreadGroups()); int threads = options.getThreads().orElse(