Skip to content
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

sar: make buffers that hold timestamps bigger #127

Merged
merged 1 commit into from Oct 2, 2016

Conversation

msekletar
Copy link
Contributor

On systems that use Korean UTF-8 locale sar will not print timestamp
because there is not enough space in the buffer.

I bumped buffer size to 64 bytes because I figured out that 32 bytes is
still not enough to print out timestamp when using some glibc supported
locales.

$ LC_TIME=ko_KR.UTF-8 ./sar 1 1

Before:

Linux 4.7.2-201.fc24.x86_64 (morgoth.usersys.redhat.com)        2016년 09월 30일   _x86_64_        (4 CPU)

                CPU     %user     %nice   %system   %iowait    %steal     %idle
                all      4.51      0.00      2.51      0.00      0.00     92.98
Average:        all      4.51      0.00      2.51      0.00      0.00     92.98

After:

Linux 4.7.2-201.fc24.x86_64 (morgoth.usersys.redhat.com)   2016년 09월 30일   _x86_64_        (4 CPU)

18시 18분 36초     CPU     %user     %nice   %system   %iowait    %steal     %idle
18시 18분 37초     all      3.76      0.00      2.26      0.00      0.00     93.98
Average:        all      3.76      0.00      2.26      0.00      0.00     93.98

On systems that use Korean UTF-8 locale sar will not print timestamp
because there is not enough space in the buffer.

I bumped buffer size to 64 bytes because I figured out that 32 bytes is
still not enough to print out timestamp when using some glibc supported
locales.

$ LC_TIME=ko_KR.UTF-8 ./sar 1 1

Before:
Linux 4.7.2-201.fc24.x86_64 (morgoth.usersys.redhat.com)        2016년 09월 30일   _x86_64_        (4 CPU)

                CPU     %user     %nice   %system   %iowait    %steal     %idle
                all      4.51      0.00      2.51      0.00      0.00     92.98
Average:        all      4.51      0.00      2.51      0.00      0.00     92.98

After:
Linux 4.7.2-201.fc24.x86_64 (morgoth.usersys.redhat.com)   2016년 09월 30일   _x86_64_        (4 CPU)

18시 18분 36초     CPU     %user     %nice   %system   %iowait    %steal     %idle
18시 18분 37초     all      3.76      0.00      2.26      0.00      0.00     93.98
Average:        all      3.76      0.00      2.26      0.00      0.00     93.98
@sysstat sysstat merged commit b0f5dd3 into sysstat:master Oct 2, 2016
@msekletar msekletar deleted the korean-timestamp branch October 2, 2016 18:44
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.

None yet

2 participants