From: Patricia Alfonso <trishalfo...@google.com>

In order to integrate debugging tools like KASAN into the KUnit
framework, add KUnit struct to the current task to keep track of the
current KUnit test.

Signed-off-by: Patricia Alfonso <trishalfo...@google.com>
Reviewed-by: Brendan Higgins <brendanhigg...@google.com>
Signed-off-by: David Gow <david...@google.com>
---
 include/linux/sched.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 27882a08163f..f3f990b82bde 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1196,6 +1196,10 @@ struct task_struct {
        struct kcsan_ctx                kcsan_ctx;
 #endif
 
+#if IS_ENABLED(CONFIG_KUNIT)
+       struct kunit                    *kunit_test;
+#endif
+
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        /* Index of current stored address in ret_stack: */
        int                             curr_ret_stack;
-- 
2.28.0.163.g6104cc2f0b6-goog

Reply via email to