Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp410212lqh; Tue, 7 May 2024 03:01:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVahFghKf8XjSet7dGojl3gtFcOkI/VRXuGi2fyqYev8hqwHaJRKfRaoE2s/G130jVtgDhHb2p5rU4fyjUnmz2ukyCuoesgeP+drOt89w== X-Google-Smtp-Source: AGHT+IF1SfX5ArJ+Mvrl2wYrCsi4YVJFFfDBuGhcv0mf2m0uuyijJLYiSwQsAzAbuGQqLCkdbZU0 X-Received: by 2002:a50:9e47:0:b0:56e:2abd:d00f with SMTP id z65-20020a509e47000000b0056e2abdd00fmr8738394ede.18.1715076091748; Tue, 07 May 2024 03:01:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715076091; cv=pass; d=google.com; s=arc-20160816; b=ikCGKylHB3N7oRUYYaNv6zrRqMoWV/nS69Tg5wlpibS8ly5H7aeEU6ROKZyQYvnUpb G8ah0+YiWJpJ1ZXtjjCvSdS5jpOEMdruwdOAiNUtjCwgPKK90llRoikxrnFxxrTliRnp XqtHE2arFr5TxtcwQ0LjFXUTu/t5Efid7hP0O5rKKk8of2q+cuG2cOifuQBYa6O5SEkS dkS9ZS1kWQjQtFMUJ9g895aE3s8Oykq8qCb4bngBc4F7K/8RZbeQppnbUKg4eFNzsoGK GW9wwlaG7uqtGutQ1MUmbhvMRsdHlgI0q8hRTKDgHbnVWShHG6MnXV8kv+sbbWVHNnfV 8HfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=d0DUYuhUVE85sfFy2eTkQ4w3bzgsVv5L2Dw+12rKMVg=; fh=QrVcb7R+l411AJLpNsLOkzb1RSgnqnlwIdWEO65ibSQ=; b=N02bSxoPzXjUBhEYSLtR2RALqTsDrWcVb0Gt9e0WUEK2ZMXMzN4yJldesikR9VntHK QkDX/Tcq3P1wOzkxLziSdM/jb/x4s7mizoRqE49KkWmhraLbnb4GjFoKUeRsUTjM4rIR tggQFmctqvUWUFzPfqyWnjo817kY5tkibZVmVgoJTAWrtww7TXj8bM/E1PuEORSnhVy9 M1JYtM4zMqpmRzlQNpCOtrqAbxrAVaszmBjJJZXjjOY2zeLuP+XccjKs99niarQMfvb+ U91gLIJ2JouDl1rlb6oWb3yI1lDyBWoReMhPZ1QbIAuhy+j6t/gpQW8blgvOxfnn1NQt fHcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-171057-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171057-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l26-20020a056402125a00b00572a86e4acbsi6026338edw.292.2024.05.07.03.01.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 03:01:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171057-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-171057-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171057-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 70BB71F22BE6 for ; Tue, 7 May 2024 10:01:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 781C814E2F9; Tue, 7 May 2024 10:01:15 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C104B14D71E; Tue, 7 May 2024 10:01:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715076075; cv=none; b=qWKraPWnCa9asB+o8gjUSQl9mqm2pQPOuC1dU/Vc5DAHtfrkBW36IQ1vzmAlVdjbauLQxt7fM/8zQOXBNuvzxX0Nk3ngmU/V6yJLJlPugXNy3hV/HX6jIm+EU9Oe4wFUwqDyJXQyAun3G0SbUN4FUzpH9OJYfexQsN0E/I5mrgI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715076075; c=relaxed/simple; bh=w9jRrLGbjxfF2wcuhDg39S1ISD1cICwlpuGu2v10UBg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uMPc3Q2/QaRy7oR6iLxNb0xUO0gBLG9gPq6Ik9zymJwxVdduuHaLtXImrdtkka8b9IZq6KpmmcPMuu/KRExt2f45mIi4AeXn2lr8cNuqVxyehQX5OD/w8kyDLs+wNWfB9hdbWUow/rniQkq27ps0ty8NBr7YF7FMiv/nSISsBH8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F2D51063; Tue, 7 May 2024 03:01:38 -0700 (PDT) Received: from [192.168.1.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 51D093F587; Tue, 7 May 2024 03:01:09 -0700 (PDT) Message-ID: <4ab27bea-ac94-48c3-827c-9f2eddcdd50a@arm.com> Date: Tue, 7 May 2024 11:01:07 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/17] coresight: Use per-sink trace ID maps for Perf sessions To: Arnaldo Carvalho de Melo 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 References: <20240429152207.479221-1-james.clark@arm.com> Content-Language: en-US From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 03/05/2024 21:23, Arnaldo Carvalho de Melo wrote: > 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 Is it ok if we wait for the driver changes to be merged first? There might some review comments which need a format change to the packets and then a re-write of the tool changes. You could take 1 and 2 though because they're unrelated. Thanks James