Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp195583lqo; Tue, 7 May 2024 17:36:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkhEekYNzg342JO8VyUYDllmFvxNjdTFOlUiC/Gb33uO1Y8AYJTFZRq+WQJAWrXXH0zrq39lKl4CORN2JEt4Ra5FpgwNBrnI61yTZy3A== X-Google-Smtp-Source: AGHT+IHQuijwnpwUB/IMoESRkujHWUiSCy9mf0l2ummggCXhaC9vunGEVcU08nAgNcJzcHHdz2My X-Received: by 2002:a05:620a:2849:b0:790:f698:763b with SMTP id af79cd13be357-792b2550f3cmr245593085a.37.1715128589895; Tue, 07 May 2024 17:36:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715128589; cv=pass; d=google.com; s=arc-20160816; b=BzUEZC97Wn7oIjsNfjGKESF8tSHIlW5uQGGI3i7rFlVZuUgml34ps6COOiUDJkX/Uo 7BA6CZxp6vgTYLcGdTme8cXDD6hGpLcsqDRtuJoXpCj830OMKrOLGdUUjzp4wh//giKo 9PtcWBXiN3dEfxt/08Mx7lDr1C3desYZ6+X2PAmxAqcbH/F29rgkPyNdmqyDH9qRzA8/ 3LD6FNpiVqGb1GdMmMBXXr5kRf1xfdlQ1JG0ud6SkWK96vbxvmIJzb1/ZJuIEZd9nqAZ I0icOqOUnwwHsM/n6rSu6DAqs018S4j6PQ9+4jHQyFHeqGNM4tCNkfiDSXCItugq4Mkx GDIw== 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=Boa1yCOB0lxroPa09QhfSoUuPY37H5Y3lhFb6ihyqVI=; fh=lmCKZkAyAPQvc/F8R8DofCZvkIu8r0Sqmv7CuBw0lpc=; b=aZjc//O9LrSvuK4rtNiPwofyqM1tOJw+RKOOl60du65OF7Top9YBTmUBAqzHSmkRCr UnlVj2aAEA+0LMEz/lXajJOVTubC6x2ucxe7pjsDuL41n02wSZ9d1tDhzq2ZDrlcQrT3 QIQUcYHCiDa3S6vrUnfr+gU5s0BYwJuENqfvgu5OzwOlTxdtT0pPre2wP23ArKZcZqT/ Kxo4PrBoEYyLGyCzU9wWJCZaoIv0DO/vSbotkcVKhJFV/HN7coXCfW0Ad8ikl8vNzoUo tUBKIH7Sq4tE9kkKrpywuC5MXUAZpueC4Lc5YJ+1JFz10SfAih75DzdfoXyyLccJAFBR CqOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OQ+H01xI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q6-20020ae9e406000000b00790f56980c5si12384381qkc.281.2024.05.07.17.36.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 17:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OQ+H01xI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172567-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 902E51C236CA for ; Wed, 8 May 2024 00:36:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A2F24A07; Wed, 8 May 2024 00:36:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OQ+H01xI" 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 3375B387; Wed, 8 May 2024 00:36:17 +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=1715128578; cv=none; b=VWMe/2qy0XfljBL9d2n5YufX495cbhorKFGab3WxSSpymboUuk570BVtZ4FZJYrT/rWubUUKq4nDI6LUXqwVXa6hzWaXVlHXv2z3cCltrsyKabvilBIdgEWs4F3xGn0CL1rRJmvKSpMiCwtD8n2XVqK2MSsH5ynNLXehSV6FOts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715128578; c=relaxed/simple; bh=yJK99pCXyuoTwOmUw90tjzeWFArr9+bCKIgZP+l1zPg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PJI6F6ffXlXzlSBgeWP5K6tY8OXmlgh0DkPRVWylYQumoI+zjOp2PJoPULSY3UFJ4fxyeUcqEhcf+HZHdjhHihqOm31JtR5xZkoeHDw7mhOAsMjCMmh0y9u8UD/cyQ/Vsb0EiSSbkdbceVcDQiKzgitzKise6cnRBxFUEKQ/4oc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OQ+H01xI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F708C2BBFC; Wed, 8 May 2024 00:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715128577; bh=yJK99pCXyuoTwOmUw90tjzeWFArr9+bCKIgZP+l1zPg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OQ+H01xIYPmmknJAvbU3bmScXIpz3vpyzx6ir2u7dmO/Xgg7CKerL+vni4NEyPiTa a8wiKTeyvMov2m0/C7+OGHAQaYNVL94XFGbCV3qMO/2+OypsUaEKmWahfa6OoMriHO JOTZzdn6I0qktdd5tcgoxdInIANGoqnVRC4z0sYX3nzUtnjbUu0Tbc5hQWGZCZfQvs wdi3Gt775bGtTmHcmn/2O3Jm8XyA3P3xzYbbkI0N0cEpl5vBNCEczBFRgUz1M+WrXE J3ISBLiQ9ZAWlzE0ACJvCZfU5xMQhMYF1U03doKVRPCFuIiN/n15sIq1WRbLmmd7Bm xWQOzJ05IHqSw== Date: Tue, 7 May 2024 21:36:14 -0300 From: Arnaldo Carvalho de Melo To: Andrii Nakryiko Cc: Namhyung Kim , Ian Rogers , Greg KH , Andrii Nakryiko , linux-fsdevel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, "linux-perf-use." Subject: Re: [PATCH 5/5] selftests/bpf: a simple benchmark tool for /proc//maps APIs Message-ID: References: <20240504003006.3303334-6-andrii@kernel.org> <2024050404-rectify-romp-4fdb@gregkh> 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 Tue, May 07, 2024 at 03:56:40PM -0700, Andrii Nakryiko wrote: > On Tue, May 7, 2024 at 3:27 PM Namhyung Kim wrote: > > On Tue, May 7, 2024 at 10:29 AM Andrii Nakryiko wrote: > > > In another reply to Arnaldo on patch #2 I mentioned the idea of > > > allowing to iterate only file-backed VMAs (as it seems like what > > > symbolizers would only care about, but I might be wrong here). So I > > Yep, I think it's enough to get file-backed VMAs only. > Ok, I guess I'll keep this functionality for v2 then, it's a pretty > trivial extension to existing logic. Maps for JITed code, for isntance, aren't backed by files: commit 578c03c86fadcc6fd7319ddf41dd4d1d88aab77a Author: Namhyung Kim Date: Thu Jan 16 10:49:31 2014 +0900 perf symbols: Fix JIT symbol resolution on heap Gaurav reported that perf cannot profile JIT program if it executes the code on heap. This was because current map__new() only handle JIT on anon mappings - extends it to handle no_dso (heap, stack) case too. This patch assumes JIT profiling only provides dynamic function symbols so check the mapping type to distinguish the case. It'd provide no symbols for data mapping - if we need to support symbols on data mappings later it should be changed. Reported-by: Gaurav Jain Signed-off-by: Namhyung Kim Tested-by: Gaurav Jain ⬢[acme@toolbox perf-tools-next]$ git show 89365e6c9ad4c0e090e4c6a4b67a3ce319381d89 commit 89365e6c9ad4c0e090e4c6a4b67a3ce319381d89 Author: Andi Kleen Date: Wed Apr 24 17:03:02 2013 -0700 perf tools: Handle JITed code in shared memory Need to check for /dev/zero. Most likely more strings are missing too. Signed-off-by: Andi Kleen Link: http://lkml.kernel.org/r/1366848182-30449-1-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 6fcb9de623401b8a..8bcdf9e54089acaf 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -21,6 +21,7 @@ const char *map_type__name[MAP__NR_TYPES] = { static inline int is_anon_memory(const char *filename) { return !strcmp(filename, "//anon") || + !strcmp(filename, "/dev/zero (deleted)") || !strcmp(filename, "/anon_hugepage (deleted)"); } etc. - Arnaldo