Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6658: Remove unnecessary storing of pre-instrumented bytecode #23

Closed
wants to merge 3 commits into from

Conversation

@jessyec-s
Copy link
Contributor

jessyec-s commented Dec 19, 2019

This patch addresses JMC-6658 and removes the unnecessary storing of pre-instrumented bytecode that was implemented in JMC-5458.

Progress

  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

JMC-6658: Remove unnecessary storing of pre-instrumented bytecode

Approvers

  • Marcus Hirt (hirt - Reviewer)
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 19, 2019

👋 Welcome back jessyec-s! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request (refresh this page to view it).

@openjdk openjdk bot added the rfr label Dec 19, 2019
@mlbridge
Copy link

mlbridge bot commented Dec 19, 2019

Webrevs

@jessyec-s jessyec-s mentioned this pull request Dec 19, 2019
2 of 2 tasks complete
@thegreystone
Copy link
Collaborator

thegreystone commented Dec 20, 2019

Hi Jessye! Looks good, but the testClearAllTransforms tests should really validate that the byte code no longer contains the emission of the events. Also, since the test execution order can't be known, the clear all transforms test should first attempt to transform. Also - the JMX API should really, really not return (potentially serialize) classes, but I will open a separate issue for this, as it is not related to this PR.

aptmac added a commit to aptmac/jmc that referenced this pull request Jan 2, 2020
* Make popup table selection all input on creation

* Make chart build when column sort changes
@jessyec-s jessyec-s force-pushed the jessyec-s:jmc-6658 branch from 40ae08f to dc2c00b Jan 8, 2020
@jessyec-s
Copy link
Contributor Author

jessyec-s commented Jan 8, 2020

With huge help from @tabjy in dc2c00b I have made the two previous tests, testSetTransforms and testClearAllTransforms, into one testSetTransforms test. I did this to make one non redundant test because as mentioned, before testing the clearing of all transforms, transforms have to be applied first, which is what testSetTransforms was previously doing .

In this patch testSetTransforms has been modified to transform a method with an event that throws a run time exception. To test that the byte code actually gets instrumented the transformed method is ran and checked to see that this run time exception is fired. Similarly, clearing all transforms is tested by rerunning this method and ensuring that the exception is not fired.

assertFalse(excpetionThrown);

injectFailingEvent();
doSetTransfroms(XML_DESCRIPTION);

This comment has been minimized.

Copy link
@thegreystone

thegreystone Jan 8, 2020

Collaborator

Typo: doSetTransfroms -> doSetTransforms

This comment has been minimized.

Copy link
@jessyec-s

jessyec-s Jan 8, 2020

Author Contributor

Fixed in 846cddf

try {
InstrumentMe.printHelloWorldJFR6();
} catch (RuntimeException e) {
excpetionThrown = true;

This comment has been minimized.

Copy link
@thegreystone

thegreystone Jan 8, 2020

Collaborator

Typo: excpetionThrown -> exceptionThrown

This comment has been minimized.

Copy link
@jessyec-s

jessyec-s Jan 8, 2020

Author Contributor

Fixed in 846cddf

@openjdk openjdk bot removed the rfr label Jan 9, 2020
@openjdk
Copy link

openjdk bot commented Jan 9, 2020

@jessyec-s This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type /integrate in a new comment to proceed. After integration, the commit message will be:

6658: Remove unnecessary storing of pre-instrumented bytecode

Reviewed-by: hirt
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /solves command.

As you are not a known OpenJDK Author, an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@thegreystone) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Jan 9, 2020
@jessyec-s
Copy link
Contributor Author

jessyec-s commented Jan 9, 2020

/integrate

@openjdk openjdk bot added the sponsor label Jan 9, 2020
@openjdk
Copy link

openjdk bot commented Jan 9, 2020

@jessyec-s
Your change (at version 846cddf) is now ready to be sponsored by a Committer.

@thegreystone
Copy link
Collaborator

thegreystone commented Jan 10, 2020

/sponsor

@openjdk openjdk bot closed this Jan 10, 2020
@openjdk openjdk bot added integrated and removed sponsor ready labels Jan 10, 2020
@openjdk
Copy link

openjdk bot commented Jan 10, 2020

@thegreystone @jessyec-s
Pushed as commit 67bc866.

@jessyec-s jessyec-s deleted the jessyec-s:jmc-6658 branch Jan 10, 2020
@mlbridge
Copy link

mlbridge bot commented Jan 10, 2020

Mailing list message from Marcus Hirt on jmc-dev:

Changeset: 67bc866
Author: Jessye Coleman-Shapiro <jescolem at redhat.com>
Committer: Marcus Hirt <hirt at openjdk.org>
Date: 2020-01-10 15:59:20 +0000
URL: https://git.openjdk.java.net/jmc/commit/67bc8668

6658: Remove unnecessary storing of pre-instrumented bytecode

Reviewed-by: hirt

! core/org.openjdk.jmc.agent/src/main/java/org/openjdk/jmc/agent/TransformRegistry.java
! core/org.openjdk.jmc.agent/src/main/java/org/openjdk/jmc/agent/Transformer.java
! core/org.openjdk.jmc.agent/src/main/java/org/openjdk/jmc/agent/impl/DefaultTransformRegistry.java
! core/org.openjdk.jmc.agent/src/test/java/org/openjdk/jmc/agent/test/TestSetTransforms.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.