From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 1573833D6C9 for ; Fri, 14 Nov 2025 15:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763134476; cv=none; b=a0Bv3nDOfcyhHG46Me9MQ3fNM6/NbgOlRZX6JMhfATEdRTRDoG6/KiLd0LEGu2xgk3vnzmato0cjwaZPkJoHO2bHH9riXIakLlp6tyyaRQB8S2vmr2YIaGGlgNiKJp1ML+VjejjZnzpCtEQOaVi9TGOJjphMqHOL+esupJ6lkDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763134476; c=relaxed/simple; bh=ZQz2FMkTmiCawZ4J2vs+T5KKCZmjDu6DnoRQcKwN8LI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EtT5syXJsddDNvDxKyPBMky5Kljrn0OU3u3ijNasnt2v8ZxpuXcNy6lCAcVkH3rOJB3NckUxTNBnDzyGrWjhPs6Jzm/8+Uj6nreunmlYwMvG8mJwvjJc1a8wa1/vNSehGzoQrOONetusVZbdFaB5P6NJpKWyxJWwjeaSpIoAUQs= 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=PSYVDBRh; arc=none smtp.client-ip=209.85.221.50 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="PSYVDBRh" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-42b3b0d76fcso1412829f8f.3 for ; Fri, 14 Nov 2025 07:34:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763134473; x=1763739273; 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=C3q07i2Mxp8ymZccHYSaVs1bYwvtotulPZj159o78ws=; b=PSYVDBRh01XgyPX+I+CPOQ1jT9MktzNnpY7yG7BYDFnqKiHXq7Z4nWIMBHNW33zYqC fIV79VH95W7a6UbAzu75IhW9RjEqQqT0uLYYBwHQdH2fY2YI/2RWpRni8PopTIfPiLol pcMLTyppRIVKVikwLrnC2Bs3OQdlZ4OOanBLZmfJCmElq5au0OrymNA5SW4YNqj34rUL FDyGfsiaQpZ+1kFlubLdEeG9aXIyA8NpX/zrWJ2eiWdAlkelcGzgDJlVLZm1XpgEJeON 53UD3HhLlG233WIhL0m5iazmkSCOkWo+Y/b/5rFrP3bsOHzhsppZ/NocUWb6AgUe9CWB dWqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763134473; x=1763739273; 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=C3q07i2Mxp8ymZccHYSaVs1bYwvtotulPZj159o78ws=; b=RMR4Wh8JBxHLU+1c0r4V5CIXNk/8+qJX78nVFf7vJoHyP+6YXKq9CJgzOk3GQdHuPh co3Ln6iPWzKRKYulMidtqN1Yhet2NWEWoLqtuxap3co1Gldq9U3BnSFtqk1Jf4UU1+4q 4Fkz5S8TBAIOzBfvfGkh7A9JoljRUmxU+vYDibI/p9wJnTwCwHeQXkQ3tTcPB04ytqDR InVD7Pl7pvaEzFp7YyqkYYWJ3OA3Q5p5hzOzou+zEgelSgzDNQTkehi27vrFHFSjZ8Jd p4iTjzIkqccbisu2vr7dvdKwT43LRpt2zdD/7bwTRmfR+7iZQx37hTyY+5wFSLqdPIiz G8fQ== X-Forwarded-Encrypted: i=1; AJvYcCVdWCGJhrsb6GJSxJTmrAD9TgfKuxby2Y0QG9W0EU+B2t+Knk272fDh3Sw275PeWzhz+d5YPmJa+t3MNB0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywn47bj23z6lxOiDhpoZcU5RmPy+yF1h3H2CCuCAYUHAUNsiRcv oMCVedODbjg9b4mIA8i0YzQXhqvHEXjJ9wz+MvrC8JVTydX4itgn3WUi4bZo9+E6/6Y= X-Gm-Gg: ASbGncvsbh9DXq8nuAUMTWqJj64RXjfZ8smq7WA45OyqZGEjtR1bwgVzvqVcNkmI7F/ bPnrlwWorgQzeJXfMqWFBsHTXtrn5eX+DiLU8jzqPeAkw7/VCIMUCuZGCCo6vHMnyQs5MfWQl0y EHh+XgXpnzjD8xXXHiW5fRiNol34wiuyJvfXyny64gvBws8h2fvfktsYv0D9OKtr/4ekBWfv/sm pmV4yrxXBw9oI+MahREih3GkwuYWoqOnIqs1ApTVfdlOfnlJHWs6gg+O4GWJPKIa0z6IYE/QTG2 voWbQVJJ7kuqhMC256WFEcDI4K203XpylgB0jD3iF4Yoz4/m3WbNQwQt905/n2qthN/fPhYAFAW X5k+tokGAMUCfbSLupaPkd6dLiUiYwr4m5D53KS/67E1o1x7ObuyQlr4w6VSpuTAljXtbEJ0yfP xbnyj0QQLMZOGdnpBj X-Google-Smtp-Source: AGHT+IH8FrMnIJiG2DgEll/+zhTyysVGVgx50Ww0DSAImDg/dmoGOLNaeuBBspK7MALsggi1sXKBPA== X-Received: by 2002:a05:6000:2509:b0:42b:4081:ccb8 with SMTP id ffacd0b85a97d-42b5934253amr3564970f8f.23.1763134473333; Fri, 14 Nov 2025 07:34:33 -0800 (PST) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e85cc0sm11019027f8f.17.2025.11.14.07.34.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Nov 2025 07:34:32 -0800 (PST) Message-ID: <0d2d2660-7552-4cb1-b974-87f376f153d9@linaro.org> Date: Fri, 14 Nov 2025 15:34:32 +0000 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 v4 08/13] coresight: Interpret perf config with ATTR_CFG_GET_FLD() To: Leo Yan Cc: Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jonathan Corbet , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20251112-james-cs-syncfreq-v4-0-165ba21401dc@linaro.org> <20251112-james-cs-syncfreq-v4-8-165ba21401dc@linaro.org> <20251114153021.GH3568724@e132581.arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20251114153021.GH3568724@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 14/11/2025 3:30 pm, Leo Yan wrote: > On Wed, Nov 12, 2025 at 03:22:14PM +0000, James Clark wrote: >> The "config:" string construction in format_attr_contextid_show() can be >> removed because it either showed the existing context1 or context2 >> formats which have already been generated, so can be called themselves. >> >> The other conversions are straightforward replacements. >> >> Signed-off-by: James Clark >> --- >> drivers/hwtracing/coresight/coresight-etm-perf.c | 18 ++++++++---------- >> 1 file changed, 8 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c >> index d19e2568a0d1..7272e758aebf 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm-perf.c >> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c >> @@ -80,12 +80,11 @@ static ssize_t format_attr_contextid_show(struct device *dev, >> struct device_attribute *attr, >> char *page) >> { >> - int pid_fmt = ETM_OPT_CTXTID; >> - >> #if IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM4X) >> - pid_fmt = is_kernel_in_hyp_mode() ? ETM_OPT_CTXTID2 : ETM_OPT_CTXTID; >> + if (is_kernel_in_hyp_mode()) >> + return contextid2_show(dev, attr, page); >> #endif > > As said, this function now is only used for ETM4, we can remove "#if > IS_ENABLED(...)". > > Otherwise, LGTM: > > Reviewed-by: Leo Yan Unfortunately it's still needed to make the build work. is_kernel_in_hyp_mode() results in an undefined symbol when building for arm32 so it needs to be ifdef'd out. I can add a comment though.