From patchwork Tue Jun 16 12:53:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188031 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3625886ilo; Tue, 16 Jun 2020 06:00:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXbKXz1QZGPNhGmI9l4TIxjETqXhb88zBPBAjaufzh33VGY23nElqPFmqjtBvW7J34Lem0 X-Received: by 2002:a25:be11:: with SMTP id h17mr3842866ybk.179.1592312418324; Tue, 16 Jun 2020 06:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312418; cv=none; d=google.com; s=arc-20160816; b=eutJsUNrcZSxicU0ofq09US+qv7S6PWgsAVZMLaj6QvM/UpAyIXV+Rz8Q2RkX18Fsz qH++sSBkaK21AFTxImVjQhd8jjIwlGZ+Diahc94bfmZec6YjY328+XqpKpthiFzHHGwy ovk7j+HO8vtljsz5AZdo4IuRGl2wtcQ9vNZUPZPbc55qb8ouBLr2ZhxArwzk7JgXzca0 Cwfkz2O2Za4SXM4OPFDg8fSnCgbR8McvfDIj5LdjrYy2IYO6yLH/ISfs8NtaTM2QzD+O FpFmmho0Z8oDLLXwBdPap6AWGunynzE+gH/ZzSnqsiYuuINoKlvTb36Y+SEIbgBnilgE PpQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=J/tbW+i3GK+A8UpzokTnJFqdsmmwLI1SX+zoA10BfeE=; b=ItEBV9kMF5N1v27hjcrcFySQ9mMWMX4ZrugI3I744qCgsmZD2HqXnfL5Xh25cePiWE zaRSPinvQYL0d+N7YlDErSTm4PtZtMlyFLtOLuI2aK13TtlrRXIIwlQ1K4gCKDiFmlg+ Qz/hFUcywBY5M3kBVYt/hZ5zLvjbFyuuX84BEeog0uu+/t2zAnWGFW0SzPJExri5BgmK 2xUn7RFb1SN0A8XMSkObWVOD5xldbcRP6/MCtucnvhwIyChkoFfUoch7Vb9Sqpw3u34e JiAZE/UVXlBpRAgFoJhxRY7Jj6H3JLO1m0OBi6sJdLAbmVBoLDSZxQ95BCJblm7oi5cM YOVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ytg0oS0j; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n66si17042649yba.117.2020.06.16.06.00.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:00:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ytg0oS0j; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBCK-0005lo-Lc for patch@linaro.org; Tue, 16 Jun 2020 09:00:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB63-000415-11 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:47 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:53048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5z-000087-Ej for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:46 -0400 Received: by mail-wm1-x333.google.com with SMTP id r9so2774621wmh.2 for ; Tue, 16 Jun 2020 05:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J/tbW+i3GK+A8UpzokTnJFqdsmmwLI1SX+zoA10BfeE=; b=Ytg0oS0jVZvQeJb8RGmc6eZGzcOBOA6kX1hsaLi4wA7sQv1mxiVj3OOFVGCqV4nlBR suTZfR/LL1M5Mgzs7ZkP7n8zTjAgoZi3DW2hTbrBIYfOozl4pbFiB69K38bGcLfUSOGt dWoe0q0f12B+zp/vxlxTHBKTseuzkaKj6oj6QyDszOYctKuKLmOWec6plxsHZksNYYdf j0qHrdoTVI8x+0Cxw9OHu7hDzX5S7usscE4a5O7Bgw7JHCeqqooSQczYrsSZmJKxC0oy VoiYtM8FSZyXT3Vt8w+uJnVIPyN1Ab8Z/bzosxjokfCM7TvdKN2soLnYb+8DCKtl6tb7 hQow== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=J/tbW+i3GK+A8UpzokTnJFqdsmmwLI1SX+zoA10BfeE=; b=Y7L0gERqRq6t0oa/EFFbyKeBGWSxb1hVx+QDwVuGOLZJ/N7lw9JyC98icgdmkQ99cK UU1hP5NYMvP5ab9wxp6z8MtGIQbiEbzHx6CC8bedyJWljWdmccU7402t4nUKEohA5azB 5nxBttsSvlUjfum+4I80aJ+OpPfSPOnL6tQpoEToXylNihHazsD2Bc7A2Jf+b9/vO2/D OE0nzwVjooR4p4Q7NONn6Ab6NVWzFvMcloUodf6+frGo3K3saL0aR4Pr8NYXvRUhbkcO dN4fyY5q1rCjcJwBrMzLrLJhwTq2Mftlnh4upZ9Vev+/qNvVeRqk28cs8xgSQeoZ1gfh bD7w== X-Gm-Message-State: AOAM532pDKYFqu8iOgii/2xIFxi/wYdNEAVCxwI22TlbSY2HKyAuqoBI 36wi989AYKzmaR4WxGJd3kdpOQ== X-Received: by 2002:a05:600c:218b:: with SMTP id e11mr3130276wme.162.1592312021986; Tue, 16 Jun 2020 05:53:41 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c16sm29501139wrx.4.2020.06.16.05.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 99D511FF9D; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 14/21] util: Added tsan annotate for thread name. Date: Tue, 16 Jun 2020 13:53:17 +0100 Message-Id: <20200616125324.19045-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , "Emilio G . Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley This allows us to see the name of the thread in tsan warning reports such as this: Thread T7 'CPU 1/TCG' (tid=24317, running) created by main thread at: Signed-off-by: Robert Foley Reviewed-by: Emilio G. Cota Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-12-robert.foley@linaro.org> Message-Id: <20200612190237.30436-15-alex.bennee@linaro.org> -- 2.20.1 diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 838980aaa55..b4c2359272a 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -15,6 +15,7 @@ #include "qemu/atomic.h" #include "qemu/notify.h" #include "qemu-thread-common.h" +#include "qemu/tsan.h" static bool name_threads; @@ -513,6 +514,7 @@ static void *qemu_thread_start(void *args) # endif } #endif + QEMU_TSAN_ANNOTATE_THREAD_NAME(qemu_thread_args->name); g_free(qemu_thread_args->name); g_free(qemu_thread_args); pthread_cleanup_push(qemu_thread_atexit_notify, NULL);