changeset 840:8641b75705dc

profilers: perfasm should use distinct param ids for asm/perf dump outputs.
author shade
date Thu, 26 Jun 2014 18:15:31 +0400
parents 1406a31681a6
children abb1bcb09247
files jmh-core/src/main/java/org/openjdk/jmh/infra/BenchmarkParams.java jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/infra/BenchmarkParams.java	Thu Jun 26 17:55:41 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/infra/BenchmarkParams.java	Thu Jun 26 18:15:31 2014 +0400
@@ -391,4 +391,14 @@
         return params.compareTo(o.params);
     }
 
+    public String id() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(benchmark).append("-");
+        sb.append(mode);
+        for (String key : params.keys()) {
+            sb.append("-");
+            sb.append(key).append("-").append(params.get(key));
+        }
+        return sb.toString();
+    }
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Thu Jun 26 17:55:41 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfAsmProfiler.java	Thu Jun 26 18:15:31 2014 +0400
@@ -261,7 +261,7 @@
 
         if (SAVE_PERF_OUTPUT) {
             String target = (SAVE_PERF_OUTPUT_TO_FILE == null) ?
-                    SAVE_PERF_OUTPUT_TO + "/" + params.getBenchmark() + "-perf" :
+                    SAVE_PERF_OUTPUT_TO + "/" + params.id() + "-perf" :
                     SAVE_PERF_OUTPUT_TO_FILE;
             try {
                 FileUtils.copy(perfParsedData, target);
@@ -377,7 +377,7 @@
          */
         if (SAVE_ASM_OUTPUT != null) {
             String target = (SAVE_ASM_OUTPUT_TO_FILE == null) ?
-                    SAVE_ASM_OUTPUT_TO + "/" + params.getBenchmark() + ".asm" :
+                    SAVE_ASM_OUTPUT_TO + "/" + params.id() + ".asm" :
                     SAVE_ASM_OUTPUT_TO_FILE;
             FileOutputStream asm = null;
             try {