Iterators use much less memory, so larger bootcharts may be processed without triggering OOM killer and massive swapping. On a (big) 11MB tarball this will have a performance penalty of about ~10% but consuming half the memory. Before: 23.50user 1.20system 0:24.97elapsed 98%CPU (0avgtext+0avgdata 770048maxresident)k After: 26.78user 0.44system 0:27.24elapsed 99%CPU (0avgtext+0avgdata 321192maxresident)k
Reported by Coverity as CID #17820
gcc warns that we may want to pass a fixed size to memset instead of calling sizeof of the src, it is right to suggest so since src here is a pointer to a char. Move the buffer initialization in the caller where the stack size of it is known.
Reported by Coverity as CID #17831
Reported by Coverity as CID #17829
Reported by Coverity as CID #17821
Fixes out-of-bounds write reported by Coverity as CID #17818
This does not make any functional difference, but brings the file names in the working directory in line with the file names used in the root filesystem. So, for example, /usr/lib/systemd/system/bootchart2.service now corresponds to bootchart2.service.in instead of bootchart.service.in. Signed-off-by: Max Eliaser <firstname.lastname@example.org>
This fixes a regression introduced in 56a638a, where the systemd files were renamed to use the bootchart2 name, but their dependencies on each other were not updated (so bootchart2.service still referred to the now nonexistant bootchart-done.timer instead of bootchart2-done.timer.) Signed-off-by: Max Eliaser <email@example.com>
The function get_family_id was supposed to return a negative number to indicate that the taskstats API was unavailable. However, its return value was stored to an unsigned variable, so this condition went undetected in the code. It now returns zero instead of a negative number, and this appears to fix the problem. Signed-off-by: Max Eliaser <firstname.lastname@example.org>
… builds This was caused by an incorrect implementation of a no-op assert macro and caused "bootchartd stop" to fail under certain circumstances.
freopen("/proc/kmsg", "a", stderr) => -EBADF ...but... freopen("/proc/kmsg", "w", stderr) => a valid FILE * I'm guessing that this fails in the append case because the underlying lseek call fails because /proc/kmsg is of length zero, or otherwise because it is not an on-disk file.