Skip to content

Commit ecbb3ab

Browse files
committed
Export WireIO version as a system property
1 parent 401e692 commit ecbb3ab

7 files changed

Lines changed: 35 additions & 2 deletions

File tree

btrace-agent/src/main/java/org/openjdk/btrace/agent/Main.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
import org.openjdk.btrace.core.comm.ErrorCommand;
8484
import org.openjdk.btrace.core.comm.InstrumentCommand;
8585
import org.openjdk.btrace.core.comm.StatusCommand;
86+
import org.openjdk.btrace.core.comm.WireIO;
8687
import org.openjdk.btrace.instr.BTraceTransformer;
8788
import org.openjdk.btrace.instr.Constants;
8889
import org.openjdk.btrace.runtime.BTraceRuntimes;
@@ -836,6 +837,8 @@ private static void startServer() {
836837
debugPrint("starting server at " + port);
837838
}
838839
System.setProperty("btrace.port", String.valueOf(port));
840+
System.setProperty("btrace.wireio", String.valueOf(WireIO.VERSION));
841+
839842
String scriptOutputFile = settings.getOutputFile();
840843
if (scriptOutputFile != null && scriptOutputFile.length() > 0) {
841844
System.setProperty("btrace.output", scriptOutputFile);

btrace-client/src/main/java/org/openjdk/btrace/client/JpsUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ static Collection<String> listVms() {
4545
String mainClass = MonitoredVmUtil.mainClass(mvm, false);
4646

4747
vms.add(
48-
"["
48+
"("
4949
+ (hasBTraceServer(vmPid) ? "+" : "-")
50-
+ "] "
50+
+ ") "
5151
+ vmPid
5252
+ " "
5353
+ mainClass

btrace-core/src/main/java/org/openjdk/btrace/core/comm/DisconnectCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.ObjectOutput;
66
import java.io.PrintWriter;
77

8+
/** @since WireIO v.1 */
89
public final class DisconnectCommand extends Command implements PrintableCommand {
910
private String probeId = "";
1011

btrace-core/src/main/java/org/openjdk/btrace/core/comm/ListProbesCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.Collection;
99
import java.util.List;
1010

11+
/** @since WireIO v.1 */
1112
public class ListProbesCommand extends Command implements PrintableCommand {
1213
private final List<String> probes = new ArrayList<>();
1314

btrace-core/src/main/java/org/openjdk/btrace/core/comm/ReconnectCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.io.ObjectInput;
55
import java.io.ObjectOutput;
66

7+
/** @since WireIO v.1 */
78
public class ReconnectCommand extends Command {
89
public static final int STATUS_FLAG = 8;
910

btrace-core/src/main/java/org/openjdk/btrace/core/comm/WireIO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.io.ObjectOutput;
3030

3131
public class WireIO {
32+
public static final int VERSION = 1;
3233

3334
private WireIO() {}
3435

btrace-ui/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plugins {
2+
id 'net.nemerosa.versioning' version '2.6.1'
3+
}
4+
5+
sourceCompatibility = '11'
6+
targetCompatibility = '11'
7+
8+
dependencies {
9+
compile project(':btrace-core')
10+
compile project(':btrace-compiler')
11+
compile project(':btrace-instr')
12+
}
13+
14+
jar {
15+
manifest {
16+
attributes(
17+
'Built-By' : System.properties['user.name'],
18+
'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
19+
'Build-Revision' : versioning.info.commit,
20+
'Created-By' : "Gradle ${gradle.gradleVersion}",
21+
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
22+
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
23+
'Main-Class' : "org.openjdk.btrace.client.Main"
24+
)
25+
}
26+
}

0 commit comments

Comments
 (0)