Skip to content

Commit

Permalink
Require Java 8 (perfmark#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-mastrangelo authored Dec 10, 2023
1 parent 528ba5a commit 51c2fae
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 24 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ tracing function calls to their code to see how long each part takes.
dependencies making it easy to include in other projects. If no backend for recording the trace
is present, the library safely disables itself.

* **Multiple Java Versions**: The PerfMark API supports Java 6, making it easy to include on
older or constrained environments. Additionally, PerfMark includes optimized backends for
Java 6, Java 7, and Java 9. Each of these backends is automatically loaded at runtime
(if possible) and uses advanced JVM features for maximum speed.

* **Chrome Trace Viewer Integration**: PerfMark can export to the Chrome Trace Event Format,
making it easy to view in your Web Browser.

Expand Down
2 changes: 1 addition & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}


val jdkVersion = JavaVersion.VERSION_1_6
val jdkVersion = JavaVersion.VERSION_1_8

description = "PerfMark API"

Expand Down
2 changes: 1 addition & 1 deletion impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}
}

val jdkVersion = JavaVersion.VERSION_1_6
val jdkVersion = JavaVersion.VERSION_1_8

description = "PerfMark Implementation API"

Expand Down
2 changes: 1 addition & 1 deletion java6/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description = "PerfMark Java6 API"
ext.moduleName = "io.perfmark.javasix"
ext.jdkVersion = JavaVersion.VERSION_1_6
ext.jdkVersion = JavaVersion.VERSION_1_8

java {
toolchain {
Expand Down
2 changes: 1 addition & 1 deletion java6/src/test/java/io/perfmark/java6/VersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@RunWith(JUnit4.class)
public class VersionTest {

private static final short JAVA_VERSION_6 = 50;
private static final short JAVA_VERSION_6 = 52; // Java 8, now.

@Test
public void checkVersion() throws Exception {
Expand Down
2 changes: 1 addition & 1 deletion java7/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

description = "PerfMark Java7 API"
ext.moduleName = "io.perfmark.javaseven"
ext.jdkVersion = JavaVersion.VERSION_1_7
ext.jdkVersion = JavaVersion.VERSION_1_8

compileJava {
sourceCompatibility = jdkVersion
Expand Down
2 changes: 1 addition & 1 deletion java7/src/test/java/io/perfmark/java7/VersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@RunWith(JUnit4.class)
public class VersionTest {

private static final short JAVA_VERSION_7 = 51;
private static final short JAVA_VERSION_7 = 52; // Java 8, now

@Test
public void blah() throws Exception {
Expand Down
2 changes: 1 addition & 1 deletion tracewriter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {

description = "PerfMark Tracer Output"

val jdkVersion = JavaVersion.VERSION_1_7
val jdkVersion = JavaVersion.VERSION_1_8

dependencies {
api(project(":perfmark-impl"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,29 +466,28 @@ protected void onAttachTag(Mark mark) {
TaskStart taskStart = taskStack.peekLast();
TraceEvent taskEvent = traceEvents.get(taskStart.traceEventIdx);
TraceEvent.TagMap args = taskEvent.args();
out:
{
switch (mark.getOperation()) {
case TAG_N0S1:
args = args.withUnkeyed(mark.getTagStringValue(), Mark.NO_TAG_ID);
break out;
break;
case TAG_N1S0:
args = args.withUnkeyed(Mark.NO_TAG_NAME, mark.getTagFirstNumeric());
break out;
break;
case TAG_N1S1:
args = args.withUnkeyed(mark.getTagStringValue(), mark.getTagFirstNumeric());
break out;
break;
case TAG_KEYED_N0S2:
args = args.withKeyed(mark.getTagKey(), mark.getTagStringValue());
break out;
break;
case TAG_KEYED_N1S1:
args = args.withKeyed(mark.getTagKey(), mark.getTagFirstNumeric());
break out;
break;
case TAG_KEYED_N2S1:
args =
args.withKeyed(
mark.getTagKey(), mark.getTagFirstNumeric(), mark.getTagSecondNumeric());
break out;
break;
case NONE:
case TASK_START_N1S1:
case TASK_START_N1S2:
Expand All @@ -501,25 +500,25 @@ protected void onAttachTag(Mark mark) {
case EVENT_N2S3:
case LINK:
break;
default:
throw new AssertionError(mark.getOperation());
}
throw new AssertionError(mark.getOperation());
}
traceEvents.set(taskStart.traceEventIdx, taskEvent.args(args));
}

@Override
protected void onEvent(Mark mark) {
TraceEvent.TagMap tagMap = TraceEvent.TagMap.EMPTY;
out:
{
switch (mark.getOperation()) {
case EVENT_N1S1:
case EVENT_N1S2:
break out;
break;
case EVENT_N2S2:
case EVENT_N2S3:
tagMap = tagMap.withUnkeyed(mark.getTagStringValue(), mark.getTagFirstNumeric());
break out;
break;
case NONE:
case TASK_START_N1S1:
case TASK_START_N1S2:
Expand All @@ -534,8 +533,9 @@ protected void onEvent(Mark mark) {
case TAG_KEYED_N1S1:
case TAG_KEYED_N2S1:
break;
default:
throw new AssertionError(mark.getOperation());
}
throw new AssertionError(mark.getOperation());
}
TraceEvent traceEvent =
TraceEvent.EVENT
Expand Down

0 comments on commit 51c2fae

Please sign in to comment.