From patchwork Wed Jul 12 20:04:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Buchbinder X-Patchwork-Id: 9837345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D1B9560393 for ; Wed, 12 Jul 2017 20:05:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C478D286AC for ; Wed, 12 Jul 2017 20:05:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8DAD286AE; Wed, 12 Jul 2017 20:05:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54133286AB for ; Wed, 12 Jul 2017 20:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751882AbdGLUFG (ORCPT ); Wed, 12 Jul 2017 16:05:06 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:36508 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbdGLUFF (ORCPT ); Wed, 12 Jul 2017 16:05:05 -0400 Received: by mail-pg0-f48.google.com with SMTP id u62so18009264pgb.3 for ; Wed, 12 Jul 2017 13:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=zz5lG+J2DXoLicGvNp3oMJFyUNtw5jUf0tDaKdE534g=; b=Ns9JCHcF3YtBrOenVSmMnrewQkirfxvaz51a1rrs6ZmyrU/xvVxlc7zxx2eF5mfmHE P6b18/FplL+ujtklQ1Xn2Wob8xetAeVABaGjwrm3lP8KltzPQ/I71BG8y0+WhUCt46dT XFMMpyHmZrDvfbjpeIOOVcR3IkvV0XP5fJNjDAjsihJ37jiEh/Oz+2SXvib7kjZdNCzs e+HWaO9HYsFcPPeP+A0JvNb+98n1ZHUxLFe0J2kuX1Lv4HwQVaRrfAtmWisSyUcuS7VI Nz+49NO9FR+PIwKcnEhve7KVlDm2JvqTd3y3hAmQMlD5FG9qGIIdsIfe6i+EAXVmoj0H CL4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zz5lG+J2DXoLicGvNp3oMJFyUNtw5jUf0tDaKdE534g=; b=j7lAzLlHxaRvchOyjvZmqV6OO5fCAcgkeSdcGUjRaz6YLwbunwM8P5CAm+lSKu6Ugy saF7P2U+tXz5m0WQds1KUmwpsgZP+CVN+vex+lPr58bXzjrnfPE0W9cAFYIYFpcXNpLL aJ736xJzpAV225kVEVcrz2Qsx6RwYKJufjfGyrDqpqjmAgv7D46tgAoHljEV/1jreJoo b4kBso99Xttd1IDDjeEvLHXDV4TcfnvduVO+ksOUD/cQcjrSpNLxbAq7yPSAmrzbno3V c59P/SUGeUeU+9+1XI7wKjtnjM7i0EztVs22dIf/kyMWhxeRVDj8Di4mCS1vOSRqMM6Q 59Kg== X-Gm-Message-State: AIVw111bGs/sQW6gFcbw7aF3hqcX5nDsSxBTwD4L3ciLfF+cnf8h7E93 u1WCuHOO3N+I2Xq+fSc0xQ== X-Received: by 10.99.175.87 with SMTP id s23mr5588364pgo.240.1499889904520; Wed, 12 Jul 2017 13:05:04 -0700 (PDT) Received: from abuchbinder-glaptop.corp.google.com (c-73-223-36-121.hsd1.ca.comcast.net. [73.223.36.121]) by smtp.gmail.com with ESMTPSA id 133sm5676817pgc.19.2017.07.12.13.05.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 13:05:03 -0700 (PDT) From: Adam Buchbinder To: linux-btrfs@vger.kernel.org Cc: Adam Buchbinder Subject: [PATCH] btrfs-progs: Enable ThreadSanitizer, using D=tsan. Date: Wed, 12 Jul 2017 13:04:49 -0700 Message-Id: <20170712200449.18638-1-abuchbinder@google.com> X-Mailer: git-send-email 2.13.2.932.g7449e964c-goog Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Tested with clang-3.9. Signed-off-by: Adam Buchbinder --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 81598df..8948301 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ # abort - call abort() on first error (dumps core) # all - shortcut for all of the above # asan - enable address sanitizer compiler feature +# tsan - enable thread sanitizer compiler feature # ubsan - undefined behaviour sanitizer compiler feature # bcheck - extended build checks # W=123 build with warnings (default: off) @@ -157,6 +158,11 @@ ifneq (,$(findstring asan,$(D))) DEBUG_CFLAGS_INTERNAL += -fsanitize=address endif +ifneq (,$(findstring tsan,$(D))) + DEBUG_CFLAGS_INTERNAL += -fsanitize=thread -fPIE + LD_FLAGS += -fsanitize=thread -ltsan -pie +endif + ifneq (,$(findstring ubsan,$(D))) DEBUG_CFLAGS_INTERNAL += -fsanitize=undefined endif