Add documentation for -Xtrace:maxstringlength option#1497
Add documentation for -Xtrace:maxstringlength option#1497pshipton merged 1 commit intoeclipse-openj9:masterfrom
Conversation
ec7a2bf to
6525061
Compare
|
Jenkins doc stage |
|
@h3110n3rv3 @pshipton - I have updated the topics. Please check and confirm that the information is correct. Could you please especially check the following:
Thanks! |
|
@h3110n3rv3 Pls do the initial review.
Yes |
@h3110n3rv3 - Could you please review and let me know if any changes are required. Thanks! |
|
@Sreekala-Gopakumar Sorry if I wasn't clear in my previous comment.
|
186ef85 to
9dbfac9
Compare
|
Jenkins doc stage |
|
@h3110n3rv3 @pshipton - I have made the changes. Please check and let me know if any further changes are required. Thanks! |
|
@Sreekala-Gopakumar Most of it looks good. |
9dbfac9 to
3d5fc4f
Compare
|
Jenkins doc stage |
3d5fc4f to
fe56f5c
Compare
|
Jenkins doc stage |
|
@h3110n3rv3 @pshipton - Please check and confirm. Thanks! |
| Use to print the string arguments sent to and the values that are returned from the methods as strings instead of addresses in a trace output. The range of the maximum string length that can be set is 0-128. If the length is not specified, 32 characters of the strings are printed by default. If `maxstringlength=0`, the string addresses are printed instead. | ||
|
|
||
| This parameter is used with other method tracing options, such as `-Xtrace:methods={java/lang/String.concat'()'}`. While using such method tracing options, the argument is passed to this function as a string and the value is returned as a string. Without this parameter, you cannot capture the contents of the string arguments and return values. Only the address of the string object is displayed. If you want to see the string that is passed to and returned from a method for debugging purposes, use the `maxstringlength` parameter. | ||
|
|
There was a problem hiding this comment.
@Sreekala-Gopakumar Sorry if I wasn't clear in my previous comment.
The default now is address + 32 characters of string (i.e., if maxstringlength is not provided) - before this feature, it used to be only address printing with no way to print actual strings. This only affects tracing where addresses were printed for string arguments/return values.
maxstringlength provides a way for printing custom length of string arguments/return values.
examples:
Default behavior now:
-Xtrace:methods={java/lang/String.concat'()'},print=mt --> address + 32 string characters
12:31:00.323 0x25a00 mt.18 - this: java/lang/String@00000006049B84B8 method arguments: ((String)"Lorem ipsum dolor sit amet, cons"...)
12:31:00.323 0x25a00 mt.28 - return value: java/lang/String@00000007FFF92A80 - (String)"HelloLorem ipsum dolor sit amet,"...
maxstringlength set to 0:
-Xtrace:methods={java/lang/String.concat'()'},print=mt,maxstringlength=0 --> address only
12:35:58.213 0x25a00 mt.18 - this: java/lang/String@00000006049B84B8 method arguments: (java/lang/String@00000006049B84E0)
12:35:58.213 0x25a00 mt.28 - return value: java/lang/String@00000007FFF92AD8
maxstringlength set to custom value (max 128):
-Xtrace:methods={java/lang/String.concat'()'},print=mt,maxstringlength=80 --> prints address + 80 string characters
12:37:52.935 0x25a00 mt.18 - this: java/lang/String@00000006049B84B8 method arguments: ((String)"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula "...)
12:37:52.935 0x25a00 mt.28 - return value: java/lang/String@00000007FFF92AE0 - (String)"HelloLorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo li"...
|
@pshipton - Can this be merged? Thanks! |
docs/xtrace.md
Outdated
| | [`-Xtrace:trigger=<clause>`](#trigger) | Determines when various triggered trace actions occur, including turning trace on or off. | | ||
| | [`-Xtrace:buffers=<size>[dynamic\|nodynamic]`](#buffers) | Modifies the size of buffers that are used to store trace data | | ||
| | [`-Xtrace:exception.output=<filename>[,<size>]`](#exceptionoutput) | Redirects exceptions trace data to a file | | ||
| | [`-Xtrace:maxstringlength=[<length>]`](#maxstringlength) | Specifies the length of the string arguments and the values of the methods that are printed in addition to the string object addresses in a trace output | |
docs/xtrace.md
Outdated
|
|
||
| Use to specify the length of the string arguments and return values that are printed in a trace output. The range of the maximum string length that can be set is 0-128. If the length is not specified, 32 characters of the strings are printed by default along with the addresses. If `maxstringlength=0`, only the string addresses are printed instead. | ||
|
|
||
| This parameter is used with other method tracing options, such as `-Xtrace:methods={java/lang/String.concat'()'}` and affects only those tracing operations where addresses are printed for string arguments and return values. When using such method tracing options, the argument is passed to the function as a string and the value is returned as a string. Earlier, you could not capture the contents of the string arguments and return values. Only the address of the string object was printed. Now, both the actual strings as well as the addresses can be printed. |
There was a problem hiding this comment.
should it be "and return values, only the address" using a comma instead of period?
eclipse-openj9#1466 Added the new parameter, `maxstringlength`. Incorporated review feedback. Closes eclipse-openj9#1466 Signed-off-by: Sreekala Gopakumar sreekala.gopakumar@ibm.com
fe56f5c to
9b08104
Compare
|
Jenkins doc stage |
|
@pshipton - Incorporated the suggested changes. Thanks! |
#1466
Added the new parameter,
maxstringlength.Closes #1466
Signed-off-by: Sreekala Gopakumar sreekala.gopakumar@ibm.com