Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3842973pxv; Tue, 13 Jul 2021 05:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx160bV1w6pkrxXwnEyHR4ZHHglD0pJgoei5Q1ZvGqjJWglGVhyR6HAAuuQvRReMSDgWkh+ X-Received: by 2002:a05:600c:4101:: with SMTP id j1mr4865757wmi.130.1626178437062; Tue, 13 Jul 2021 05:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626178437; cv=none; d=google.com; s=arc-20160816; b=kcXSJ/zuF6ikoML7dyyf6fjrXDk/Ldl4c97FSl6RRFnAjen2XXtNSKcuqVwO+EtbPp MNSHntBbwdPt3i1/zL7caB9tt4320W327es36kxzK12pRhLQmqwNp+nyFMYor/kdlBXP YN4Zh919+6f71TSwEWax3Ze+bmQRr+UOafWrTFtiIQTWXgyiLowSYwjX5pM+t5SEsYZC 5Vuj/rRPDKgqQkU70hJ7EYGjD3ab61KPiFU8t9Xvvl83ORVLQONNPi9Qv3FHoZEnSugE McUlEBZSSP8hOwZkucIyfkNTz5y9vcLQ8DjJpHrBxnLDVP8X3C9Wl0s8/8QoK7H0MKAL 66bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hzJvn64GuVocrnD1XoP9dZWXdMIrLWE/L8xn1sXzEeI=; b=T/i9UOXq3SOT2H+jkLuNrIrPoT0QrSCgwMeaFjooQ8W2AFPC9Gx344vQLvvdLtl77m /ZcL3dD/ZeqB+YjKkxAtKM86kUW0ru/zCru3mWYNBtUx6QMUOnMciw+GfLI6r+HNlrB/ gNW8xz230/o5wP4Vb2VGzsBqxZfB62dWqMPBR+ZvG790Vf/FVX8EKQZuJ+nZtf1oeJ01 B734g/XsC5JJ6vTbcjIMqWB55WZSLwtXjXuO2AiGEI/dmYloYQ159fSRd1K9rTkw2Q3E brdHidN0fj51HdWV7S7/G94AZmH6nC2u44yJYT5oLHUpoqOu7uUaeM/Cc+8tA2qxKsmb 7Jhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OxqcifLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e25si20824260edu.26.2021.07.13.05.13.34; Tue, 13 Jul 2021 05:13:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OxqcifLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236191AbhGMMOe (ORCPT + 99 others); Tue, 13 Jul 2021 08:14:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236133AbhGMMO1 (ORCPT ); Tue, 13 Jul 2021 08:14:27 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6215C0613E9; Tue, 13 Jul 2021 05:11:37 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id f9so24505455wrq.11; Tue, 13 Jul 2021 05:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hzJvn64GuVocrnD1XoP9dZWXdMIrLWE/L8xn1sXzEeI=; b=OxqcifLaScke4f2YQblfHkQW8pHpHTd0Q6NqWm8rddEsJN/4mxspYQpzGNA+SebrZU cQidDY4CI8BpPyp6M8h5tS0AQjjgUor8+/Vw/lZQly0wmVBi0JkkQM04CIYjLtW8Ao3+ vVWTsoA9076w9xRYf57SQevtNMMhs2dp9xk+Ycg5BIOzRKeZCd5oHCkk2KmIfedqecUi +0mFGKad+U+UUq9gZnxeGT04SILC/WdeJyPE3GKL2UI8lQCrDfVWJI21vkE2ILiGKPFS 3wt2ZplKwKZT9/ctv3H5dS83N+g06BeGZujsv6sDKBasaNffDs5xcfcHO/X76SkoDJiM XoRg== 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=hzJvn64GuVocrnD1XoP9dZWXdMIrLWE/L8xn1sXzEeI=; b=hqeQU6p4Dw/SaRYqGtfTTdNpSkNyMvQ6oAtCwAiTjgZ+uPoq4GkRkDlNf4QlniYRDJ VGlRLGKjHVqk1Gy/xTVSQuuLyI4P4FqEzPAEPIAxWOYK5E5vv3QyoAbtbZTb9EmG3FFJ fhh5VUo8BS0+pYv+2uA1+mEpPleiPaVy4r1rQ3bJl98Y73825Y1NODgn39W+7EJQ3gEq ex4eWWm/yxeR4UEln3VMGmmhC6G/VA6PyGiSa9EWKxCz4esT5EhiehNLH6YpUQTzrrto QPYp9CmP7ZrREmwRnIOKZCEhbh1I81WF9PycrgK8t/41CHMtx1ioty2yCYoJySZiDnEP rcYQ== X-Gm-Message-State: AOAM530fCeT54Yk0oCpko/mXgGGXJDbbeOtisqoWWWB75uD7e3T4Jfqz xeJMc4qR48QHBE5HEKq9U0w= X-Received: by 2002:a5d:5102:: with SMTP id s2mr5314252wrt.214.1626178296428; Tue, 13 Jul 2021 05:11:36 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6456:fd99:ced0:db1c:53e1:191e]) by smtp.googlemail.com with ESMTPSA id o3sm17551425wrw.56.2021.07.13.05.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 05:11:36 -0700 (PDT) From: Riccardo Mancini To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Riccardo Mancini Subject: [RFC PATCH 05/10] perf workqueue: add sparse annotation header Date: Tue, 13 Jul 2021 14:11:16 +0200 Message-Id: <1d27bcf0ee7ba61850b4297318241bc07ba06e07.1626177381.git.rickyman7@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds a simple header containing sparse annotations. TODO: what is the best place to put this? Signed-off-by: Riccardo Mancini --- tools/perf/util/workqueue/sparse.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tools/perf/util/workqueue/sparse.h diff --git a/tools/perf/util/workqueue/sparse.h b/tools/perf/util/workqueue/sparse.h new file mode 100644 index 0000000000000000..644f6db8f050ab50 --- /dev/null +++ b/tools/perf/util/workqueue/sparse.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __WORKQUEUE_SPARSE_H +#define __WORKQUEUE_SPARSE_H + +#ifdef __CHECKER__ +# define __must_hold(x) __attribute__((context(x, 1, 1))) +# define __acquires(x) __attribute__((context(x, 0, 1))) +# define __releases(x) __attribute__((context(x, 1, 0))) +# define __acquire(x) __context__(x, 1) +# define __release(x) __context__(x, -1) +# define __cond_lock(x, c) ((c) ? ({ __acquire(x); 1; }) : 0) +#else +# define __must_hold(x) +# define __acquires(x) +# define __releases(x) +# define __acquire(x) ((void)0) +# define __release(x) ((void)0) +# define __cond_lock(x, c) (c) +#endif + +#endif /* __WORKQUEUE_SPARSE_H */ -- 2.31.1