All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dave Airlie <airlied@gmail.com>,
	Shashank.Sharma@amd.com, Alex Deucher <alexander.deucher@amd.com>
Subject: Re: RFC: How to adjust the trace pid?
Date: Wed, 12 Aug 2020 16:06:23 +0200	[thread overview]
Message-ID: <dca018cb-8455-874f-7473-fbfbd1d4c7a9@gmail.com> (raw)
In-Reply-To: <CAKMK7uF7nTgJE38Krhnw9Ca4FtFpw4b=nFr8-tWqPxTkRrh=Pw@mail.gmail.com>

Am 12.08.20 um 15:49 schrieb Daniel Vetter:
> On Wed, Aug 12, 2020 at 3:42 PM Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Ping? Daniel, Dave any opinion on this?
> Type patch, cc: tracing people, see what they say?

Adding Ingo and Steven then.

> tbh I have no idea,
> but they have been making unhappy noises about some of the tricks
> we've played in the past in i915 tracepoints. So not everything is
> cool in there.

Well that was the feedback I was looking for.

> Otherwise I guess just add another tracepoint parameter to dump the
> correct userspace mm.

Well the tracing subsystem looks like rather complicated macro magic, so 
I'm not touching that before speaking to he maintainer what approach we 
should take.

> 3rd option could be to dump the current mm (since I'm assuming those
> threads do kthread_use/unuse_mm to impersonate the right userspace
> process correctly) in the tracepoint infrastructure too?

Nope, we don't use kthread_use/unuse_mm since we don't touch the process 
which initiated the operation in any way.

This is just to improve debugging since it doesn't make much sense to 
trace the pid of the worker thread. And since we have the pid of the 
initiator around anyway using it should be trivial.

Question is rather how to do it correctly? I couldn't find much 
precedence for this.

Thanks,
Christian.

>
> Cheers, Daniel
>
>> Christian.
>>
>> Am 07.08.20 um 15:36 schrieb Christian König:
>>> Hi everybody,
>>>
>>> in amdgpu we got the following issue which I'm seeking advise how to cleanly handle it.
>>>
>>> We have a bunch of trace points which are related to the VM subsystem and executed in either a work item, kthread or foreign process context.
>>>
>>> Now tracing the pid of the context which we are executing in is not really that useful, so I'm wondering if we could just overwrite the pid recorded in the trace entry?
>>>
>>> The following patch does exactly that for the vm_grab_id() trace point, but I'm not 100% sure if that is legal or not.
>>>
>>> Any ideas? Comments?
>>>
>>> Thanks,
>>> Christian.
>>>
>>>
>


WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Shashank.Sharma@amd.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	amd-gfx list <amd-gfx@lists.freedesktop.org>,
	Alex Deucher <alexander.deucher@amd.com>
Subject: Re: RFC: How to adjust the trace pid?
Date: Wed, 12 Aug 2020 16:06:23 +0200	[thread overview]
Message-ID: <dca018cb-8455-874f-7473-fbfbd1d4c7a9@gmail.com> (raw)
In-Reply-To: <CAKMK7uF7nTgJE38Krhnw9Ca4FtFpw4b=nFr8-tWqPxTkRrh=Pw@mail.gmail.com>

Am 12.08.20 um 15:49 schrieb Daniel Vetter:
> On Wed, Aug 12, 2020 at 3:42 PM Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Ping? Daniel, Dave any opinion on this?
> Type patch, cc: tracing people, see what they say?

Adding Ingo and Steven then.

> tbh I have no idea,
> but they have been making unhappy noises about some of the tricks
> we've played in the past in i915 tracepoints. So not everything is
> cool in there.

Well that was the feedback I was looking for.

> Otherwise I guess just add another tracepoint parameter to dump the
> correct userspace mm.

Well the tracing subsystem looks like rather complicated macro magic, so 
I'm not touching that before speaking to he maintainer what approach we 
should take.

> 3rd option could be to dump the current mm (since I'm assuming those
> threads do kthread_use/unuse_mm to impersonate the right userspace
> process correctly) in the tracepoint infrastructure too?

Nope, we don't use kthread_use/unuse_mm since we don't touch the process 
which initiated the operation in any way.

This is just to improve debugging since it doesn't make much sense to 
trace the pid of the worker thread. And since we have the pid of the 
initiator around anyway using it should be trivial.

Question is rather how to do it correctly? I couldn't find much 
precedence for this.

Thanks,
Christian.

>
> Cheers, Daniel
>
>> Christian.
>>
>> Am 07.08.20 um 15:36 schrieb Christian König:
>>> Hi everybody,
>>>
>>> in amdgpu we got the following issue which I'm seeking advise how to cleanly handle it.
>>>
>>> We have a bunch of trace points which are related to the VM subsystem and executed in either a work item, kthread or foreign process context.
>>>
>>> Now tracing the pid of the context which we are executing in is not really that useful, so I'm wondering if we could just overwrite the pid recorded in the trace entry?
>>>
>>> The following patch does exactly that for the vm_grab_id() trace point, but I'm not 100% sure if that is legal or not.
>>>
>>> Any ideas? Comments?
>>>
>>> Thanks,
>>> Christian.
>>>
>>>
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Shashank.Sharma@amd.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	amd-gfx list <amd-gfx@lists.freedesktop.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	Dave Airlie <airlied@gmail.com>
Subject: Re: RFC: How to adjust the trace pid?
Date: Wed, 12 Aug 2020 16:06:23 +0200	[thread overview]
Message-ID: <dca018cb-8455-874f-7473-fbfbd1d4c7a9@gmail.com> (raw)
In-Reply-To: <CAKMK7uF7nTgJE38Krhnw9Ca4FtFpw4b=nFr8-tWqPxTkRrh=Pw@mail.gmail.com>

Am 12.08.20 um 15:49 schrieb Daniel Vetter:
> On Wed, Aug 12, 2020 at 3:42 PM Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Ping? Daniel, Dave any opinion on this?
> Type patch, cc: tracing people, see what they say?

Adding Ingo and Steven then.

> tbh I have no idea,
> but they have been making unhappy noises about some of the tricks
> we've played in the past in i915 tracepoints. So not everything is
> cool in there.

Well that was the feedback I was looking for.

> Otherwise I guess just add another tracepoint parameter to dump the
> correct userspace mm.

Well the tracing subsystem looks like rather complicated macro magic, so 
I'm not touching that before speaking to he maintainer what approach we 
should take.

> 3rd option could be to dump the current mm (since I'm assuming those
> threads do kthread_use/unuse_mm to impersonate the right userspace
> process correctly) in the tracepoint infrastructure too?

Nope, we don't use kthread_use/unuse_mm since we don't touch the process 
which initiated the operation in any way.

This is just to improve debugging since it doesn't make much sense to 
trace the pid of the worker thread. And since we have the pid of the 
initiator around anyway using it should be trivial.

Question is rather how to do it correctly? I couldn't find much 
precedence for this.

Thanks,
Christian.

>
> Cheers, Daniel
>
>> Christian.
>>
>> Am 07.08.20 um 15:36 schrieb Christian König:
>>> Hi everybody,
>>>
>>> in amdgpu we got the following issue which I'm seeking advise how to cleanly handle it.
>>>
>>> We have a bunch of trace points which are related to the VM subsystem and executed in either a work item, kthread or foreign process context.
>>>
>>> Now tracing the pid of the context which we are executing in is not really that useful, so I'm wondering if we could just overwrite the pid recorded in the trace entry?
>>>
>>> The following patch does exactly that for the vm_grab_id() trace point, but I'm not 100% sure if that is legal or not.
>>>
>>> Any ideas? Comments?
>>>
>>> Thanks,
>>> Christian.
>>>
>>>
>

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2020-08-12 14:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 13:36 RFC: How to adjust the trace pid? Christian König
2020-08-07 13:36 ` Christian König
2020-08-07 13:36 ` Christian König
2020-08-07 13:36 ` [PATCH] drm/amdgpu: adjust the pid in the grab_id trace point Christian König
2020-08-07 13:36   ` Christian König
2020-08-07 13:36   ` Christian König
2020-08-12 14:17   ` Steven Rostedt
2020-08-12 14:17     ` Steven Rostedt
2020-08-12 14:17     ` Steven Rostedt
2020-08-12 14:36     ` Christian König
2020-08-12 14:36       ` Christian König
2020-08-12 14:36       ` Christian König
2020-08-12 15:19       ` Steven Rostedt
2020-08-12 15:19         ` Steven Rostedt
2020-08-12 15:19         ` Steven Rostedt
2020-08-12 15:33         ` Christian König
2020-08-12 15:33           ` Christian König
2020-08-12 15:33           ` Christian König
2020-08-12 13:42 ` RFC: How to adjust the trace pid? Christian König
2020-08-12 13:42   ` Christian König
2020-08-12 13:42   ` Christian König
2020-08-12 13:49   ` Daniel Vetter
2020-08-12 13:49     ` Daniel Vetter
2020-08-12 13:49     ` Daniel Vetter
2020-08-12 14:06     ` Christian König [this message]
2020-08-12 14:06       ` Christian König
2020-08-12 14:06       ` Christian König

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=dca018cb-8455-874f-7473-fbfbd1d4c7a9@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Shashank.Sharma@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.