-
Notifications
You must be signed in to change notification settings - Fork 733
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
Print string contents for "this" references #20933
base: master
Are you sure you want to change the base?
Print string contents for "this" references #20933
Conversation
@TobiAjila Could you please take a look? |
34fd8b7
to
ca5dd4d
Compare
@keithc-ca Please review these changes |
runtime/rastrace/method_trace.c
Outdated
sprintf(outputString, "(String)<Memory allocation error>"); | ||
} else if (utf8Length > maxStringLength) { | ||
sprintf(outputString, "(String)\"%.*s\"...", (U_32)maxStringLength, utf8String); | ||
} else { | ||
sprintf(outputString, "(String)\"%.*s\"", (U_32)utf8Length, utf8String); |
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.
These should include @%p -
like lines 536-540.
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.
Line 237 takes the receiver as an argument to print the address, that's why it's not added here.
Would you like me to change the format to do this way instead?
fa774b7
to
6d6bb46
Compare
The changes reflect the feature request eclipse-openj9#20878. Print string contents for this references. Also, print address for string arguments and returns. Closes: eclipse-openj9#20878 Signed-off-by: Nick Kamal <[email protected]>
26dfab8
to
ff2e56f
Compare
TraceEntry=Trc_MethodEntry Overhead=1 Level=5 Group=bytecodeMethods Template="%.*s.%.*s%.*s bytecode method, this = 0x%zx" | ||
TraceEntry=Trc_MethodEntry Obsolete Overhead=1 Level=5 Group=bytecodeMethods Template="%.*s.%.*s%.*s bytecode method, this = 0x%zx," | ||
|
||
TraceEntry=Trc_MethodEntry Overhead=1 Level=5 Group=bytecodeMethods Template="%.*s.%.*s%.*s bytecode method, this = 0x%zx %.*s" |
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.
New tracepoints must be added at the end of files like this (and there's no need to change the template of one that is being obsoleted). See https://github.com/eclipse-openj9/openj9/blob/master/doc/diagnostics/AddingTracepoints.md.
@@ -200,12 +200,48 @@ traceMethodEnter(J9VMThread *thr, J9Method *method, void *receiverAddress, UDATA | |||
if (modifiers & J9AccNative) { | |||
Trc_MethodEntryN(thr, J9UTF8_LENGTH(className), J9UTF8_DATA(className), J9UTF8_LENGTH(methodName), J9UTF8_DATA(methodName), J9UTF8_LENGTH(methodSignature), J9UTF8_DATA(methodSignature), receiver); | |||
} else { | |||
Trc_MethodEntry(thr, J9UTF8_LENGTH(className), J9UTF8_DATA(className), J9UTF8_LENGTH(methodName), J9UTF8_DATA(methodName), J9UTF8_LENGTH(methodSignature), J9UTF8_DATA(methodSignature), receiver); | |||
Trc_MethodEntry(thr, J9UTF8_LENGTH(className), J9UTF8_DATA(className), J9UTF8_LENGTH(methodName), J9UTF8_DATA(methodName), J9UTF8_LENGTH(methodSignature), J9UTF8_DATA(methodSignature), receiver, 0, ""); |
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.
Just one space after each comma, please.
@@ -479,7 +515,7 @@ traceMethodArgObject(J9VMThread *thr, UDATA* arg0EA, char* cursor, UDATA length) | |||
const unsigned int maxStringLength = RAS_GLOBAL_FROM_JAVAVM(maxStringLength, vm); | |||
|
|||
if (clazz == J9VMJAVALANGSTRING_OR_NULL(vm) | |||
&& (0 != maxStringLength) | |||
&& (0 != maxStringLength) |
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.
Please don't add a leading space here.
sprintf(outputString, "- (String)\"%.*s\"", (U_32)utf8Length, utf8String); | ||
} | ||
|
||
Trc_MethodEntry(thr, J9UTF8_LENGTH(className), J9UTF8_DATA(className), J9UTF8_LENGTH(methodName), J9UTF8_DATA(methodName), J9UTF8_LENGTH(methodSignature), J9UTF8_DATA(methodSignature), receiver, J9UTF8_LENGTH(outputString), outputString); |
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.
Just one space after each comma, please.
The changes reflect the feature request #20878.
Print string contents for
this
references.Also, print address for string arguments and returns.
Closes: #20878
Signed-off-by: Nick Kamal <[email protected]>