Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp92858lqh; Mon, 6 May 2024 12:16:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtxJKvYE9bEMTeOZJwCoQluIsYqU5irDe1f7C8rlFH1/EhplKs13T9kVKukuI4hqWfw3MYUeX9DBJy9UL5WSf3ziyTWPRORdf3E6TVkQ== X-Google-Smtp-Source: AGHT+IHYfxasQtxD22Kt+vnj70l7bturCDI97nGTmtuzK3Qsvbkrg9+CHTS0r3atLz6thtFltTri X-Received: by 2002:a17:906:f146:b0:a55:6f6c:3bae with SMTP id gw6-20020a170906f14600b00a556f6c3baemr6228891ejb.0.1715023009016; Mon, 06 May 2024 12:16:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715023009; cv=pass; d=google.com; s=arc-20160816; b=cgoqadrD6Ei8dB4WPFWCJjkkWWAKSJo6y4E5tPkUcsA/yio05C8/YF+8YcvwrHEBOu hsJPU71TEg6PC0/Rwp5SHZTV4ZJwJNZbU+nW0SOzMEMc9QEA6rUat56LnA1ovNt+/T96 gQq6/sX3UuYiA+ASYzCR/uW3AB6qFlFAj146Zv7N4i99XSgxzj2jfzO4b3rHh4TmAvx5 In7620Xbn1wuBmYsG8fjPQ4ziNPVNsflcGv7TyB1gYMQNrYAsUyYeIZwX5BfPviO1R4w aBq+smK6JBDimYLGrYnHPo8TdS8a4ByPrGP7WsA5URcBEcqXlDl5M5n5CyPhf2zW22vf 7r3g== 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=FOiLuclMLCVOJU6VC9y2A35tnAyv+/gex3syTeIhZGw=; fh=kRN2qpeCT3k1dAPddJIwZTP7oGTzwJbAXWv7AW4s/DI=; b=NAO/wWED9SxdDefDghX3O6Cc88MpXyy2DidPC93zmVPWDg3UFK4Gro5UY/x6j21D1l +TzJzPiNU7ShBdheRjROJlBarTiTC1EQIRhMI5F1wtU13VurI9/033IGz0gdJ6FvDQ9P gGoH4CMRneiUIeovsqvXNgzo6bZ1iA49yEHnwazJraNgZrRPXDynf7zkl/DqprB1DqId s0YB7/f0oeXTUORi1kO81s96+lP6sHk7t4JrCAbgHHeak55l28CU2DQtdocijtvQMeS+ z6pr8KQtTncxFWhUvxON06UMNnwhtHNYjFwJ2kCe5k63kqEdGq9OwA/bL8bHP06y+IGW cS1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p22adx8V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170328-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. [147.75.80.249]) by mx.google.com with ESMTPS id d10-20020a17090648ca00b00a599d5adfccsi3880348ejt.991.2024.05.06.12.16.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:16:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p22adx8V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170328-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 B999F1F22B3A for ; Mon, 6 May 2024 19:16:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AD981591F6; Mon, 6 May 2024 19:16:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p22adx8V" 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 52BB641C73; Mon, 6 May 2024 19:16:34 +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=1715022995; cv=none; b=N3fb+B/+Km4TpQ5vOLKGDFfFPIhfEMRup0yVuFT6smVb4tak8AGtIaoMuJ9cIgiYDFF289WogBjbdy8zP78kNBW/ZrNO4PMEv6eA4+3frCWzsv4iOq1Ux+NIwEzLrURkCg7CDDI7m29WZqqcGQmTGZ3wOpv22cpOPFooFai//k0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715022995; c=relaxed/simple; bh=dM4RYK1HPhpiphlZExp0kEMnb2WuO6EBZsOrpdKmkeI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RBQ1z4dbznicDsR9AErtgKPqM/FFcQzqIwvmgXk8oeKdrGv7OqinjwUVloUiaCy+/wmDtMr6+zUIh13Xg2nwTpNz3yHSC+5jyO7m94m0lxMcgrKuo+Mo23+qb0dnUZzGA2Lyz7hnfYxVJfDrSCywPy2d16n3vPNOJVtinSB3Cpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p22adx8V; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D687C116B1; Mon, 6 May 2024 19:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715022994; bh=dM4RYK1HPhpiphlZExp0kEMnb2WuO6EBZsOrpdKmkeI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p22adx8VFW7ioiNw8e/ZClDpQeoamqBgo/VwXvYdTwee3MTcDB2ZePDbNbjAvc4T5 NuGCLi+wL0GgrhzfHq6N9p0AFieqH32JaMVefOMxHrSdra4NOfhuWldsP15wD7WedX OoxyBdvnnMSyWkIrxg6rk0nv4igi/dCiaZeaQ+bQOQck7dkfETOlMAxrws+8WIhOOd nLYtWcMphLkM4rwdvbXR+Hmw03/ilUto8JVBQvKOp80RI7niKEEcz0NnYK2Z273oMa 6dcJGaWJf31fdI2kMmlRNFbgcogQyWoXU+k2xg8smolJCa7JAMdHFNTCHIBc3s26we lN3Uzt6mOpauw== Date: Mon, 6 May 2024 16:16:03 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Andrii Nakryiko , Jiri Olsa , 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, Daniel =?iso-8859-1?Q?M=FCller?= , "linux-perf-use." Subject: Re: [PATCH 2/5] fs/procfs: implement efficient VMA querying API for /proc//maps Message-ID: References: <20240504003006.3303334-1-andrii@kernel.org> <20240504003006.3303334-3-andrii@kernel.org> <2024050439-janitor-scoff-be04@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 Mon, May 06, 2024 at 03:53:40PM -0300, Arnaldo Carvalho de Melo wrote: > On Mon, May 06, 2024 at 11:05:17AM -0700, Namhyung Kim wrote: > > On Mon, May 6, 2024 at 6:58 AM Arnaldo Carvalho de Melo wrote: > > > On Sat, May 04, 2024 at 02:50:31PM -0700, Andrii Nakryiko wrote: > > > > On Sat, May 4, 2024 at 8:28 AM Greg KH wrote: > > > > > On Fri, May 03, 2024 at 05:30:03PM -0700, Andrii Nakryiko wrote: > > > > > > Note also, that fetching VMA name (e.g., backing file path, or special > > > > > > hard-coded or user-provided names) is optional just like build ID. If > > > > > > user sets vma_name_size to zero, kernel code won't attempt to retrieve > > > > > > it, saving resources. > > > > > > > Signed-off-by: Andrii Nakryiko > > > > > > Where is the userspace code that uses this new api you have created? > > > > > So I added a faithful comparison of existing /proc//maps vs new > > > > ioctl() API to solve a common problem (as described above) in patch > > > > #5. The plan is to put it in mentioned blazesym library at the very > > > > least. > > > > > > > > I'm sure perf would benefit from this as well (cc'ed Arnaldo and > > > > linux-perf-user), as they need to do stack symbolization as well. > > > I think the general use case in perf is different. This ioctl API is great > > for live tracing of a single (or a small number of) process(es). And > > yes, perf tools have those tracing use cases too. But I think the > > major use case of perf tools is system-wide profiling. > > > For system-wide profiling, you need to process samples of many > > different processes at a high frequency. Now perf record doesn't > > process them and just save it for offline processing (well, it does > > at the end to find out build-ID but it can be omitted). > > Since: > > Author: Jiri Olsa > Date: Mon Dec 14 11:54:49 2020 +0100 > 1ca6e80254141d26 ("perf tools: Store build id when available in PERF_RECORD_MMAP2 metadata events") > > We don't need to to process the events to find the build ids. I haven't > checked if we still do it to find out which DSOs had hits, but we > shouldn't need to do it for build-ids (unless they were not in memory > when the kernel tried to stash them in the PERF_RECORD_MMAP2, which I > haven't checked but IIRC is a possibility if that ELF part isn't in > memory at the time we want to copy it). > If we're still traversing it like that I guess we can have a knob and > make it the default to not do that and instead create the perf.data > build ID header table with all the build-ids we got from > PERF_RECORD_MMAP2, a (slightly) bigger perf.data file but no event > processing at the end of a 'perf record' session. But then we don't process the PERF_RECORD_MMAP2 in 'perf record', it just goes on directly to the perf.data file :-\ Humm, perhaps the sideband thread... - Arnaldo