Re: [PATCH] kthread: Add kthread_work tracepoints

From: Steven Rostedt
Date: Mon Oct 12 2020 - 11:37:54 EST


On Mon, 12 Oct 2020 08:14:50 -0700
Rob Clark <robdclark@xxxxxxxxxxxx> wrote:

> > DEFINE_EVENT(sched_kthread_work_execute_template, sched_kthread_work_execute_start,
> > TP_PROTO(struct kthread_work *work),
> > TP_ARGS(work));
> >
> > DEFINE_EVENT(sched_kthread_work_execute_template, sched_kthread_work_execute_end,
> > TP_PROTO(struct kthread_work *work),
> > TP_ARGS(work));
> >
> > As events are cheap, classes are expensive (size wise), and a TRACE_EVENT()
> > is really just a CLASS and EVENT for a single instance.
>
> I think we cannot quite do this, because we should not rely on being

Ah I missed seeing that one used work->func and the other passed in the
function.

> able to dereference work after it finishes. Although I suppose I
> could just define it to explicitly pass the fxn ptr to both
> tracepoints..

But yes, I would rather see that. It could save up to 5K in text and data.

-- Steve