c - Jump every X instructions -
i need keep track of quantity of work done programs, inside single thread. have minimum impact on (c) code. there way trigger piece of code every x instructions ?
i thinking adding check @ compile time, every x instructions. ok inside branch, (without in depth branch analysis) requires check @ every jump ... in programs many jumps costly.
is there tool/technique allows analyse branches of code (at compilation) checks placed @ places ?
i'd @ doing way, i.e. using profiler or cpu accounting.
if using linux, bizarrely enough, posix mandated standard times()
doesn't (or @ least didn't) meant to, , in fact gives (or gave) per thread accounting data:
http://pubs.opengroup.org/onlinepubs/000095399/functions/times.html
essentially linux threads are processes under hood. might useful you.
(apologies isn't direct answer long comment)
Comments
Post a Comment