Skip to content

stackusage: add human-readable output format option #16

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

Merged
merged 1 commit into from
Jul 19, 2025

Conversation

charmitro
Copy link
Contributor

Add -h flag to display stack sizes in human-readable format (KB/MB/GB) instead of raw bytes. This improves readability when analyzing stack usage for applications with large stack allocations.

The implementation adds:

  • New -h command line option to the wrapper script
  • SU_HUMAN environment variable to pass the flag to the library
  • su_format_size_human() function to convert bytes to human-readable units
  • Conditional formatting in su_log_stack_usage() based on the flag

@d99kris d99kris self-assigned this Jul 19, 2025
@d99kris
Copy link
Owner

d99kris commented Jul 19, 2025

Hi @charmitro - thanks for contributing! At a quick glance the changes look good. I'll try take a closer look later this weekend.

Please disregard the failing checks (Github actions), it's not related to the PR, and I will fix it separately.

@charmitro
Copy link
Contributor Author

Hi @charmitro - thanks for contributing! At a quick glance the changes look good. I'll try take a closer look later this weekend.

Please disregard the failing checks (Github actions), it's not related to the PR, and I will fix it separately.

Hey @d99kris, alright no worries. I just had this in my tree and figured that you could benefit from it. It's a nice addition.

Add -h flag to display stack sizes in human-readable format (KB/MB/GB)
instead of raw bytes. This improves readability when analyzing stack
usage for applications with large stack allocations.

The implementation adds:
- New -h command line option to the wrapper script
- SU_HUMAN environment variable to pass the flag to the library
- su_format_size_human() function to convert bytes to human-readable
  units
- Conditional formatting in su_log_stack_usage() based on the flag

Signed-off-by: Charalampos Mitrodimas <[email protected]>
@d99kris d99kris merged commit 08b703f into d99kris:master Jul 19, 2025
2 checks passed
@d99kris
Copy link
Owner

d99kris commented Jul 19, 2025

It's been merged now. Yes it's a nice addition! Thanks again for contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants