mbox series

[kvm-unit-tests,v2,0/3] Improve stack pretty printing

Message ID 20230404185048.2824384-1-nsg@linux.ibm.com (mailing list archive)
Headers show
Series Improve stack pretty printing | expand

Message

Nina Schoetterl-Glausch April 4, 2023, 6:50 p.m. UTC
I noticed some bugs/deficiencies in the pretty_print_stacks script.
Namely, it doesn't cope with 0 addresses, which might occur on s390x
when backtracing through a interrupt stack frame. Since an interrupt is
not a function call, the calling convention doesn't apply and we cannot
tell where the stack is.

Additionally, the script stops printing the stack if addr2line cannot
determine the line number, instead of skipping the printing of the
source.

Lastly, the file path determination was broken for me because I use git
worktrees and there being symlinks in the paths.
The proposed change works for me and fixes the issue.
I HAVE NOT TESTED THIS ON OTHER PLATFORMS/OSes, so I don't know if the code
is portable.

v1 -> v2
 * Cc kvm list (get_maintainers.pl doesn't list it for the file)
 * pick up Tested-by (thanks Thomas)

Nina Schoetterl-Glausch (3):
  pretty_print_stacks: prevent invalid address arguments
  pretty_print_stacks: support unknown line numbers
  pretty_print_stacks: modify relative path calculation

 scripts/pretty_print_stacks.py | 35 ++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)


base-commit: 5b5d27da2973b20ec29b18df4d749fb2190458af

Comments

Thomas Huth April 20, 2023, 8:28 a.m. UTC | #1
On 04/04/2023 20.50, Nina Schoetterl-Glausch wrote:
> I noticed some bugs/deficiencies in the pretty_print_stacks script.
> Namely, it doesn't cope with 0 addresses, which might occur on s390x
> when backtracing through a interrupt stack frame. Since an interrupt is
> not a function call, the calling convention doesn't apply and we cannot
> tell where the stack is.
> 
> Additionally, the script stops printing the stack if addr2line cannot
> determine the line number, instead of skipping the printing of the
> source.
> 
> Lastly, the file path determination was broken for me because I use git
> worktrees and there being symlinks in the paths.
> The proposed change works for me and fixes the issue.

Thanks! Since there were no objections or other suggestions, I went ahead 
and pushed the three patches now.

  Thomas