[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191231133530.2794-1-pilgrimtao@gmail.com>
Date: Tue, 31 Dec 2019 05:35:30 -0800
From: chengkaitao <pilgrimtao@...il.com>
To: rostedt@...dmis.org
Cc: mingo@...hat.com, linux-kernel@...r.kernel.org, smuchun@...il.com,
Kaitao Cheng <pilgrimtao@...il.com>
Subject: [PATCH] kernel/trace: Fix do not unregister tracepoints when register sched_migrate_task fail
From: Kaitao Cheng <pilgrimtao@...il.com>
In the function, if register_trace_sched_migrate_task() returns error,
sched_switch/sched_wakeup_new/sched_wakeup won't unregister. That is
why fail_deprobe_sched_switch was added.
Signed-off-by: Kaitao Cheng <pilgrimtao@...il.com>
---
kernel/trace/trace_sched_wakeup.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index 5e43b9664eca..617e297f46dc 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -630,7 +630,7 @@ static void start_wakeup_tracer(struct trace_array *tr)
if (ret) {
pr_info("wakeup trace: Couldn't activate tracepoint"
" probe to kernel_sched_migrate_task\n");
- return;
+ goto fail_deprobe_sched_switch;
}
wakeup_reset(tr);
@@ -648,6 +648,8 @@ static void start_wakeup_tracer(struct trace_array *tr)
printk(KERN_ERR "failed to start wakeup tracer\n");
return;
+fail_deprobe_sched_switch:
+ unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL);
fail_deprobe_wake_new:
unregister_trace_sched_wakeup_new(probe_wakeup, NULL);
fail_deprobe:
--
2.20.1
Powered by blists - more mailing lists