Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1321121lqd; Thu, 25 Apr 2024 11:48:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZfmYGWPkl8RxAPC/9n+83tAq4NhsRyNo5wVy0Q839pstSSypba8ozpRZCGmV6T2DlWB5XacLuDADBtRSzkhKq51OOkgMpvDF8d8Ygog== X-Google-Smtp-Source: AGHT+IGD5Kb0yTQtrDBTBYKZM7gGctNzXg4VGE98xK1uW5TP0WrV1AXCrJZ0mNLIOYAe/LuGG4C4 X-Received: by 2002:a50:d788:0:b0:56e:2bf4:fe0a with SMTP id w8-20020a50d788000000b0056e2bf4fe0amr281732edi.35.1714070886499; Thu, 25 Apr 2024 11:48:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714070886; cv=pass; d=google.com; s=arc-20160816; b=qTfRwPoxSn+AtwYP1B7bEKsFYKmA82yAtHrDSyZRp7Pj2vg+eqskiw4w7HrdmIEllb e4dru5/5Uf67n5yHoiF58tU3Q3I+UtexCbqdS1hDqDQlT8oqHL1f4i9471U7h2hTFOoZ 1qHVaWb6+ib9+crZrKK+tAFjzv2VqEHFw+o3a2JBUXnjeQjz5kWDJseuk7thbAY4zDeB V/B4i6Vh5uVMUWyx/jI69oSWflhAEjqEthQZGE+9AdlXiDWdSRokRL2zHBvPS7IAnb9r /ujO7m7ApHvKWRug+L9U+aCEbGKYXoqm+6FmUtfBDMxYZSI8Tk0NYX3vuLG+EMKNAlL+ IHiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Zd+jO0yFlQ4sEanciiMKJN79TKgkjc1QJXNZHcm0mF4=; fh=+nf3xsUObfH9Yp5NDiwu6oI02KIu+MFZ4MEudg/3pt8=; b=MZ91C2PKys4lXu5d5xoSbL7ukh+sD6zeIZ0YJHf6nbfp1SNPJIxREyuAnIyDMMufjy D5kXlKLBG3Ze58v8lYa2JoLRSt+cHiJknpJkDNm7EgOmGGn6x/p6/CFFXMVUjLq6g4wr un/PtLXHsxhSUWdmkmhpyAkSzOVkOYwhn7FtGmnJC6O7xaCF8kDiEEnVTDv5E2on3xGb Q1P1vCwTNSLYlnIS+QuWeIkHIhUxpX5/L4PbVIJuvm/blDCZsgV2IgKdwTQdOXtRmTiy sngUSFX/cb8SNcO2XNopEEfI7N2FDYnfoWsKhV7lcpfSO1KglAWb2g/pTObJNB5SDycR IMrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sPL6F28K; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-159031-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cn4-20020a0564020ca400b005705f0b0e84si9816889edb.62.2024.04.25.11.48.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 11:48:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159031-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sPL6F28K; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-159031-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3CF4E1F2248C for ; Thu, 25 Apr 2024 18:48:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 511BF14EC58; Thu, 25 Apr 2024 18:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sPL6F28K" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71D0912C559; Thu, 25 Apr 2024 18:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714070856; cv=none; b=cOv3mz0uBiguF7BMdDLgr/fux3GlwW1vbY3uxaXOOV5GY+N1H+fKxOFc4Oh7zG11Pp2e4NqTsNJfPcdcW200SiBSHx1580juHOVCk0aLIy/fMK7VejQSMNf9XrwOg2PK0kJeM7sc61WJyIf5Bb2n05QP1/6l/gOpAqjqNOyOcKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714070856; c=relaxed/simple; bh=9RQpj8HeT4x95CTnJF7C+mOAuNgta4jz9NDCabC2ZQ0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D+e/nsZ3J7y2xNhlZ2oqEzqE7ZeJqYy+NeNIx1fkHtAZ2G9E+qD97i1W45kUSyhfbaPRw/lL7dAQyceKkwoGL4fJ3lG44WJNhjYY3TD2uQD2Yx9cW9lTffhlw77LrAxEj5rg2RuLS8mAmpmO+McBJMDsPZGYZJ37/OCANkZOca4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sPL6F28K; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 372E6C113CE; Thu, 25 Apr 2024 18:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714070856; bh=9RQpj8HeT4x95CTnJF7C+mOAuNgta4jz9NDCabC2ZQ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sPL6F28KPCdhnmMh7lLejgetWyzuBnBOh4tuEc4AsT3h1DPMcDIMU18cvUWazsv3j Ze5RGZdgBlZv1MB0ko/WSjEiVyOOIvIS5PBShxjGg6rKwiCn1yjdwky4H/kpccmJxw dMrZu1dcST2q2VGAyJczFgdRw4WXy89YyVZRXoNpFW5qmwI4wcaNSg8FPWVgmw6Odn SyccbHx0F7xbthkth2Uv9YdhcqPaSsCcFjAtxikM/QNrp6FOo48+rqmIhMcFU5+s5w Zdfzd5j8xwh1GIfOFtz6Fq2JwKUO5zmVnwwlwlq0kF+dcq9kliq8IVpUSAUdX26901 9UosIGoTwo4vQ== Date: Thu, 25 Apr 2024 15:47:32 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] perf build: Pretend scandirat is missing with msan Message-ID: References: <20240320163244.1287780-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Mar 20, 2024 at 09:36:19AM -0700, Ian Rogers wrote: > On Wed, Mar 20, 2024 at 9:32 AM Ian Rogers wrote: > > > > Memory sanitizer lacks an interceptor for scandirat, reporting all > > memory it allocates as uninitialized. Memory sanitizer has a scandir > > interceptor so use the fallback function in this case. This allows > > perf test to run under memory sanitizer. > > > > Signed-off-by: Ian Rogers > > Note, as msan needs to instrument memory allocations libraries need to > be compiled with it. I lacked the msan built libraries and so built > with: > ``` > $ make -C tools/perf O=/tmp/perf DEBUG=1 EXTRA_CFLAGS="-O0 -g > -fno-omit-frame-pointer -fsanitize=memory > -fsanitize-memory-track-origins" CC=clang CXX=clang++ HOSTCC=clang > NO_LIBTRACEEVENT=1 NO_LIBELF=1 BUILD_BPF_SKEL=0 NO_LIBPFM=1 > ``` > oh, I disabled libbpf here as the bpf system call also lacks msan interceptors. I added the above notes to the cset message. - Arnaldo > Thanks, > Ian > > > --- > > tools/perf/Makefile.config | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config > > index 1fe8df97fe88..74e0b17050b5 100644 > > --- a/tools/perf/Makefile.config > > +++ b/tools/perf/Makefile.config > > @@ -486,7 +486,10 @@ ifdef NO_DWARF > > endif > > > > ifeq ($(feature-scandirat), 1) > > - CFLAGS += -DHAVE_SCANDIRAT_SUPPORT > > + # Ignore having scandirat with memory sanitizer that lacks an interceptor. > > + ifeq ($(filter s% -fsanitize=memory%,$(EXTRA_CFLAGS),),) > > + CFLAGS += -DHAVE_SCANDIRAT_SUPPORT > > + endif > > endif > > > > ifeq ($(feature-sched_getcpu), 1) > > -- > > 2.44.0.291.gc1ea87d7ee-goog > >