# HG changeset patch # User Lukas Stadler # Date 1398329052 -7200 # Node ID 520ab37fb5b64726bbcd840f711ff17a8c36a22f # Parent b68a693a7ad419211dea78d47381fa408a227e08 show Truffle call target names in BenchmarkCounters diff -r b68a693a7ad4 -r 520ab37fb5b6 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Thu Apr 24 10:44:12 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java Thu Apr 24 10:44:12 2014 +0200 @@ -108,14 +108,22 @@ public static final ArrayList staticCounters = new ArrayList<>(); @SuppressFBWarnings(value = "AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACTION", justification = "concurrent abstraction calls are in synchronized block") - public static int getIndex(DynamicCounterNode counter) { + private static int getIndex(DynamicCounterNode counter) { if (!enabled) { throw new GraalInternalError("counter nodes shouldn't exist when counters are not enabled: " + counter.getGroup() + ", " + counter.getName()); } - String name = counter.getName(); + String name; String group = counter.getGroup(); - name = counter.isWithContext() && counter.graph().method() != null ? name + " @ " + counter.graph().graphId() + ":" + MetaUtil.format("%h.%n", counter.graph().method()) + "#" + group : name + - "#" + group; + if (counter.isWithContext()) { + name = counter.getName() + " @ " + counter.graph().graphId() + ":" + MetaUtil.format("%h.%n", counter.graph().method()); + if (counter.graph().name != null) { + name += " (" + counter.graph().name + ")"; + } + name += "#" + group; + + } else { + name = counter.getName() + "#" + group; + } Integer index = indexes.get(name); if (index == null) { synchronized (BenchmarkCounters.class) { @@ -135,7 +143,7 @@ return index; } - public static synchronized void dump(PrintStream out, double seconds, long[] counters, int maxRows) { + private static synchronized void dump(PrintStream out, double seconds, long[] counters, int maxRows) { if (!groups.isEmpty()) { out.println("====== dynamic counters (" + staticCounters.size() + " in total) ======"); for (String group : new TreeSet<>(groups)) { @@ -152,7 +160,7 @@ } } - public static synchronized void clear(long[] counters) { + private static synchronized void clear(long[] counters) { delta = counters; } @@ -228,7 +236,7 @@ return (counter * 200 + 1) / sum / 2; } - public abstract static class CallbackOutputStream extends OutputStream { + private abstract static class CallbackOutputStream extends OutputStream { protected final PrintStream delegate; private final byte[][] patterns; @@ -371,7 +379,7 @@ if (index >= config.graalCountersSize) { throw new GraalInternalError("too many counters, reduce number of counters or increase -XX:GraalCounterSize=... (current value: " + config.graalCountersSize + ")"); } - ConstantLocationNode arrayLocation = ConstantLocationNode.create(LocationIdentity.ANY_LOCATION, Kind.Long, config.graalCountersThreadOffset, graph); + ConstantLocationNode arrayLocation = ConstantLocationNode.create(LocationIdentity.ANY_LOCATION, wordKind, config.graalCountersThreadOffset, graph); ReadNode readArray = graph.add(new ReadNode(thread, arrayLocation, StampFactory.forKind(wordKind), BarrierType.NONE, false)); ConstantLocationNode location = ConstantLocationNode.create(LocationIdentity.ANY_LOCATION, Kind.Long, Unsafe.ARRAY_LONG_INDEX_SCALE * index, graph); ReadNode read = graph.add(new ReadNode(readArray, location, StampFactory.forKind(Kind.Long), BarrierType.NONE, false));