Skip to content

Commit

Permalink
Jit Debug Agent update to match guidelines
Browse files Browse the repository at this point in the history
- Added copywrite to all files
- Updated GroupId and version number in Pom
- Updated Readme to reflect name changes

Signed-off-by: Shane Killoran <[email protected]>
  • Loading branch information
ShaneKilloran committed Dec 7, 2021
1 parent 515455d commit 0d164b9
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 4 deletions.
4 changes: 2 additions & 2 deletions jit-debug-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ to determine the JIT method responsible for the failure, or we are unable to tra
# How to use this tool

1. Using maven and running the command `$ mvn install` in this directory will package the agent into a jar file, you will find it in the `target` directory.
2. add the java agent option to your `java` execution which would look like this: `-javaagent: jit-debug-agent-1.0-SNAPSHOT.jar`
2. add the java agent option to your `java` execution which would look like this: `-javaagent: jit-debug-agent-1.0.jar`
3. Run the test by forcing preexistence.

Currently the tool is not robust enough to enable this automatically, so we have to force every JIT method compilation to use
preexistence. This is to ensure that we have a _revert to interpreter_ stub inserted in the preprologue of every method.
Inserting this stub happens at binary encoding and should not affect the semantics of the method itself.

```
java -Xdump:none -Xnoaot -Xcheck:jni -Xjit:forceUsePreexistence -javaagent: jit-debug-agent-1.0-SNAPSHOT.jar <test>
java -Xdump:none -Xnoaot -Xcheck:jni -Xjit:forceUsePreexistence -javaagent: jit-debug-agent-1.0.jar <test>
4 changes: 2 additions & 2 deletions jit-debug-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>groupId</groupId>
<groupId>org.openj9</groupId>
<artifactId>jit-debug-agent</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0</version>

<dependencies>
<dependency>
Expand Down
21 changes: 21 additions & 0 deletions jit-debug-agent/src/main/java/DebugAgent.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{{- /*******************************************************************************
* Copyright (c) 2021, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
* or the Apache License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following
* Secondary Licenses when the conditions for such availability set
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
* General Public License, version 2 with the GNU Classpath
* Exception [1] and GNU General Public License, version 2 with the
* OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/ -}}
import java.lang.instrument.*;
import java.security.ProtectionDomain;
import java.io.IOException;
Expand Down
21 changes: 21 additions & 0 deletions jit-debug-agent/src/main/java/DebugClassWriter.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{{- /*******************************************************************************
* Copyright (c) 2021, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
* or the Apache License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following
* Secondary Licenses when the conditions for such availability set
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
* General Public License, version 2 with the GNU Classpath
* Exception [1] and GNU General Public License, version 2 with the
* OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/ -}}
import org.objectweb.asm.*;
import java.io.IOException;

Expand Down
21 changes: 21 additions & 0 deletions jit-debug-agent/src/main/java/EvaluateDebugAdapter.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{{- /*******************************************************************************
* Copyright (c) 2021, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
* or the Apache License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following
* Secondary Licenses when the conditions for such availability set
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
* General Public License, version 2 with the GNU Classpath
* Exception [1] and GNU General Public License, version 2 with the
* OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/ -}}
import org.objectweb.asm.*;

public class EvaluateDebugAdapter extends MethodVisitor {
Expand Down
21 changes: 21 additions & 0 deletions jit-debug-agent/src/main/java/ExpectDebugAdapter.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{{- /*******************************************************************************
* Copyright (c) 2021, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
* or the Apache License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following
* Secondary Licenses when the conditions for such availability set
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
* General Public License, version 2 with the GNU Classpath
* Exception [1] and GNU General Public License, version 2 with the
* OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/ -}}
import org.objectweb.asm.*;

public class ExpectDebugAdapter extends ClassVisitor {
Expand Down
21 changes: 21 additions & 0 deletions jit-debug-agent/src/main/java/InvokeDebugAdapter.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{{- /*******************************************************************************
* Copyright (c) 2021, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
* or the Apache License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following
* Secondary Licenses when the conditions for such availability set
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
* General Public License, version 2 with the GNU Classpath
* Exception [1] and GNU General Public License, version 2 with the
* OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/ -}}
import org.objectweb.asm.*;

public class InvokeDebugAdapter extends MethodVisitor {
Expand Down
21 changes: 21 additions & 0 deletions jit-debug-agent/src/main/java/MethodDebugAdapter.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{{- /*******************************************************************************
* Copyright (c) 2021, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
* or the Apache License, Version 2.0 which accompanies this distribution and
* is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following
* Secondary Licenses when the conditions for such availability set
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
* General Public License, version 2 with the GNU Classpath
* Exception [1] and GNU General Public License, version 2 with the
* OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/ -}}
import org.objectweb.asm.*;

public class MethodDebugAdapter extends ClassVisitor {
Expand Down

0 comments on commit 0d164b9

Please sign in to comment.