Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1227853rdb; Fri, 16 Feb 2024 08:57:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW5AoRz1m0HAtzjlNPw0zr9SXsM/0tdr6bDkQ93G38asYUFAWM8KqqbNUsV1+HJUfFLpgvhuwrSgwGYMhgq13be0sewQnkcaeUt9X1IzA== X-Google-Smtp-Source: AGHT+IHFveiyEbzyOVt2oNgSMgfFHklURPSU22XI+9uUW3Ca+MtP5bEkiYG5XaHTxPFaynKAh60s X-Received: by 2002:a05:620a:1723:b0:785:ca44:278a with SMTP id az35-20020a05620a172300b00785ca44278amr6902485qkb.58.1708102652979; Fri, 16 Feb 2024 08:57:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708102652; cv=pass; d=google.com; s=arc-20160816; b=G8hmCkbZ/uiPFMlJu2zFOakJ/FDmDqiY8gN+2vIPCPnlMSbdAShkbAJgYb6B4zLKIP UUT50cqE3CLGXtKZlCzk109+0keZMGHQmQUUgNqlmEjM7Nc3YF8d9vIy/+0lpRP+C3Ul tV6bkvvd5QJSkYw0uCL1wPXSL3c4YLn5FZI3Q/m4QbZhzuJ+s1/wOLbpdRFqTIaTzlCv aIddcAK3hy65ip1cB3us+Rnv+9zdG1OXhhllcVzgoQPxu43k+fVtYtoVZiwXGykdabSJ 3YRA53MTIQJcmhW6BULbFXDR/NCwPVyb+VzD+/tqadJIcBFagleUUQYN21tarEiB7tip jq+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=a54mBlPJQ0nr4LxEOnQe6E9J05YCJwMg6dbDW6Ogvwk=; fh=vaZ6b7fqiALnLtoTUXsrucmgZHIaHw7k+bKs2q+Gzws=; b=fHYmRN7m9onR+LyzGXDtU/opndV+8N/PEu4V/wHwMrl2WjqsRINf9h8FaQkjFknCY+ y/Xmd7aLHQAguKOXgCRuBQy7dRQLwsIMHwazW4vLyElpPDlTVkbHXf+WpxsgWcEZlcpc MOTBOEn4eABTY6MIReFfYbCod6uhL2NH7w7sL1slpSjUudVMWl8CU0PhqchqGspn/6+X hbUSkvMK3iv3wv1uILNA0IGnWnBrdWlzUqG1jQU3QCSQE0yz/D139sl0i8odGnXeaiQC XZxyoIvnZi0Pet+f1mW5xyqkQqnr/mDf1pK632VIjKiFnZLqAughIqSwr0f0f6C5FruH IPyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=MbHfdr4v; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-68997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68997-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pi41-20020a05620a37a900b00786e8e0f8e6si241202qkn.577.2024.02.16.08.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 08:57:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=MbHfdr4v; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-68997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68997-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D7E0A1C22FCD for ; Fri, 16 Feb 2024 16:57:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92136130AF7; Fri, 16 Feb 2024 16:57:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="MbHfdr4v" Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (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 21ADD5465D for ; Fri, 16 Feb 2024 16:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708102641; cv=none; b=BA8jAuyytYWhLunoQUKk9ktt8Mcd0SWiG+Tl0QCUa1la5TUvyNkFRl44cwJIR3/rYSw23HwZ/qCubD5bexFFSwTBn+yTpl265TQC9nEl6wlPBkCKrnEV5CcuBJpwwuOaxZqWMEWlx12XcFnukIGI3Ds9sHjE6fg73pFx51JwV94= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708102641; c=relaxed/simple; bh=3DZuNTpPAV7ON2bNBWe9a6b0uHPgEZJRF58/k9z+cxw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=TKx8hjmuYLvjIIlc533A75ErL1A3O4QVM5HrCaB/KHvWZkQ5vLZdwexHGiDZlu/GQ+mwlo8AFXxLi6twesQHUb+RSWX+FZTSCQM99Q2HynwyDNCUVvmraY2/JfzZ7m2Tp2Xif16PYWWz23/woG6wmgTdTNIxOk+AW0DGUUqiLQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=MbHfdr4v; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3bc21303a35so770162b6e.0 for ; Fri, 16 Feb 2024 08:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1708102639; x=1708707439; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=a54mBlPJQ0nr4LxEOnQe6E9J05YCJwMg6dbDW6Ogvwk=; b=MbHfdr4vgQepVwmwGbfeCOOejVDfuL16CtfpBS75V2FNL9K5AfW60bjf9xyN8e0mgf c4dHehM+ZTpbC2Xt3NApctFRXrNDvxmOtBtVC086ZMccpVB7bXId+jCgkdm8lfhKrxsA WU0cKMm+D5NPJwigePTRT6YM1/H73P2HzUohY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708102639; x=1708707439; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a54mBlPJQ0nr4LxEOnQe6E9J05YCJwMg6dbDW6Ogvwk=; b=CfHE6OCGtXLghQs9Dql4uX18lImWUjpkTdSpsGb88pHnlS+c9vmzAMHBU5MydDIQsb sDwqeW1dWp7RQH/ObNnCo5/ngVKk7Tpnl3GoXct8mIkt3KmWB3507LyJHTe4usqdjQSH F4qztDiJer2PW2EZcebYyn3Y2f7PYT3mVNkeGR578ZMQXdnA4pJFf06p5bK/N9a2EWf0 VGnsmrBktzddy0YNXrSk57c2o9jTIGZF/SUiHDy4VJb2olXs7E4toqSl6QbEYJoEplK6 y2JxyEh3TZ8GXbkkvSdWqd2l57Hm3/GJFxo4lLQ/Nqt025Vp6OK7PyllD7mr6jsdB3nH Cm+Q== X-Forwarded-Encrypted: i=1; AJvYcCUT4xplah1Xs6iV4lFdw/mY5Qwq9Rqd9uhgLC2oAXe8KqYFvorF2DTPA/SXx6DB3KgHCB2g310lhmLtqTxgEXzvrdpdrI2ux2rW70f1 X-Gm-Message-State: AOJu0YxmXKw1pBf9KGH9NO4pXl7N9wLKUUUOD9YyPW+LyK/JkRelna8o X07Kyn1XvMet39lx54lL1QGEAjxFTLBZUXJl9chKy/LQ+LflcJ5cyMe5aDUXQWOU6r+4ausXsZl c6S59iDSCagDw+26ZqR73gXtUxGXAFsGakuA9jQ== X-Received: by 2002:a05:6870:b528:b0:21e:3794:9e24 with SMTP id v40-20020a056870b52800b0021e37949e24mr5556668oap.3.1708102639106; Fri, 16 Feb 2024 08:57:19 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240214121435.3813983-1-adrian.larumbe@collabora.com> In-Reply-To: From: Daniel Vetter Date: Fri, 16 Feb 2024 17:57:07 +0100 Message-ID: Subject: Re: [PATCH 0/1] Always record job cycle and timestamp information To: Steven Price , Tvrtko Ursulin , Lionel Landwerlin Cc: =?UTF-8?Q?Adri=C3=A1n_Larumbe?= , Boris Brezillon , Rob Herring , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 14, 2024 at 01:52:05PM +0000, Steven Price wrote: > Hi Adri=C3=A1n, > > On 14/02/2024 12:14, Adri=C3=A1n Larumbe wrote: > > A driver user expressed interest in being able to access engine usage s= tats > > through fdinfo when debugfs is not built into their kernel. In the curr= ent > > implementation, this wasn't possible, because it was assumed even for > > inflight jobs enabling the cycle counter and timestamp registers would > > incur in additional power consumption, so both were kept disabled until > > toggled through debugfs. > > > > A second read of the TRM made me think otherwise, but this is something > > that would be best clarified by someone from ARM's side. > > I'm afraid I can't give a definitive answer. This will probably vary > depending on implementation. The command register enables/disables > "propagation" of the cycle/timestamp values. This propagation will cost > some power (gates are getting toggled) but whether that power is > completely in the noise of the GPU as a whole I can't say. > > The out-of-tree kbase driver only enables the counters for jobs > explicitly marked (BASE_JD_REQ_PERMON) or due to an explicit connection > from a profiler. > > I'd be happier moving the debugfs file to sysfs rather than assuming > that the power consumption is small enough for all platforms. > > Ideally we'd have some sort of kernel interface for a profiler to inform > the kernel what it is interested in, but I can't immediately see how to > make that useful across different drivers. kbase's profiling support is > great with our profiling tools, but there's a very strong connection > between the two. Yeah I'm not sure whether a magic (worse probably per-driver massively different) file in sysfs is needed to enable gpu perf monitoring stats in fdinfo. I get that we do have a bit a gap because the linux perf pmu stuff is global, and you want per-process, and there's kinda no per-process support for perf stats for devices. But that's probably the direction we want to go, not so much fdinfo. At least for hardware performance counters and things like that. Iirc the i915 pmu support had some integration for per-process support, you might want to chat with Tvrtko for kernel side and Lionel for more userspace side. At least if I'm not making a complete mess and my memory is vaguely related to reality. Adding them both. Cheers, Sima > > Steve > > > Adri=C3=A1n Larumbe (1): > > drm/panfrost: Always record job cycle and timestamp information > > > > drivers/gpu/drm/panfrost/Makefile | 2 -- > > drivers/gpu/drm/panfrost/panfrost_debugfs.c | 21 ------------------ > > drivers/gpu/drm/panfrost/panfrost_debugfs.h | 14 ------------ > > drivers/gpu/drm/panfrost/panfrost_device.h | 1 - > > drivers/gpu/drm/panfrost/panfrost_drv.c | 5 ----- > > drivers/gpu/drm/panfrost/panfrost_job.c | 24 ++++++++------------- > > drivers/gpu/drm/panfrost/panfrost_job.h | 1 - > > 7 files changed, 9 insertions(+), 59 deletions(-) > > delete mode 100644 drivers/gpu/drm/panfrost/panfrost_debugfs.c > > delete mode 100644 drivers/gpu/drm/panfrost/panfrost_debugfs.h > > > > > > base-commit: 6b1f93ea345947c94bf3a7a6e668a2acfd310918 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch