This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Reading atomic variables in embedded C


In every machine's asm/atomic.h, atomic_read(v) is actually just defined as
(v->counter) with no other magic.  So, you can just use kread on that, or
use $foo->counter in script code.  This encodes an assumption about the
kernel implementation, though the proper kernel API is to presume the
atomic_read macro might do some magic you need to use.  But, there is no
way to use atomic_read and get the fault-protection of kread.  So it's
improper by systemtap robustness rules to use atomic_read.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]