-
Notifications
You must be signed in to change notification settings - Fork 16
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
Adding support for frequency logging #21
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ed in binary compiled target
- add annotation for class - add annotation for method - add asm logic for class annotation
- move CustomMethodVisitor to a seperate file - rename internal parameters of CustomMethodVisitor to be more readable - remove some logs from class transformer - modified get_counter to static method
- refactor variable names - refactor divisor setting logic
- refactor pushArgument to handlen all pushing of variables to stack - pass all invoke arguments to probeCounter
artpar
reviewed
Dec 30, 2023
kartikeytewari-ul
changed the title
[Draft] Adding support for frequency logging
Adding support for frequency logging
Jan 1, 2024
artpar
reviewed
Jan 2, 2024
src/main/java/io/unlogged/core/bytecode/MethodVisitorWithoutProbe.java
Outdated
Show resolved
Hide resolved
src/main/java/io/unlogged/core/processor/UnloggedProcessor.java
Outdated
Show resolved
Hide resolved
kartikeytewari-ul
force-pushed
the
freq_logging
branch
from
January 2, 2024 11:11
98cb4d5
to
a44647a
Compare
- rename loggingFrequency param to counter - set default logging value to counter
kartikeytewari-ul
force-pushed
the
freq_logging
branch
from
March 4, 2024 06:13
fd4e1ce
to
e7ee01c
Compare
The replay_target pipeline is failing because the tests defined in the python file are not present in the project test resources. Once, updated this test needs to run again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Frequency Logging Enhancement
Overview
Introducing the Frequency Logging feature, which enables frequency based stack call logging in Java programs at pre-defined intervals. This flexibility is achieved by setting the logging frequency at compile time, with options available at the program, class, and method level.
Annotation Options
The logging frequency can be easily specified using annotations. The new annotation options are:
@Unlogged(loggingFrequency = some_string)
: Sets the logging frequency for the entire programme.@UnloggedClass(loggingFrequency = some_string)
: Defines the logging frequency at the class level.@UnloggedMethod(loggingFrequency = some_string)
: Specifies the logging frequency at the method level.Method Compilation States:
A compiled method falls into one of three states:
methodVisitorProbed
is calledmethodVisitorProbed
andmethodVisitorWithoutProbe
are calledImplementation Details
The feature is implemented as follows:
Annotation Processing
: Two annotation visitor traverses each annotated class and method. They store values in classCounterMap and methodCounterMap respectively.Probe Counter and Frequency Logging
: Adds probeCounter and the frequencyLogging method at runtime to determine whether a method should be logged.Static Field Initialisation
: A static field () is required for initialising the mapStore. For class with starting method, a initialising method is already made. So, initialisation occurs within the same method. For other classes, a new static method is created.DualMethodVisitor
: It is a POJO that encapsulates both methodVisitorProbed and methodVisitorWithoutProbe.By following these implementation details, the Frequency Logging enhancement ensures precise control over stack call logging in Java programs.
Sanity Testing
compile
andreplay target
of SDK was run. They are passing correctly. Also, this was tested using auto executor. The configuration for the same is:main
ofunlogged-spring-maven-demo
test_freq_logging
ofunlogged-spring-maven-demo