Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp61157lqh; Fri, 3 May 2024 13:24:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/ySYQX6OE00XdkpQBZVJmuohjWWdJpaVtN5nyfTqQDrsAXAdg4G0zJQHUIha0K25INiWsI6OKeQbHNdJO2tOLREysHZClrVM6pGocyw== X-Google-Smtp-Source: AGHT+IHXPuOdsdqMpCxh7ZtvZIGTpzrNeUWz3fk6XQq3y5nAjfiTSmuow/V3qMslw4tD2F1bRKW6 X-Received: by 2002:a17:903:228b:b0:1e4:6253:2f15 with SMTP id b11-20020a170903228b00b001e462532f15mr4458561plh.16.1714767842701; Fri, 03 May 2024 13:24:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714767842; cv=pass; d=google.com; s=arc-20160816; b=XFFcrScPXNDouKt+wNRnDqlNjsw9BFxk2RGli0zL6t9HlbCMpbjGjvRBTUWpsCG4kg GOVxF1gpYKUysuibTonEPcqLXomkuHwt1YpZWh8oRzxvre3987Za6eXFUWq04kqPclep 4PCTrTQCMaYlKt/799RMWHP37lcH+xY3VD11mjj4qXB4jBBcReQCQD6QoNGXEJ0ZNXIz anvDHV9T1CMcJoeLQSNlZn4KFKnICzys9tHphL0VTitXE0bSc6oY6jpVMQHPtjUIRidu 1IBBmlJlqWCqa5YfwzsNKTHtB7bvtMJTsZILsBV6s+wFUsZsIrJ+jyJ434VY8g4shrgA GxWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zeZzDSzwunN6WOHnQzq3Tmmp01FAULu1AwUhcJnsP3I=; fh=g0M8Is1hif24VmHszIph2oyerxAtNkqmfbOVFOEwV68=; b=LpwtAMLwvmOuuVNXBKvrankVV/wukkEbus2dPGT18Chdu9jqmZQ24exJMChIaefRJL IK2BMiI6XB5JIs8eVG/chZNy56M1PoV9w7xUWs6j8KztO3oissWN7ZY3/HkQbvUbeEIn dZBHi+aZRPJPbNhWqfrjA6Bi4M3q+3m2ZFChY8yph2Fj18vJtyizv+4TYT917Phu2Pvw R1Bp5F30DrhnbdT5iAIYCcljO82QhMkyok+uqKilBrBbtwQBcG97jEW+9n0JDiIaiaTH 0YTyHGvQ7CaYFMpRa1hdOdliuMOJ8V8jdzWLS8tvsvjpnCLJVMapsPnAQHFuMRL0Lr2O P/IQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M3znZihv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168178-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z9-20020a170902d54900b001e78de621a4si1030415plf.384.2024.05.03.13.24.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 13:24:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M3znZihv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168178-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168178-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 57F092855CA for ; Fri, 3 May 2024 20:24:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EFF9158DB2; Fri, 3 May 2024 20:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M3znZihv" 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 4265C158D86; Fri, 3 May 2024 20:23:54 +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=1714767835; cv=none; b=kzJAUKDgS9h/dqjCaJGesIndT4SoIjUUlMuluR013VoMCB47oMLm6YEtREPRYs11mmgB2nOhOurCT/nyzQcZ4IN6sc+IAvEoPka2agpeyEZH70JV2J9FUebsGStk4luZg23MPWnYSruQB+Y0Z62ckuxVuITfBGfeNqZcBZcNeg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714767835; c=relaxed/simple; bh=VHK2aYXQsjwUVWEy+15TxeXXA9tATJmF9VCn5bK+xlo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CG6pBmPoXa7B2DoyMHla1kBOE/yK59plQujvRNdDEG3jAqbhNMJGvgoZ7uw2lKTgZqb4mtYpG2xs4RraxvGxEbBdoXNNhWfG2r9rMd1D0mH6zKT2MNxS9+L45snIMRDOIMOW34rdeTPJhPoJGFm/ZwxNTdNLy/t3insfY0kynHY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M3znZihv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CAD8C116B1; Fri, 3 May 2024 20:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714767834; bh=VHK2aYXQsjwUVWEy+15TxeXXA9tATJmF9VCn5bK+xlo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M3znZihvBOZCe+Su1jHeQ4Usj4NM8suZd89dcBJWo8tt5kYIE9olqRolnGuImWyyv fhE8F72lrnZsrreBH4pXIxIvUCOqvVgxeGTV+6VXcASG1fL6cbANzlu8mI5ObU0lRY pIw6V9c7Os3iZtCGUAnUMYZ99XchqPuoW3v8sNLkv/eLQkJ0qdI87sa8sZVaIHSp/Y BmnUfO1ppzA5rYy+PuN7MKTuBJPR7XKNU4v2pmNpV4i9NsjQCj8F/nCNhgdLMZIN5O z3JGzsb4A6I1+lSH8Ovyun6au29I2oiXNMQgtDB1CONeU0J3WmI+fvLy0Os5gwL78Y d6sR9BBQQ6WDA== Date: Fri, 3 May 2024 17:23:51 -0300 From: Arnaldo Carvalho de Melo To: James Clark Cc: linux-perf-users@vger.kernel.org, gankulkarni@os.amperecomputing.com, scclevenger@os.amperecomputing.com, coresight@lists.linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org, Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , Adrian Hunter , John Garry , Will Deacon , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH 00/17] coresight: Use per-sink trace ID maps for Perf sessions Message-ID: References: <20240429152207.479221-1-james.clark@arm.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=us-ascii Content-Disposition: inline In-Reply-To: <20240429152207.479221-1-james.clark@arm.com> On Mon, Apr 29, 2024 at 04:21:45PM +0100, James Clark wrote: > This will allow sessions with more than CORESIGHT_TRACE_IDS_MAX ETMs > as long as there are fewer than that many ETMs connected to each sink. > > Each sink owns its own trace ID map, and any Perf session connecting to > that sink will allocate from it, even if the sink is currently in use by > other users. This is similar to the existing behavior where the dynamic > trace IDs are constant as long as there is any concurrent Perf session > active. It's not completely optimal because slightly more IDs will be > used than necessary, but the optimal solution involves tracking the PIDs > of each session and allocating ID maps based on the session owner. This > is difficult to do with the combination of per-thread and per-cpu modes > and some scheduling issues. The complexity of this isn't likely to worth > it because even with multiple users they'd just see a difference in the > ordering of ID allocations rather than hitting any limits (unless the > hardware does have too many ETMs connected to one sink). > > Per-thread mode works but only until there are any overlapping IDs, at > which point Perf will error out. Both per-thread mode and sysfs mode are > left to future changes, but both can be added on top of this initial > implementation and only sysfs mode requires further driver changes. > > The HW_ID version field hasn't been bumped in order to not break Perf > which already has an error condition for other values of that field. > Instead a new minor version has been added which signifies that there > are new fields but the old fields are backwards compatible. I guess I can pick the tooling part now, right? Further reviewing would be nice tho. - Arnaldo