From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 163A59463 for ; Fri, 12 Dec 2025 15:52:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765554732; cv=none; b=OCr8fSsLcEblnkbasT0AlvW1ZxIz0SnLanYjpu20XFlzPSgjKbYRLQ5tv3WrQ2MwfnIULZLLjUk6psauMDDMjgDrbHnB3SvzwF1Bww3UVItNbaO3tReAupX4aexV3OBi+PpJQcidi1lFRWeWYMPFk4yei4KSVnSNe4KMT9Z0z+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765554732; c=relaxed/simple; bh=6cveMDU2xhIPiIlaviJbj0HLFpMZOamk+NrqD5tfSV4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=I4CcZZnBeaAOWA60Nz90xBYd6iSWASHle0pR3Gji4TSCDLQFc7Vz3HNRVixU1Rd1M4JU/jzwGruG/Jk9yooyMXWTaTB2ZaGi563/MwBUch13VhwhBd0p1bquzs89mvTc2FDmLNmYRmhr2c//1ahVKukscgT0EdfSmQ/79sqC9us= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=H1PH4aIY; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="H1PH4aIY" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-47a8195e515so12010455e9.0 for ; Fri, 12 Dec 2025 07:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765554729; x=1766159529; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BF5gJ/otAEoZ4clGqcYn+D/DhcYdPlTejIl8apYKJjg=; b=H1PH4aIYKEl7teNkGYxE+6xQp0X2kl/JwUFOSe87i1npMzAALsxsMpRd/qqO7AT9aS YwUFFP2ujl7qTfgB6BCx+tLD/2FNQTt8fZef//aUOJdrZX0MntT54OBryVwGaWoY7Qyp pc1HZn9dS4hub+FFbV2FxNBd4ZEreKhkGjVxwzQDXnsSkpSX3svgCuPaZRI2Ptd41uMK iqbKWRy3z8e961gr9z7QaxaZHLQZ3ApclqUeFpgDk/v79Vq4ueY6IYi5xbyIyy5XCh1Z +QHs3ECXs/G4CLQgLx50PsxsMHO91IPx3UsIKLKcPZX5NdTXvQB+/LhPsJNSbWkie13l gRKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765554729; x=1766159529; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BF5gJ/otAEoZ4clGqcYn+D/DhcYdPlTejIl8apYKJjg=; b=EMb8xI3V9LYfkZZPseZZPRiPI/TMfGQ8fElhfQB3U0DapdE3Ce5LiqlvFVGdUVJoNy BRTkcgXhDPIhYmGUfEL9alCjeG1OjJ5BbjF5ABckcAMlEg2LDfdjEXsq0lwWW1o66mLY HW0AGjXNU5zNeOqS4YM6GowkV8Ddz57lCyhruOjeHP77Ev+9LShJJ/ZhjzFqTUCu16RA XJ5cGfuOcNyar0FlcPACVFgVg7VcYT9vv8R5/ojHSbZapYeGyUyDvRAymr/+djxQo4BF vDxV9UXocrXrZz7o8t9HoTBHwQ7PT9GPh3rhkKFko/zkaW6jD2eH20ESovqDFoHe/QTI fl6g== X-Forwarded-Encrypted: i=1; AJvYcCWnetTxoD+1XTfRlAv3KndnXDtrBz+jwsjIJcWzC1X68PToc4NaM3enzTfZM/8Nk9YAHcLesi7cS7XXtQo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0R3K6BUjfouLGVywNKhTuc4zqAmsMpQuEvVEl9NNTNbVkXw+u 7s0DN78JEKZsDNUdGAq2hJ1Yh612avFXwy+o68rFG60+tL7ZOLky8egbtopwrIes4GE= X-Gm-Gg: AY/fxX7/1ohqtYxp7aWK/K6Jz8enOSbftIdsyZ0ZDMXSJcbFs9YKf/8nvnbLDQAQzMF CMxIw+OiZ90fhbCZiiq/5CAonACxB6gd3cTfznj8rdp+2O4UJSiSkQs7imBvv+uDjaklmI9YSNZ R2Zhjv1wuDmj9oj5qJCdWAj+JeKXiqu/iE+kNy2LN34qOKKGQb9LFJr6SY2SerIzkdfM87G8zg+ F3cBGmCUvQka+QVwd7kLl9PAE2bQnlJEweHl6Re6xjvLL7monPhRuhQwGcYvNTfhXALbTm2Pnbm bcoufenY71U9rmLyb6vNcPolJzAHZrRcSTquN+yHZMZMylUdrFBiZK/YiUmpCLUfAJdu+SBVfdb fi7TK+zj6gcvfbDOYCahWXrdD86I5E3ZQBIoIkaaKB2BF0PevWbhT+eMpYTxBSaVSUX8xbsquIq VrUMaRUeKW7EQxeRQLd5pn X-Google-Smtp-Source: AGHT+IFyYqsJru0EerGFYFTMp90A+LMaDZcZ5Gsc9tDkxrzqI6XWJZKohcECOZHdf9TafH96HnDZ4g== X-Received: by 2002:a05:600c:450b:b0:459:db7b:988e with SMTP id 5b1f17b1804b1-47a8f8c0608mr25573425e9.13.1765554729284; Fri, 12 Dec 2025 07:52:09 -0800 (PST) Received: from [192.168.0.108] ([130.185.218.160]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8b85f38sm12766586f8f.28.2025.12.12.07.52.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Dec 2025 07:52:08 -0800 (PST) Message-ID: <26b61e11-1dfa-4be1-8d58-06e35fb04d64@linaro.org> Date: Fri, 12 Dec 2025 17:52:07 +0200 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 07/19] coresight: trbe: Refactor AUX flag setting To: Leo Yan Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Suzuki K Poulose , Mike Leach , Anshuman Khandual , Yeoreum Yun , Will Deacon , Mark Rutland , Tamas Petz , Tamas Zsoldos , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter References: <20251201-trbe_buffer_refactor_v1-1-v1-0-7da32b076b28@arm.com> <20251201-trbe_buffer_refactor_v1-1-v1-7-7da32b076b28@arm.com> <20251210154308.GZ724103@e132581.arm.com> <27417fd5-902e-4474-8d60-356a94ac9590@linaro.org> <20251212152738.GA181228@e132581.arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20251212152738.GA181228@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/12/2025 17:27, Leo Yan wrote: > On Fri, Dec 12, 2025 at 04:50:52PM +0200, James Clark wrote: > > [...] > >>> The trace can be stopped on Fill mode (stop on wrap) or Stop on trigger, so >>> it is not (only) about buffer error. In these cases, even though the trace >>> unit is stopped, the buffer may still have space available, tracing can be >>> directly re-enabled in interrupt handler, thus the COLLISION/PARTIAL flags >>> are better choices. >> >> I suppose this is the bit that I don't understand. If there is space left >> then why is the stop hit at all? > > For instance, the buffer becomes empty in the middle: > > +----------------------------+ > |$$$$$$$| |$$$$$$$| > +----------------------------+ > ` base `wptr `limit > > In this case, the trace unit stops when it reaches the limit. > Meanwhile, the tool might have already read out the old trace data so > we will get some free space, thus no need to set TRUNCATED flag. Hmmm I see, I still think that means that Perf is being too slow and disabling the event wouldn't be that bad. Also isn't there a very small chance to hit this? I'm wondering if you ever saw PARTIAL flags in practice? I think the following all have to be true: * 3 out of 4 sections were full on the last interrupt * Perf hadn't managed to finish reading even 1 section in that time * The last section fills up * Perf had managed to finish reading 1 section between the time of the previous interrupt and the hard stop There would have to be quite a high variability in read speed to make that possible. Maybe it happens and it's worthwhile optimizing for. The comments could explain it better if we do decide to keep it.