Project

General

Profile

Feature #3689

Updated by Evgeny Novikov about 12 years ago

When we bind mutex_lock model with Linux kernel sources in the configuration independent way we have to bind it with both mutex_lock macro and mutex_lock function: 
 <pre><code class="c"> 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC 
 #define mutex_lock(lock) mutex_lock_nested(lock, 0) 
 #else 
 extern void mutex_lock(struct mutex *lock); 
 #endif 
 </code></pre> 
 that leads to such the aspect: 
 <pre><code class="c"> 
 around: define(mutex_lock(lock)) 
 { 
 ldv_mutex_lock(lock) 
 } 
 before: call(extern void mutex_lock(struct mutex *)) 
 { 
   ldv_mutex_lock($arg1); 
 } 
 </code></pre> 
 But this hasn't much sense indeed, because of this time there isn't much difference in instrumentation: instead of macro expansion (definition) or function call we would like to call some model function. Respectively we would like to write such the aspect that will match they both: 
 <pre><code class="c"> 
 around: expand_or_call($ mutex_lock(..)) 
 { 
   ldv_mutex_lock($arg1) 
 } 
 </code></pre> 
 or even in the more short way (because of we are interested just in entity name): 
 <pre><code class="c"> 
 around: expand_or_call_by_name(mutex_lock) 
 { 
   ldv_mutex_lock($arg1) 
 } 
 </code></pre> 

Back