From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63BA13A0E8E for ; Wed, 15 Apr 2026 08:32:28 +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=1776241950; cv=none; b=mr2wdmqa1+8koxsuVoXk0MnDmd99i9ojRyHDRvlQ5X2F0Rik4RAW2f/lUAUexQ9rF4CuW+hnma6R5J/8kNKb2Ft3WOVpWlBBxP9fuRWVhca2WV9WztWGytC3TKFbIagoNJQlcYFHGrdDfdg8e+gQaGyWC5pM+YVc4yK04d7O1qk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776241950; c=relaxed/simple; bh=3Oz86IP4KYvd6deOUSDzB67MR2t73cfuj670d+WNmzo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tSG1FdTVJtfmFLUn1S+W7980uEWJmwVCWMiIR03FACBjE7Lp14croTnmVnCsX+zg+B1VnZPRHU9z6v6iGcctdcINXtOCjPLupKvHDaX6YOCqpTId1Jpz4jUfSvcqqeEm1UfoLYpoIYLrMl1BlMItjm0AWF83UslIDhLXxcIwVww= 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; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=Od7qU9yc; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="Od7qU9yc" 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 C76EF4FBA; Wed, 15 Apr 2026 01:32:21 -0700 (PDT) Received: from localhost (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C95F63F86F; Wed, 15 Apr 2026 01:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1776241947; bh=3Oz86IP4KYvd6deOUSDzB67MR2t73cfuj670d+WNmzo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Od7qU9ycVAJ7NZPjTu8N/n5px8XP7FCmjka+VPZpo+2Y50cv9e6ZYbZ8R2gjou/qD 7vNQitqNq92Qb6pljihwzKJ8iKI1SYHE5q586Sw3Xjou2uRRkaAKw8YIrj+UnWSQqe zt+sQUcDPxGasRQy50YzgyrNp+tN/bR2EtOGWZVw= Date: Wed, 15 Apr 2026 09:32:24 +0100 From: Leo Yan To: Yeoreum Yun Cc: Jie Gan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, suzuki.poulose@arm.com, mike.leach@arm.com, james.clark@linaro.org, alexander.shishkin@linux.intel.com Subject: Re: [PATCH v4 3/9] coresight: etm4x: fix leaked trace id Message-ID: <20260415083224.GJ356832@e132581.arm.com> References: <20260413142003.3549310-1-yeoreum.yun@arm.com> <20260413142003.3549310-4-yeoreum.yun@arm.com> <20260414163221.GG356832@e132581.arm.com> <81fdef8a-a60e-4d29-948d-c4a07e23dad9@oss.qualcomm.com> <20260415072933.GH356832@e132581.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: On Wed, Apr 15, 2026 at 09:01:09AM +0100, Yeoreum Yun wrote: [...] > > > What I am thinking is as SoCs continue to grow more complex with an > > > increasing number of subsystems, trace IDs may be exhausted in the near > > > future. (that's why we have dynamic trace ID allocation/release). > > > > Thanks for the input. > > > > I am wandering if we can use "dev->devt" as the trace ID. A device's > > major/minor number is unique in kernel and dev_t is defined as u32: > > > > typedef u32 __kernel_dev_t; > > > > And we can consolidate this for both SYSFS and PERF modes. > > > > When I see the CORESIGHT_TRACE_ID_MAX: > > /* architecturally we have 128 IDs some of which are reserved */ > #define CORESIGHT_TRACE_IDS_MAX 128 > > I think this came from the hardware restriction for number of TRACE_IDs. > In this case, clamping the device_id to trace_id seems more complex and > reduce some performance perspective. Sigh, my stupid. Please ignore my previous comment, let us first fix ID leak issue. Given Jie's comment on the use-out issue, it is valid for me especially if a system have many dummy tracers. We can defer to refactor it later (e.g., use separate ranges for hardware and dummy tracers). thanks for correction!