Re: [PATCH 09/11] liblockdep: support using LD_PRELOAD

From: Jamie Iles
Date: Thu Feb 07 2013 - 05:29:33 EST


Hi Sasha,

On Wed, Feb 06, 2013 at 05:11:32PM -0500, Sasha Levin wrote:
> This allows lockdep to be used without being compiled in the original program.
>
> Usage is quite simple:
>
> LD_PRELOAD=/path/to/liblockdep.so /path/to/my/program
>
> And magically, you'll have lockdep in your program!
>
> Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx>
> ---
> diff --git a/tools/lib/lockdep/preload.c b/tools/lib/lockdep/preload.c
> new file mode 100644
> index 0000000..0f71c23
> --- /dev/null
> +++ b/tools/lib/lockdep/preload.c
...
> +int pthread_rwlock_init(pthread_rwlock_t *rwlock,
> + const pthread_rwlockattr_t *attr)
> +{
> + if (ll_pthread_rwlock_init == NULL)
> + init_preload();

Why is this one special, doesn't init_preload being a constructor make
this redundant?

Jamie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/