From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: christian.koenig@amd.com, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Shashank.Sharma@amd.com, daniel.vetter@ffwll.ch,
alexander.deucher@amd.com
Subject: Re: [PATCH] drm/amdgpu: adjust the pid in the grab_id trace point
Date: Wed, 12 Aug 2020 17:33:54 +0200 [thread overview]
Message-ID: <8f262830-7e73-09aa-e790-7222ab66038d@gmail.com> (raw)
In-Reply-To: <20200812111920.06efa663@oasis.local.home>
Am 12.08.20 um 17:19 schrieb Steven Rostedt:
> On Wed, 12 Aug 2020 16:36:36 +0200
> Christian König <ckoenig.leichtzumerken@gmail.com> wrote:
>
>> Am 12.08.20 um 16:17 schrieb Steven Rostedt:
>>> On Fri, Aug 07, 2020 at 03:36:58PM +0200, Christian König wrote:
>>>> Trace something useful instead of the pid of a kernel thread here.
>>>>
>>>> Signed-off-by: Christian König <christian.koenig@amd.com>
>>>> ---
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
>>>> index 5da20fc166d9..07f99ef69d91 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
>>>> @@ -228,6 +228,7 @@ TRACE_EVENT(amdgpu_vm_grab_id,
>>>> ),
>>>>
>>>> TP_fast_assign(
>>>> + __entry->ent.pid = vm->task_info.pid;
>>> If the ent.pid is not the pid you are interested in for this trace event, just
>>> add a "pid" field to the trace event and place it there. Do not modify the
>>> generic pid that is recorded, as we would like that to be consistent for all
>>> trace events.
>> The problem my userspace guys have is that this doesn't work with
>> "trace-cmd -P $pid".
>>
>> But I think I can teach them how filters work :)
> Yep, trace-cmd record -e event -f "pid == $pid"
>
>>> The "ent.pid" turns into "common_pid" in the field, leaving "pid" free to use.
>>> Other trace events (like sched_waking) record a pid field that is not the same
>>> as the pid of the executing task.
>> Yes, we thought about this alternative as well.
>>
>>> The "ent.pid" should always be the pid of the task that executed the event.
>> Why? For the case here we just execute a work item in the background for
>> an userspace process.
>>
>> Tracing the pid of the worker pool which executes it doesn't seem to
>> make to much sense.
> Maybe not for you, but it does for me. All trace events show what
> happened when it happened and who executed it. I like to see what
> worker threads are executing. I may filter on the worker thread, and by
> changing the ent.pid, I wont see what it is doing.
That's enough explanation for me. Going with the separate pid field then.
Thanks,
Christian.
>
> That said, I think I may add a feature to a trace evnt for a special filter
> to say, "test field to the set_event_pid", and if it exists in that
> file to include that event in the filtered trace. This would include
> sched_waking trace events as well.
>
> That way "trace-cmd record -P $pid" will still work for your case.
>
> -- Steve
next prev parent reply other threads:[~2020-08-12 15:34 UTC|newest]
Thread overview: 9+ 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 ` [PATCH] drm/amdgpu: adjust the pid in the grab_id trace point Christian König
2020-08-12 14:17 ` Steven Rostedt
2020-08-12 14:36 ` Christian König
2020-08-12 15:19 ` Steven Rostedt
2020-08-12 15:33 ` Christian König [this message]
2020-08-12 13:42 ` RFC: How to adjust the trace pid? Christian König
2020-08-12 13:49 ` Daniel Vetter
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=8f262830-7e73-09aa-e790-7222ab66038d@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=Shashank.Sharma@amd.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=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 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®