Christopher Li wrote: > On Mon, Feb 12, 2007 at 07:48:18PM -0800, Linus Torvalds wrote: >>> When call one of those functions, it can know that function will change >>> context. That might be a way to solve the problem that some of the >>> spinlock function is not a inline function at all. >> I thought we did that already. I'm fairly sure I had this working at some >> point - exactly by having the calls just add up the (known) lock/unlock >> offsets. > > You are right. It is already there. I never see it before because my ctags > get confused about the context annotation: > > void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); > > It generate tags for "lock" instead of "_spin_lock". Interesting behavior. :) That makes sense, given ctags' regex-based parsing. About that syntax: I chose to use the parameter name there because I wanted to use arbitrary expressions (like param_struct->lock) for a context, rather than a parameter number (as used in printf annotations). I'd love to see any thoughts you might have on how best to parse that expression into something with "placeholders" for formal parameters, and then easily substitute the actual parameters at each call site to determine the expression for the acquired or released context. Then we need a solution for the more difficult problem: unifying and tracking context expressions in the face of changing data in those expressions. - Josh Triplett
Attachment:
signature.asc
Description: OpenPGP digital signature