On 30 April 2015 at 22:33, Christopher Covington <christopher.coving...@linaro.org> wrote: > On Apr 30, 2015 2:28 PM, "Peter Maydell" <peter.mayd...@linaro.org> wrote: >> Are you really really sure the _raw function is the correct one? >> Nowhere else in the codebase calls it except the other wrappers >> in cpu.c which provide a sane view of the instruction count... >> (I suspect cpu_get_icount_raw() should really be static.) > > I thought it wasn't being used because it was new, having been introduced by > Pavel Dovgalyuk's determinism patches. > > When you talk about sanity, what would this patch make insane? The > instructions per second and cycles per second that would result? If so, what > if seconds/timer ticks were changed in the same patch to be derived from the > instruction count. All of this could potentially only apply with -icount > specified.
I don't really know for certain how the code here works, but it makes me very dubious when I see a function that is being used literally nowhere else in any other target CPU, and where every other code path to it goes via taking a lock. Paolo: can you suggest what the right function to call to implement a cycle counter is? thanks -- PMM