mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Rob Clark <robdclark@gmail.com>, dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org,
	Rob Clark <robdclark@chromium.org>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<linux-arm-msm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] drm/msm/rd: Check PT_PTRACED for cmdstream dumping
Date: Sun, 3 Dec 2023 02:08:26 +0200	[thread overview]
Message-ID: <fa10b293-9c7f-4904-88bf-4ec6528bd0ef@linaro.org> (raw)
In-Reply-To: <20230914172453.9707-1-robdclark@gmail.com>

On 14/09/2023 20:24, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> So, when you want to get a cmdstream trace of some deqp or piglit test,
> but you happen to be running it on the same laptop with full desktop
> env, the current dump-everything firehose of `cat $debugfs/dri/n/rd` is
> quite a bit too much.  Ptrace seemed kind of a natural way to control
> it, ie. either run what you want to trace under gdb or hack in a
> ptrace(PTRACE_TRACEME) call.
> 
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>   drivers/gpu/drm/msm/msm_gem_submit.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

I think this is a good idea, to be able to separate process being 
debugged and all other tasks.

> 
> diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
> index a908373cf34b..a105ca1f2102 100644
> --- a/drivers/gpu/drm/msm/msm_gem_submit.c
> +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
> @@ -979,7 +979,8 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
>   	/* The scheduler owns a ref now: */
>   	msm_gem_submit_get(submit);
>   
> -	msm_rd_dump_submit(priv->rd, submit, NULL);
> +	if (current->ptrace & PT_PTRACED)
> +		msm_rd_dump_submit(priv->rd, submit, NULL);
>   
>   	pm_runtime_get_sync(&gpu->pdev->dev);
>   

-- 
With best wishes
Dmitry


      reply	other threads:[~2023-12-03  0:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 17:24 Rob Clark
2023-12-03  0:08 ` Dmitry Baryshkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa10b293-9c7f-4904-88bf-4ec6528bd0ef@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@chromium.org \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®