Re: Fix for hrSWRunPerfCPU/Mem

2012-01-26 Thread Vincent Bernat
OoO Vers la fin de l'après-midi du jeudi 26 janvier 2012, vers 16:18, Robert Story disait : VB> do not check for '\0'. For example: VB> VB> for ( cp = buf; *cp != ':'; cp++ ) VB> ; VB> VB> This will crash if there is no more ':'. The loop could be changed to: VB> VB> for ( cp = buf; *cp &&

Re: Fix for hrSWRunPerfCPU/Mem

2012-01-26 Thread Robert Story
On Wed, 25 Jan 2012 21:47:01 +0100 Vincent wrote: VB> I would also like to point that the parsing code in VB> swrun_procfs_linux.c is fragile: if the kernel truncates one line (or VB> if the format change), this could cause a segfault because some loops VB> do not check for '\0'. For example: VB>

Fix for hrSWRunPerfCPU/Mem

2012-01-25 Thread Vincent Bernat
Hi! On Linux, hrSWRunPerfCPU and hrSWRunPerfMem have incorrect values. I have fixed this in a patch that should follow. I will post it on Sourceforge as soon as I am able to validate my account (the confirmation mail seems to have been lost). I would also like to point that the parsing code in sw