Bug 27735 - memusagestat with GiB or TiB of RAM axis values can be clipped
Summary: memusagestat with GiB or TiB of RAM axis values can be clipped
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.33
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-15 17:50 UTC by paul@preney.ca
Modified: 2021-04-15 17:51 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
memusagestat-large-values.patch (711 bytes, patch)
2021-04-15 17:50 UTC, paul@preney.ca
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description paul@preney.ca 2021-04-15 17:50:44 UTC
Created attachment 13371 [details]
memusagestat-large-values.patch

Using memusagestat with collected data from systems that have of GiB of RAM or more can result in the heap axis' values being clipped since they are too large/long for the space provided. Additionally such values should be abbreviated using G (for giga) and T for (tera) and scaled as the other values are. The requires the _scale values to be declared as site_t (or some type larger than int) and ULL used with the constant values (e.g., 100ULL * 1024 * 1024 * 1024, etc.) so they result in not-always-false if tests.

While cosmetic, I have also adjusted the colour values which were too bright against the bright grey (almost white) background to provide more contrast. I also made the background colour not transparent since it can make the graph very hard-to-read on non-white underlying backgrounds. I avoided making any other changes. (The colours and transparency changes are simple edits involving 4 lines of code.)

ASIDE: I colour shifted the blue to be a dark cyan to allow it to be more easily seen as different from black. Pure blue is harder to see unless bright --but when bright it is harder to see against the background.

These changes can be seen in the attached patch file: memusagestat-large-values.patch . :-)

(While I used v2.33 this affects all versions of glibc with memusagestat.)