From 9629f5d14933c67a426f6584b29b5ed70ac97aba Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:23 +0100 Subject: [PATCH] Revert "kthread: add kthread_work tracepoints" This reverts commit 0944044e5748d47cb9126980a2dc73e33b2be23d. --- include/trace/events/sched.h | 84 ------------------------------------ kernel/kthread.c | 9 ---- 2 files changed, 93 deletions(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 0270a2d6d..bcd7f1fbb 100755 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -5,7 +5,6 @@ #if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_SCHED_H -#include #include #include #include @@ -52,89 +51,6 @@ TRACE_EVENT(sched_kthread_stop_ret, TP_printk("ret=%d", __entry->ret) ); -/** - * sched_kthread_work_queue_work - called when a work gets queued - * @worker: pointer to the kthread_worker - * @work: pointer to struct kthread_work - * - * This event occurs when a work is queued immediately or once a - * delayed work is actually queued (ie: once the delay has been - * reached). - */ -TRACE_EVENT(sched_kthread_work_queue_work, - - TP_PROTO(struct kthread_worker *worker, - struct kthread_work *work), - - TP_ARGS(worker, work), - - TP_STRUCT__entry( - __field( void *, work ) - __field( void *, function) - __field( void *, worker) - ), - - TP_fast_assign( - __entry->work = work; - __entry->function = work->func; - __entry->worker = worker; - ), - - TP_printk("work struct=%p function=%ps worker=%p", - __entry->work, __entry->function, __entry->worker) -); - -/** - * sched_kthread_work_execute_start - called immediately before the work callback - * @work: pointer to struct kthread_work - * - * Allows to track kthread work execution. - */ -TRACE_EVENT(sched_kthread_work_execute_start, - - TP_PROTO(struct kthread_work *work), - - TP_ARGS(work), - - TP_STRUCT__entry( - __field( void *, work ) - __field( void *, function) - ), - - TP_fast_assign( - __entry->work = work; - __entry->function = work->func; - ), - - TP_printk("work struct %p: function %ps", __entry->work, __entry->function) -); - -/** - * sched_kthread_work_execute_end - called immediately after the work callback - * @work: pointer to struct work_struct - * @function: pointer to worker function - * - * Allows to track workqueue execution. - */ -TRACE_EVENT(sched_kthread_work_execute_end, - - TP_PROTO(struct kthread_work *work, kthread_work_func_t function), - - TP_ARGS(work, function), - - TP_STRUCT__entry( - __field( void *, work ) - __field( void *, function) - ), - - TP_fast_assign( - __entry->work = work; - __entry->function = function; - ), - - TP_printk("work struct %p: function %ps", __entry->work, __entry->function) -); - /* * Tracepoint for waking up a task: */ diff --git a/kernel/kthread.c b/kernel/kthread.c index ba8502ee9..b8adefac8 100755 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -774,15 +774,8 @@ repeat: raw_spin_unlock_irq(&worker->lock); if (work) { - kthread_work_func_t func = work->func; __set_current_state(TASK_RUNNING); - trace_sched_kthread_work_execute_start(work); work->func(work); - /* - * Avoid dereferencing work after this point. The trace - * event only cares about the address. - */ - trace_sched_kthread_work_execute_end(work, func); } else if (!freezing(current)) schedule(); @@ -911,8 +904,6 @@ static void kthread_insert_work(struct kthread_worker *worker, { kthread_insert_work_sanity_check(worker, work); - trace_sched_kthread_work_queue_work(worker, work); - list_add_tail(&work->node, pos); work->worker = worker; if (!worker->current_work && likely(worker->task))