-
Notifications
You must be signed in to change notification settings - Fork 728
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
Feature Request: Provide a means to capture contents of String arguments and return values with Xtrace #16416
Comments
@keithc-ca @tajila fyi |
The immediate problem I see with this is that the string data may be huge. I don't know that tracepoints can handle data that's larger than the trace buffer blocks. |
We already have |
Yes, I thought that might be a problem too.
Yes, I was thinking of something similar to how
I guess the maximum string length would be about the same size as the thread's trace buffer (probably slightly smaller)? |
We have a client who we are trying to help audit their use of cryptography. We wanted to print the algorithm passed into a particular method to create a very primative audit trace. In this case we wanted to audit the -Xtrace:'print=mt,maximal=mt,trigger=method{javax/crypto/Cipher.getInstance,jstacktrace}' -Xjit:'exclude={javax/crypto/},dontinline={javax/crypto/}' PKCS12Example.java which results in something like the following:
However this does not print out the actual arguments to the method which we are attempting to record so we were unable to achieve our goal. The feature request in this issue would allow us to do this. |
The changes reflect the feature request eclipse-openj9#16416. Instead of printing the memory address for string arguments, print the actual string at max of 255 characters. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal<[email protected]>
The changes reflect the feature request eclipse-openj9#16416. Instead of printing the memory address for string arguments, print the actual string at max of 255 characters. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal<[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 255 characters. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 255 characters. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 255 characters. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 255 characters. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length and tests. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length and tests. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length and tests. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length and tests. Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
The changes reflect the feature request eclipse-openj9#16416. Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal [email protected]
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
Print the actual string instead of address at max of 32 characters. Subsequent PRs: cmdline option for length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal <[email protected]>
Signed-off-by: Nick Kamal <[email protected]>
Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
…- part 3" This reverts commit 44209db.
…- part 2 following eclipse-openj9#20641" This reverts commit 81ebf3b.
…- part 2 of eclipse-openj9#20641" This reverts commit 5fed7b4.
…- part 2 of eclipse-openj9#20641" This reverts commit 9d207fb.
…- part 2 of eclipse-openj9#20641" This reverts commit 1d2c828.
…- part 2 of eclipse-openj9#20641" This reverts commit 582d967.
…- part 2 of eclipse-openj9#20641" This reverts commit 148a6de.
The changes reflect the feature request eclipse-openj9#16416. Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal [email protected]
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
… of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
The changes reflect the feature request eclipse-openj9#16416. Print the actual string instead of address at max of 32 characters. Subsequent PRs: cmdline option for length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal <[email protected]>
… following eclipse-openj9#20641 Adding cmdline option to specify string argument length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 1 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=invalid input" There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]>
Signed-off-by: Nick Kamal <[email protected]>
Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]>
…- part 3" This reverts commit 44209db.
…- part 2 following eclipse-openj9#20641" This reverts commit 81ebf3b.
…- part 2 of eclipse-openj9#20641" This reverts commit 5fed7b4.
…- part 2 of eclipse-openj9#20641" This reverts commit 9d207fb.
…- part 2 of eclipse-openj9#20641" This reverts commit 1d2c828.
…- part 2 of eclipse-openj9#20641" This reverts commit 582d967.
…- part 2 of eclipse-openj9#20641" This reverts commit 148a6de.
The changes reflect the feature request eclipse-openj9#16416. Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal [email protected] The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> Print actual String arguments with Xtrace part 1 The changes reflect the feature request eclipse-openj9#16416. Print the actual string instead of address at max of 32 characters. Subsequent PRs: cmdline option for length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 following eclipse-openj9#20641 Adding cmdline option to specify string argument length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 1 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=invalid input" There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 3 Signed-off-by: Nick Kamal <[email protected]> cmdline tests for -Xtrace:methodstrarglen Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]> Update xtraceTests.xml Feature request: Print actual String arguments with Xtrace part 1 The changes reflect the feature request eclipse-openj9#16416. Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal [email protected] The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> Print actual String arguments with Xtrace part 1 The changes reflect the feature request eclipse-openj9#16416. Print the actual string instead of address at max of 32 characters. Subsequent PRs: cmdline option for length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 following eclipse-openj9#20641 Adding cmdline option to specify string argument length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 1 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=invalid input" There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 3 Signed-off-by: Nick Kamal <[email protected]> cmdline tests for -Xtrace:methodstrarglen Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]> Update xtraceTests.xml Revert "Update xtraceTests.xml" This reverts commit a02170c. Revert "cmdline tests for -Xtrace:methodstrarglen" This reverts commit f1a4e90. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 3" This reverts commit 44209db. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 following eclipse-openj9#20641" This reverts commit 81ebf3b. Revert "Print actual String arguments with Xtrace part 1" This reverts commit c5ca003. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 5fed7b4. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 9d207fb. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 1d2c828. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 582d967. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 148a6de. Revert "Feature request: Print actual String arguments with Xtrace part 1" This reverts commit 820e22e. Feature request: Print actual String arguments with Xtrace part 1 The changes reflect the feature request eclipse-openj9#16416. Instead of printing the memory address for string arguments, print the actual string at max of 32 characters. There will be subsequent PRs for cmdline option for string length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal [email protected] The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641 Adding cmdline option to specify string length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 0 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=<invalid input> " There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> Print actual String arguments with Xtrace part 1 The changes reflect the feature request eclipse-openj9#16416. Print the actual string instead of address at max of 32 characters. Subsequent PRs: cmdline option for length (Part 2) and tests (Part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 2 following eclipse-openj9#20641 Adding cmdline option to specify string argument length to be printed. -Xtrace:methodstrarglen=[1-128] methodStrArgLen takes an unsigned integer value from 1 to 128 If no methodStrArgLen is specified, or is set to 0, the printed length is the default value of 32. Other invalid inputs result in the following: "Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 1 to 128 Trace option unrecognized: -Xtrace:methodStrArgLen Error processing trace option: -Xtrace:methodStrArgLen=invalid input" There will be subsequent PRs for tests (part 3). Signed-off-by: Nick Kamal <[email protected]> The changes reflect the feature request eclipse-openj9#16416 - part 3 Signed-off-by: Nick Kamal <[email protected]> cmdline tests for -Xtrace:methodstrarglen Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal <[email protected]> Update xtraceTests.xml Revert "Update xtraceTests.xml" This reverts commit a02170c. Revert "cmdline tests for -Xtrace:methodstrarglen" This reverts commit f1a4e90. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 3" This reverts commit 44209db. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 following eclipse-openj9#20641" This reverts commit 81ebf3b. Revert "Print actual String arguments with Xtrace part 1" This reverts commit c5ca003. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 5fed7b4. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 9d207fb. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 1d2c828. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 582d967. Revert "The changes reflect the feature request eclipse-openj9#16416 - part 2 of eclipse-openj9#20641" This reverts commit 148a6de. Revert "Feature request: Print actual String arguments with Xtrace part 1" This reverts commit 820e22e.
The changes reflect the feature request eclipse-openj9#16416 - part 3 following eclipse-openj9#20662 cmdline tests for -Xtrace:maxstringlength Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal [email protected]
The changes reflect the feature request eclipse-openj9#16416 - part 3 following eclipse-openj9#20662 cmdline tests for -Xtrace:maxstringlength Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal [email protected]
The changes reflect the feature request eclipse-openj9#16416 - part 3 following eclipse-openj9#20662 cmdline tests for -Xtrace:maxstringlength Closes: eclipse-openj9#16416 Signed-off-by: Nick Kamal [email protected]
It's not currently possible to capture the contents of String arguments and return values when tracing methods with Xtrace. All you get is the address of the String object.
For example:
and:
There are many situations in which it would be useful to be able to capture the actual contents of the String objects - something like this, for example:
The only alternatives right now are to modify the application code (to add
println()
calls), either by changing the source code and rebuilding or instrumenting the code with an agent, or to trigger a core dump on the relevant method call and retrieve the String(s) from that.I suspect there would be a significant performance cost associated with retrieving the String contents, so this certainly isn't something that we would want to enable by default, but it would be great to have the option. The alternative approaches are almost certainly costlier - modifying application code is typically not trivial (especially in production), third party code often cannot be modified at all, and writing a core dump typically suspends the application for at least several seconds.
It might also be useful to be able to trace the contents of primitive arrays as well (e.g.
char[]
andbyte[]
).It's very likely that this functionality has been considered and rejected in the past, but I couldn't find any previous conversations on this topic. In the worst case this Github issue can at least provide a record of why this isn't feasible.
The text was updated successfully, but these errors were encountered: