lkml.org 
[lkml]   [2013]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/11] liblockdep: support using LD_PRELOAD
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@oracle.com>
> ---
> 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


\
 
 \ /
  Last update: 2013-02-07 12:21    [W:0.111 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site