Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp106538rdg; Wed, 11 Oct 2023 23:24:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSXsF55B9jKjX38WJo7EKnCksUYftf34iW5kr9g83uHC6CTtyqUhjD/bLwt0amzCjWueU/ X-Received: by 2002:a05:6358:281e:b0:145:63e6:8710 with SMTP id k30-20020a056358281e00b0014563e68710mr27393007rwb.23.1697091897589; Wed, 11 Oct 2023 23:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697091897; cv=none; d=google.com; s=arc-20160816; b=Si5gNiyXVkeSjCaKsMpBM1+K/gR3sEmP+kOoLCbCKfERIosx/7O2BxgAtTUZ2nwstw VThPLX3in2PgsD0olNWCLYa9Fp2oC6uRtHx82yba00yg91tBuTRohNeviIgmlzxqpicQ fdh7o6ZvNTg2GjLa9jQdZDjlTKoHb5i1vWMmcGi59n8lK9g2jSTxqorYvuyTnPzGvouf tGanrRYd25U5fary4x5IZoAumMSjaka4dj8wYsHNGaOSUEZqs9xnE2pQQp35edAm/tjS FUD5+dRfaU2eSrdH1EMGm6bUMP9jYComAft/wRyEXDgGJExCxlNIq5nmoEayAF6H3dAN U7CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=e5eVmSUwSJxksG4NuITaTSZqNGvqcD7jLZAKoPJCuWU=; fh=d2c3GDvCFnEMjeV5/UdzkMgvIdbP06sIBDmJP5CjgvI=; b=Ocs3c3VbUleds6yXrcuFFPiRVURypDDxx7uFwigCM0leEV2FpoE5Uzt8jvkM/Lmcx2 tkHFUkBgm+OgYF3oyRDXAV+uLLg3U3ELrqCtySxYHHCb1JUzukVIlOAfUv8l0FTvHKES r6MbMkXKDYDONxFD2zGvT1hDcAkFY8Ytzeh19IMJ1lZpYaYQlBj0T8MBvF+12G2a7I69 ddCzMBD2FPiV8lml5EhxRGdTngUEtWbfDOwvqzd1JYPCEGCnIIDH6zgGfZ18fTMD9ihU c8HgLyS4Qu6uqmVotgNlmdZmOdsb/7Gge2CkYqvT5jvqlXvnoM4WTu1ZukYJVVZPsnie hFHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=y5oLkfN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ei21-20020a056a0080d500b0068ffe38c5ddsi5486882pfb.223.2023.10.11.23.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 23:24:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=y5oLkfN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6EDF381143D4; Wed, 11 Oct 2023 23:24:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377455AbjJLGYN (ORCPT + 99 others); Thu, 12 Oct 2023 02:24:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377428AbjJLGYK (ORCPT ); Thu, 12 Oct 2023 02:24:10 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BC34C9 for ; Wed, 11 Oct 2023 23:24:09 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d9ab7a8b736so808961276.3 for ; Wed, 11 Oct 2023 23:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697091848; x=1697696648; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=e5eVmSUwSJxksG4NuITaTSZqNGvqcD7jLZAKoPJCuWU=; b=y5oLkfN06TgWXS3T+DIqI41033RTHqlG50bSK7V7VQbAhwhGGcSjc4qAwqKygliEMw Dzh/xEbTTErZN4BVS3Pbn0pku5E1Apc/bqPd6Ijh7VRRFgk3TbWeg64L30Wc1WorAbDI YG3JeTkPUZUCwugaaFoloZaSE8CctvzKlONXqM6TlgyEdq0KhiT+M4srskMsnAlW5Lt8 /KhwYKQQyxkmrKvpGXmEqd1ntx5trZWSpnYKse13WRT+Ojt93O7egD7ZW47xYOAYtqCv 28251R+c3r7BXlB9v+5AgoBC9rpcEwCudlwhbgLlNKT8+UqnTLAEyDDeYiOAAEBZuw0Y 03CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697091848; x=1697696648; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e5eVmSUwSJxksG4NuITaTSZqNGvqcD7jLZAKoPJCuWU=; b=d3uPvUkYcR7EfabbNWR4ViVz+sJDd0REGb8rvAtFE8cadvKZIEVg+uH9vEWeSA5PNn Nri8T+5Q5JKt2KeE1+dHa2InoNTTxnJyaGTHJ7bIyQIWthruZSHmwaQgeIjO//MgEfY3 yKeeIFAQQmbwYunJ1B6qO2VoKaCW9sbW8JiuFp5yniO4V0z730s7JnRYjLOfQFvgi/vV GqlyOGSa8RJJ6cdGcrTa5a5HkmpgjcNmzTJW9eYslvKfhrbI4fPpPmXQeytVhUDNmQwm NU1pqBLh+hOUmIVxeDTyZZje2rfcJoTfHOG2mrcfKDQcZrYmvMwk6ZCXIN+VnLZlMhmw IsBg== X-Gm-Message-State: AOJu0YzkaMTy5O+PGCQRVad/iTK8QVpuzEIUtqE/R9jw5yEzvfeSpoGo 3XO2i+QHQ1FqLgPeciqRRBNnmcLYGj53 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:7be5:14d2:880b:c5c9]) (user=irogers job=sendgmr) by 2002:a25:bccb:0:b0:d9a:61ca:7c7a with SMTP id l11-20020a25bccb000000b00d9a61ca7c7amr138294ybm.11.1697091848675; Wed, 11 Oct 2023 23:24:08 -0700 (PDT) Date: Wed, 11 Oct 2023 23:23:48 -0700 In-Reply-To: <20231012062359.1616786-1-irogers@google.com> Message-Id: <20231012062359.1616786-3-irogers@google.com> Mime-Version: 1.0 References: <20231012062359.1616786-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Subject: [PATCH v2 02/13] libperf rc_check: Make implicit enabling work for GCC From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Nick Terrell , Kan Liang , Song Liu , Sandipan Das , Anshuman Khandual , James Clark , Liam Howlett , Miguel Ojeda , Leo Yan , German Gomez , Ravi Bangoria , Artem Savkov , Athira Rajeev , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 23:24:51 -0700 (PDT) Make the implicit REFCOUNT_CHECKING robust to when building with GCC. Fixes: 9be6ab181b7b ("libperf rc_check: Enable implicitly with sanitizers") Signed-off-by: Ian Rogers --- tools/lib/perf/include/internal/rc_check.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/lib/perf/include/internal/rc_check.h b/tools/lib/perf/include/internal/rc_check.h index d5d771ccdc7b..e88a6d8a0b0f 100644 --- a/tools/lib/perf/include/internal/rc_check.h +++ b/tools/lib/perf/include/internal/rc_check.h @@ -9,8 +9,12 @@ * Enable reference count checking implicitly with leak checking, which is * integrated into address sanitizer. */ -#if defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER) +#if defined(__SANITIZE_ADDRESS__) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER) #define REFCNT_CHECKING 1 +#elif defined(__has_feature) +#if __has_feature(address_sanitizer) || __has_feature(leak_sanitizer) +#define REFCNT_CHECKING 1 +#endif #endif /* -- 2.42.0.609.gbb76f46606-goog