systemtap/bz1448099.2.patch

38 lines
1.3 KiB
Diff

commit a477a43122609691ce6ef24f71114cfaa9790392
Author: David Smith <dsmith@redhat.com>
Date: Fri Mar 17 10:44:12 2017 -0500
PR21255: Fix missing __set_task_state() definition.
* runtime/stp_utrace.c: Fix missing __set_task_state() definition. If we
can't find a __set_task_state() definition, define our own.
diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c
index bb2d663..5924016 100644
--- a/runtime/stp_utrace.c
+++ b/runtime/stp_utrace.c
@@ -29,6 +29,14 @@
#include "stp_helper_lock.h"
+#if defined(__set_task_state)
+#define __stp_set_task_state(tsk, state_value) \
+ __set_task_state((tsk), (state_value))
+#else
+#define __stp_set_task_state(tsk, state_value) \
+ do { (tsk)->state = (state_value); } while (0)
+#endif
+
/*
* Per-thread structure private to utrace implementation.
* If task_struct.utrace_flags is nonzero, task_struct.utrace
@@ -1105,7 +1113,7 @@ static bool utrace_do_stop(struct task_struct *target, struct utrace *utrace)
*/
spin_lock_irq(&target->sighand->siglock);
if (likely(task_is_stopped(target)))
- __set_task_state(target, TASK_TRACED);
+ __stp_set_task_state(target, TASK_TRACED);
spin_unlock_irq(&target->sighand->siglock);
} else if (utrace->resume > UTRACE_REPORT) {
utrace->resume = UTRACE_REPORT;