From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (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 D2851199920 for ; Fri, 23 Jan 2026 12:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769172764; cv=pass; b=VFw70rnbcFj8Sf8h8YYyzo7FzOV5KxskNXO9OTWPMcJk2lFCYjQ5azy31r3UwT+mqYByjozrHGZI+FjAV6mPeUt/cVh4wtvpm/tYi25dhBbtN9KmxbijkZPA7+7RZ2PdY+tywf54mBpI+sLovk0hkuNdUoZ4ukW5DoFCqCaVe0o= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769172764; c=relaxed/simple; bh=6/fQ+ulJ0Sx1xasyi1Bjowd6fnLej3X55MaV88+qpMs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FUjbLjIhUQtDmi2zVRH5r/bC469spdji+STM2DModI3ImSSoKuA2ua+Ezy7FcCx8lsH12Cr1ecB8ukoSMVRhUSPKE+w2BPKDGizMry7rJgVMVmzWIDDRxzfV5FBf+mn8VgbZCRlV/QnNkDg9ymAtm7gzo4IpeetrLToIn/ESXUc= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b=HeTZ7mn0; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b="HeTZ7mn0" ARC-Seal: i=1; a=rsa-sha256; t=1769172746; cv=none; d=zohomail.com; s=zohoarc; b=V0PQmZzWdrEDh99Ne7ZyUy/D9BJeCD5+wsFJeWBYitVX9qZ4ARiX6MicOjeNVqy6E624ixu/ut9hhHmqxGlsc4sv6y7qZ/UDD+Rm3lm/sRU52K9pr2NJws1wJUKlN5WS0mT7l+hmkxCs/izQzWyiH/aMwuysPxrqXw6fmfqD+N0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769172746; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=WLzWh+kPssdoz1DDdk13Bo5eLnz75ri+s7voPGzm1xI=; b=Wh6+3XuvTo+rwVpQ654ObzIql4KEmT2gte2vCAGmWW+t7uD2mU9b4axQgQJb2goGkjK6Dj8ca/xfmS6S3hHctmIK8gYE4v5mio5vY2IPNgZu+fZjuBYc3pPeZqphVXIAD6v6gF71+SdyODyrqnWbbPZm/PvSMwfmSxHclniHMp0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1769172746; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=WLzWh+kPssdoz1DDdk13Bo5eLnz75ri+s7voPGzm1xI=; b=HeTZ7mn0VtWEypM7/yAnp9JKqKUtUZ5X9zc5IDt9FfGPECVZtmo0F6ay2e7jxswA pbyXUjkY3KIZsGgN5rFbGdBgD9XLhs/e1U8m4ymUT67YaXgWTpBCJn54pWfcLf1wpCC Mc0EuaV5Lg+k4dPlUsdW9GbGGvgAWB7yle3QHlAc= Received: by mx.zohomail.com with SMTPS id 1769172745758534.9477985844247; Fri, 23 Jan 2026 04:52:25 -0800 (PST) From: Nicolas Frattaroli To: Sasha Levin Cc: Boris Brezillon , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Chia-I Wu , Karunika Choo , kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v10 3/4] drm/panthor: Add tracepoint for hardware utilisation changes Date: Fri, 23 Jan 2026 13:52:19 +0100 Message-ID: <3154579.irdbgypaU6@workhorse> In-Reply-To: References: <20260116-panthor-tracepoints-v10-0-d925986e3d1b@collabora.com> <20260116-panthor-tracepoints-v10-3-d925986e3d1b@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" On Friday, 23 January 2026 05:02:21 Central European Standard Time Sasha Levin wrote: > Hi Nicolas, > > On Fri, Jan 16, 2026 at 01:57:32PM +0100, Nicolas Frattaroli wrote: > >Mali GPUs have three registers that indicate which parts of the hardware > >are powered at any moment. These take the form of bitmaps. In the case > >of SHADER_READY for example, a high bit indicates that the shader core > >corresponding to that bit index is powered on. These bitmaps aren't > >solely contiguous bits, as it's common to have holes in the sequence of > >shader core indices, and the actual set of which cores are present is > >defined by the "shader present" register. > > > >When the GPU finishes a power state transition, it fires a > >GPU_IRQ_POWER_CHANGED_ALL interrupt. After such an interrupt is > >received, the _READY registers will contain new interesting data. During > >power transitions, the GPU_IRQ_POWER_CHANGED interrupt will fire, and > >the registers will likewise contain potentially changed data. > > > >This is not to be confused with the PWR_IRQ_POWER_CHANGED_ALL interrupt, > >which is something related to Mali v14+'s power control logic. The > >_READY registers and corresponding interrupts are already available in > >v9 and onwards. > > > >Expose the data as a tracepoint to userspace. This allows users to debug > >various scenarios and gather interesting information, such as: knowing > >how much hardware is lit up at any given time, correlating graphics > >corruption with a specific powered shader core, measuring when hardware > >is allowed to go to a powered off state again, and so on. > > > >The registration/unregistration functions for the tracepoint go through > >a wrapper in panthor_hw.c, so that v14+ can implement the same > >tracepoint by adding its hardware specific IRQ on/off callbacks to the > >panthor_hw.ops member. > > > >Signed-off-by: Nicolas Frattaroli > >--- > > drivers/gpu/drm/panthor/panthor_gpu.c | 28 +++++++++++++++ > > drivers/gpu/drm/panthor/panthor_gpu.h | 2 ++ > > drivers/gpu/drm/panthor/panthor_hw.c | 62 +++++++++++++++++++++++++++++++++ > > drivers/gpu/drm/panthor/panthor_hw.h | 8 +++++ > > drivers/gpu/drm/panthor/panthor_trace.h | 58 ++++++++++++++++++++++++++++++ > > 5 files changed, 158 insertions(+) > > > >diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c > >index 9304469a711a..2ab444ee8c71 100644 > >--- a/drivers/gpu/drm/panthor/panthor_gpu.c > >+++ b/drivers/gpu/drm/panthor/panthor_gpu.c > >@@ -22,6 +22,9 @@ > > #include "panthor_hw.h" > > #include "panthor_regs.h" > > > >+#define CREATE_TRACE_POINTS > >+#include "panthor_trace.h" > > With this commit, I'm seeing: > > In file included from drivers/gpu/drm/panthor/panthor_trace.h:86, > from drivers/gpu/drm/panthor/panthor_gpu.c:26: > ./include/trace/define_trace.h:118:42: fatal error: ./panthor_trace.h: No such file or directory > 118 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > > I think we need to add in 'CFLAGS_panthor_gpu.o := -I$(src)' to the Makefile > too, but I haven't tested that yet. > > Huh, puzzling that I never ran into this build failure. Doing another build right now, I still can't reproduce it even on a clean build without ccache. Your fix looks appropriate though judging by the LWM[1] series on event tracepoints. I'll submit a fix for this. Link: https://lwn.net/Articles/383362/ [1]