]> granicus.if.org Git - sysstat/commit
sar: make buffers that hold timestamps bigger
authorMichal Sekletar <msekleta@redhat.com>
Fri, 30 Sep 2016 16:05:44 +0000 (18:05 +0200)
committerMichal Sekletar <msekleta@redhat.com>
Fri, 30 Sep 2016 16:21:18 +0000 (18:21 +0200)
commitb0f5dd3ef1acdb03f074d0da0079ba74dd38a08b
treeb4f3b087a1b7cf7babb89a6ccf20ce3f8f8101b7
parent7110b62f926c4cf9c79b87a5266623cde074ea14
sar: make buffers that hold timestamps bigger

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
sa.h
sar.c