-
Notifications
You must be signed in to change notification settings - Fork 937
Make comp-task matching more generic #1474
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
Conversation
| assert p.exitCode() == 0; | ||
| assert out.contains(";Compiler::compile_method;java/lang/\\w+\\."); | ||
| assert out.contains(";C2Compiler::compile_method;java/lang/\\w+\\."); | ||
| assert out.contains(";Compiler::compile_method;(java|sun|jdk)/.*"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we really need to be explicit here. Do we really care what package the compiled method is coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you suggesting checking against \\w+/.*to match any packages that might be external?
In this case I don't really see the need as the test is plain JDK test which should always start from the above packages (sun,java,jdk)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you suggesting checking against \w+/.*to match any packages that might be external?
Yes. But I'm not saying we should target external packages, just that perhaps we don't care about the package we catch here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should care about the base package name as that acts as a simple sanity test that async-profiler is adding logical frames to the generated stacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but my question is different. How come that none of basic java/lang classes (String, Thread, Class, etc.) were seen in the compilation profile? Weren't these methods compiled, or they were but async-profiler did not catch any? How can I reproduce the issue? (Haven't seen it so far)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm attaching some flame graphs, when checked both show that both C1 & C2 compiler are working fine & are being sampled as we expect them to,
It's just that C1 compiler is simply fast & sometimes is not sampled for the classes/methods directly under java/lang package
=> Reducing the sampling interval increases the stability of the test.
If we check the available samples for C1 we can see the synthetic frames & we can see that each method was sampled only once which is what we expect to see
Due to the high performance of C1 it was possible for certain runs to not capture samples for the methods we currently expect, as such changing the pattern was needed,
I didn't see a value in picking one package over another as we may fall into the same issue in the future, so I opted for a pattern that should match any java synthetic frame
The java/lang can be still be seen on C2 compiler, and each method is only sampled once which is what we expect to see.
However to keep the check uniform, I opted to change the pattern for C2 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes sense.
The pattern, however, does not make difference between a class name and a method name. I'd like the test verify that it's a Java method that is inserted as a synthetic frame, i.e. frame name contains one dot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that make sense, I will update the pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern update to better match java methods
New pattern (java|sun|jdk)/[^;]+[^;/]\.[^;/]+
- (java|sun|jdk) => top package sanity check
- /[^;]+ => checks for nested packages
- [^;/].[^;/]+ => checks a method name that shouldn't contain "/;" characters & should have a "." in it
Description
testCompTask checks that the compfeature is working, by checking for the synthetic frames async-profiler adds
These synthetic frames can be for classes outside of the
java/langpackageFor example
This change allows for a more generic matching reducing the possibility of failures
Related issues
N/A
Motivation and context
Reduce possibility for test failure
How has this been tested?
manual testing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.