linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] lockdep: LD_PRELOAD support
@ 2013-02-06 22:11 Sasha Levin
  2013-02-06 22:11 ` [PATCH 01/11] liblockdep: remove the need for liblockdep_init Sasha Levin
                   ` (11 more replies)
  0 siblings, 12 replies; 20+ messages in thread
From: Sasha Levin @ 2013-02-06 22:11 UTC (permalink / raw)
  To: mingo, peterz
  Cc: jamie.iles, penberg, acme, paulus, linux-kernel, Sasha Levin

This patch series adds in LD_PRELOAD support for liblockdep.

We store lockdep_map in an rb-tree and hook the pthread_mutex/
pthread_rwlock calls, allowing us to add lockdep testing on
any program without touching it's source code.

The first couple of patches remove the need for lockdep_init
and lockdep_set_thread, as well as some fixes for several
tests.

The other patches add rbtree and LD_PRELOAD support, along
with testing for that.

The last patch adds a small script that wraps all of it, making
testing really simple:

	liblockdep perf [perf command line]

There is a case where it won't work well: some programs, such
as firefox, hook malloc() and add a pthread_mutex lock in the
allocation path, which recurses back into our liblockdep code.

To solve that I'm planning to add a local cache to allocate
from when liblockdep detects recursion onto itself, but that's
outside of the scope of this patch.

Instead of taking the perf in this series another option would
be to just revert the existing perf patch from me in core/locking,
which would mean perf would just work with the new LD_PRELOAD
feature.


Sasha Levin (11):
  liblockdep: remove the need for liblockdep_init
  liblockdep: remove the need for liblockdep_set_thread
  perf: stop using liblockdep_init and liblockdep_set_thread
  liblockdep: fix AA test
  liblockdep: correct the ABCDBCDA test
  liblockdep: rbtree support
  liblockdep: prevent multiple declarations of CALLER_ADDR0
  liblockdep: keep headers declarations even if lib is disabled
  liblockdep: support using LD_PRELOAD
  liblockdep: add tests for the LD_PRELOAD feature
  liblockdep: preload helper

 tools/lib/lockdep/Makefile                         |  16 +-
 tools/lib/lockdep/common.c                         |  10 +-
 tools/lib/lockdep/include/liblockdep/common.h      |   5 +-
 tools/lib/lockdep/include/liblockdep/mutex.h       |   4 +-
 tools/lib/lockdep/include/liblockdep/rwlock.h      |   4 +-
 tools/lib/lockdep/lockdep                          |   3 +
 tools/lib/lockdep/preload.c                        | 184 +++++++++++++++++++++
 tools/lib/lockdep/rbtree.c                         |   1 +
 tools/lib/lockdep/run_tests.sh                     |  12 ++
 tools/lib/lockdep/tests/AA.c                       |   5 +-
 tools/lib/lockdep/tests/ABBA.c                     |   3 -
 tools/lib/lockdep/tests/ABBCCA.c                   |   3 -
 tools/lib/lockdep/tests/ABBCCDDA.c                 |   3 -
 tools/lib/lockdep/tests/ABCABC.c                   |   3 -
 tools/lib/lockdep/tests/ABCDBCDA.c                 |  13 +-
 tools/lib/lockdep/tests/ABCDBDDA.c                 |   3 -
 tools/lib/lockdep/tests/WW.c                       |   3 -
 tools/lib/lockdep/tests/unlock_balance.c           |   3 -
 tools/lib/lockdep/uinclude/linux/kernel.h          |   2 +
 tools/lib/lockdep/uinclude/linux/lockdep.h         |   5 +-
 tools/lib/lockdep/uinclude/linux/rbtree.h          |   1 +
 .../lib/lockdep/uinclude/linux/rbtree_augmented.h  |   2 +
 tools/perf/builtin-sched.c                         |   2 -
 tools/perf/builtin-top.c                           |   4 -
 tools/perf/config/feature-tests.mak                |   1 -
 tools/perf/perf.c                                  |   3 -
 tools/perf/util/liblockdep.h                       |   2 -
 27 files changed, 236 insertions(+), 64 deletions(-)
 create mode 100755 tools/lib/lockdep/lockdep
 create mode 100644 tools/lib/lockdep/preload.c
 create mode 100644 tools/lib/lockdep/rbtree.c
 create mode 100644 tools/lib/lockdep/uinclude/linux/rbtree.h
 create mode 100644 tools/lib/lockdep/uinclude/linux/rbtree_augmented.h

-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-02-08 23:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06 22:11 [PATCH 00/11] lockdep: LD_PRELOAD support Sasha Levin
2013-02-06 22:11 ` [PATCH 01/11] liblockdep: remove the need for liblockdep_init Sasha Levin
2013-02-06 22:11 ` [PATCH 02/11] liblockdep: remove the need for liblockdep_set_thread Sasha Levin
2013-02-06 22:11 ` [PATCH 03/11] perf: stop using liblockdep_init and liblockdep_set_thread Sasha Levin
2013-02-06 22:11 ` [PATCH 04/11] liblockdep: fix AA test Sasha Levin
2013-02-06 22:11 ` [PATCH 05/11] liblockdep: correct the ABCDBCDA test Sasha Levin
2013-02-06 22:11 ` [PATCH 06/11] liblockdep: rbtree support Sasha Levin
2013-02-06 22:11 ` [PATCH 07/11] liblockdep: prevent multiple declarations of CALLER_ADDR0 Sasha Levin
2013-02-06 22:11 ` [PATCH 08/11] liblockdep: keep headers declarations even if lib is disabled Sasha Levin
2013-02-06 22:11 ` [PATCH 09/11] liblockdep: support using LD_PRELOAD Sasha Levin
2013-02-07 10:28   ` Jamie Iles
2013-02-07 14:31     ` Sasha Levin
2013-02-08 10:43       ` Jamie Iles
2013-02-08 23:55         ` Sasha Levin
2013-02-06 22:11 ` [PATCH 10/11] liblockdep: add tests for the LD_PRELOAD feature Sasha Levin
2013-02-06 22:11 ` [PATCH 11/11] liblockdep: preload helper Sasha Levin
2013-02-07  6:19   ` Namhyung Kim
2013-02-07  6:55   ` Namhyung Kim
2013-02-07 14:29     ` Sasha Levin
2013-02-07  7:07 ` [PATCH 00/11] lockdep: LD_PRELOAD support Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).