BPF List
 help / color / mirror / Atom feed
* [PATCH v2] kernel/events/core: check return value of task_function_call()
@ 2022-09-19 19:16 Li Zhong
  2022-09-21  7:46 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zhong @ 2022-09-19 19:16 UTC (permalink / raw)
  To: linux-perf-users, bpf
  Cc: namhyung, jolsa, alexander.shishkin, mark.rutland, acme, mingo,
	peterz, lily

From: lily <floridsleeves@gmail.com>

Check the return value of task_function_call(), which could be error
code when the execution fails. We log this on info level.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 kernel/events/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2621fd24ad26..3848631b009c 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -13520,7 +13520,10 @@ static void perf_cgroup_attach(struct cgroup_taskset *tset)
 	struct cgroup_subsys_state *css;
 
 	cgroup_taskset_for_each(task, css, tset)
-		task_function_call(task, __perf_cgroup_move, task);
+		if (!task_function_call(task, __perf_cgroup_move, task)) {
+			printk(KERN_INFO "perf: this process isn't running!\n");
+			continue;
+		}
 }
 
 struct cgroup_subsys perf_event_cgrp_subsys = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-21  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19 19:16 [PATCH v2] kernel/events/core: check return value of task_function_call() Li Zhong
2022-09-21  7:46 ` Ingo Molnar
2022-09-21  8:10   ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox