Project

General

Profile

Actions

Feature #3689

open

Add support of primitive pointcut that can refer both to macros and functions

Added by Evgeny Novikov about 12 years ago. Updated almost 9 years ago.

Status:
Open
Priority:
Low
Category:
Pointcuts matching
Start date:
11/15/2012
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

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:

#ifdef CONFIG_DEBUG_LOCK_ALLOC
#define mutex_lock(lock) mutex_lock_nested(lock, 0)
#else
extern void mutex_lock(struct mutex *lock);
#endif

that leads to such the aspect:
around: define(mutex_lock(lock))
{
ldv_mutex_lock(lock)
}
before: call(extern void mutex_lock(struct mutex *))
{
  ldv_mutex_lock($arg1);
}

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:
around: expand_or_call($ mutex_lock(..))
{
  ldv_mutex_lock($arg1)
}

or even in the more short way (because of we are interested just in entity name):
around: expand_or_call_by_name(mutex_lock)
{
  ldv_mutex_lock($arg1)
}

Actions

Also available in: Atom PDF