All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v1 0/5] ThreadSanitizer support
@ 2016-01-28 10:15 Alex Bennée
  2016-01-28 10:15 ` [Qemu-devel] [PATCH v1 1/5] configure: introduce --extra-libs Alex Bennée
                   ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Alex Bennée @ 2016-01-28 10:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: mttcg, peter.maydell, mark.burton, a.rigo, stefanha, pbonzini,
	Alex Bennée, fred.konrad

Hi,

Here is a proper V1 of the ThreadSanitizer patches I posted earlier
this week. While my motivation is to have additional tools when stress
testing MTTCG these should still be generally useful.

I've dropped the CFLAGS ordering patch which while useful for applying
debug flags isn't needed for this series. However during
experimentation is turns out various different invocations are needed
for enabling the thread sanitizer depending on your GCC version and
distro packaging of it. As a result there are now two configure
patches, one for --extra-ldflags and one that introduces --extra-libs.
Examples are included in the patches.

To build on my work machine (Ubuntu 14.04 LTS) I installed the
latest/greatest GCC PPA and configured with:

    ./configure ${TARGET_LIST} --cc=gcc-5 --cxx=g++-5 \
  --extra-cflags="-fsanitize=thread" --extra-libs="-ltsan" \
  --with-coroutine=gthread

The third patch ensure we use the __atomic builtins for all atomic
functions if we have it available. This is needed so the
ThreadSanitizer can properly instrument the code but we should use it
anyway for consistency. The code generation for atomic accesses on x86
it unaffected. I've gone through it with Paolo's review comments and
cleaned it up considerably.

The final two patches fix up some warnings the sanitizer threw up. I
haven't completed a fully clean make check run yet as building with
the gthread coroutines seems to currently break "make check" in
master. However the default coroutine implementation is sufficiently
funky to confuse tsan.

Additional change comments are included bellow the -- in the other
patches.

Alex Bennée (5):
  configure: introduce --extra-libs
  configure: ensure ldflags propagated to config_host
  include/qemu/atomic.h: default to __atomic functions
  async.c: various atomic fixes for tsan
  thread-pool: atomic fixes from tsan

 Makefile                 |   4 +-
 async.c                  |  12 ++--
 configure                |  15 +++-
 include/qemu/atomic.h    | 178 +++++++++++++++++++++++++++++++----------------
 tests/test-thread-pool.c |   8 +--
 thread-pool.c            |  12 ++--
 6 files changed, 148 insertions(+), 81 deletions(-)

-- 
2.7.0

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

end of thread, other threads:[~2016-04-05 12:47 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 10:15 [Qemu-devel] [PATCH v1 0/5] ThreadSanitizer support Alex Bennée
2016-01-28 10:15 ` [Qemu-devel] [PATCH v1 1/5] configure: introduce --extra-libs Alex Bennée
2016-01-28 11:14   ` Paolo Bonzini
2016-01-28 11:38     ` Alex Bennée
2016-01-28 10:15 ` [Qemu-devel] [PATCH v1 2/5] configure: ensure ldflags propagated to config_host Alex Bennée
2016-01-28 11:10   ` Paolo Bonzini
2016-01-28 11:13   ` Paolo Bonzini
2016-01-29 15:26     ` Alex Bennée
2016-01-28 10:15 ` [Qemu-devel] [PATCH v1 3/5] include/qemu/atomic.h: default to __atomic functions Alex Bennée
2016-01-28 11:00   ` Paolo Bonzini
2016-01-29 16:06     ` Alex Bennée
2016-02-04 12:40       ` Paolo Bonzini
2016-02-04 13:00         ` Peter Maydell
2016-04-01 14:30   ` James Hogan
2016-04-01 14:51     ` Peter Maydell
2016-04-01 16:06     ` Alex Bennée
2016-04-01 20:35   ` Pranith Kumar
2016-04-04  8:14     ` Paolo Bonzini
2016-04-04 16:26       ` Pranith Kumar
2016-04-04 17:03         ` Paolo Bonzini
2016-04-04 20:15           ` Paolo Bonzini
2016-04-05  3:35           ` Pranith Kumar
2016-04-05 12:47             ` Paolo Bonzini
2016-01-28 10:15 ` [Qemu-devel] [PATCH v1 4/5] async.c: various atomic fixes for tsan Alex Bennée
2016-01-28 10:45   ` Paolo Bonzini
2016-01-28 10:15 ` [Qemu-devel] [PATCH v1 5/5] thread-pool: atomic fixes from tsan Alex Bennée
2016-01-28 10:44   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.